VR-Forces 4.1 Class Documentation
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
DtRecursiveSimBlockIterator Class Reference

Iterator for iterating over a DtRwIntrusiveList of DtSimStatements and all its descendants (as represented by each DtSimStatement's list of DtSimBlock subblocks). More...

Public Member Functions

 DtRecursiveSimBlockIterator (DtSimBlock *simBlock)
 Constructor.
 DtRecursiveSimBlockIterator (const DtRecursiveSimBlockIterator &orig)
 Copy Constructor.
const DtRecursiveSimBlockIteratoroperator= (const DtRecursiveSimBlockIterator &orig)
 Assignment Operator.
virtual ~DtRecursiveSimBlockIterator ()
 Destructor.
DtRecursiveSimBlockIteratorclone () const
virtual DtSimStatementfirst (bool reset=true)
 Calls reset() if reset arg is true (useful for for() loops).
virtual DtSimStatementcurrent () const
 returns the current object. List index is unmodified.
virtual DtSimStatementnext ()
 moves the index to the next position and returns the object at that position in the list.
virtual void reset ()
 sets the current pointer to the start of the list.
virtual DtSimStatementcursor () const
 get a pointer to the cursor. Use with care.
virtual DtSimStatementparentStatement () const
 set/get a pointer to the current statement's parent statement.
virtual int parentSubBlockIndex () const
 set/get index of parent subblock in which the current statement resides.
virtual void setParentIterator (DtRecursiveSimStatementIterator *parentIterator)
 set/get parent iterator.
virtual
DtRecursiveSimStatementIterator
parentIterator () const

Protected Member Functions

 DtRecursiveSimBlockIterator ()
 Default Constructor. Do not use.

Protected Attributes

DtSimStatementmyCursor
DtSimBlockmyList
DtRecursiveSimStatementIteratormyChildIterator
DtRecursiveSimStatementIteratormyParentIterator

Detailed Description

Iterator for iterating over a DtRwIntrusiveList of DtSimStatements and all its descendants (as represented by each DtSimStatement's list of DtSimBlock subblocks).

This iterator performs an pre-order iteration over the 'forest' that represents the DtSimBlock's descendants.

Constructor & Destructor Documentation

DtRecursiveSimBlockIterator::DtRecursiveSimBlockIterator ( )
protected

Default Constructor. Do not use.

DtRecursiveSimBlockIterator::DtRecursiveSimBlockIterator ( DtSimBlock simBlock)

Constructor.

simBlock is the DtSimBlock whose statements are to be iterated over.

DtRecursiveSimBlockIterator::DtRecursiveSimBlockIterator ( const DtRecursiveSimBlockIterator orig)

Copy Constructor.

virtual DtRecursiveSimBlockIterator::~DtRecursiveSimBlockIterator ( )
virtual

Destructor.

Member Function Documentation

const DtRecursiveSimBlockIterator& DtRecursiveSimBlockIterator::operator= ( const DtRecursiveSimBlockIterator orig)

Assignment Operator.

DtRecursiveSimBlockIterator* DtRecursiveSimBlockIterator::clone ( ) const
virtual DtSimStatement* DtRecursiveSimBlockIterator::first ( bool  reset = true)
virtual

Calls reset() if reset arg is true (useful for for() loops).

Returns the first object on the list

virtual DtSimStatement* DtRecursiveSimBlockIterator::current ( ) const
virtual

returns the current object. List index is unmodified.

virtual DtSimStatement* DtRecursiveSimBlockIterator::next ( )
virtual

moves the index to the next position and returns the object at that position in the list.

Returns null if already at the end of list.

virtual void DtRecursiveSimBlockIterator::reset ( )
virtual

sets the current pointer to the start of the list.

Normally this isn't needed if you use the standard for loop syntax.

virtual DtSimStatement* DtRecursiveSimBlockIterator::cursor ( ) const
virtual

get a pointer to the cursor. Use with care.

virtual DtSimStatement* DtRecursiveSimBlockIterator::parentStatement ( ) const
virtual

set/get a pointer to the current statement's parent statement.

Accessor is recursive. If currently iterating over a child (myChildIterator exists), invokes child iterator's parentStatement() method. Otherwise, returns myParentStmt.

virtual int DtRecursiveSimBlockIterator::parentSubBlockIndex ( ) const
virtual

set/get index of parent subblock in which the current statement resides.

Accessor is recursive. If currently iterating over a child (myChildIterator exists), invokes child iterator's subBlockIndex() method. Otherwise, returns myParentSubBlockIndex.

virtual void DtRecursiveSimBlockIterator::setParentIterator ( DtRecursiveSimStatementIterator parentIterator)
virtual

set/get parent iterator.

parentIterator is the iterator over our parent statement. Should be NULL in the case that simBlock is the top-level block in a plan. parentIterator is the iterator that created us.

virtual DtRecursiveSimStatementIterator* DtRecursiveSimBlockIterator::parentIterator ( ) const
virtual

Member Data Documentation

DtSimStatement* DtRecursiveSimBlockIterator::myCursor
protected
DtSimBlock* DtRecursiveSimBlockIterator::myList
protected
DtRecursiveSimStatementIterator* DtRecursiveSimBlockIterator::myChildIterator
protected
DtRecursiveSimStatementIterator* DtRecursiveSimBlockIterator::myParentIterator
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)