VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
void setVisitedTriggers (const std::set< DtString > &s)
virtual DtSimStatementinternalNext ()

Protected Member Functions

 DtRecursiveSimBlockIterator ()
 Default Constructor. Do not use.

Protected Attributes

DtSimStatementmyCursor
DtSimBlockmyList
DtRecursiveSimStatementIteratormyChildIterator
DtRecursiveSimStatementIteratormyParentIterator
std::set< DtStringmyVisitedTriggers

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
void DtRecursiveSimBlockIterator::setVisitedTriggers ( const std::set< DtString > &  s)
inline
virtual DtSimStatement* DtRecursiveSimBlockIterator::internalNext ( )
virtual

Member Data Documentation

DtSimStatement* DtRecursiveSimBlockIterator::myCursor
protected
DtSimBlock* DtRecursiveSimBlockIterator::myList
protected
DtRecursiveSimStatementIterator* DtRecursiveSimBlockIterator::myChildIterator
protected
DtRecursiveSimStatementIterator* DtRecursiveSimBlockIterator::myParentIterator
protected
std::set<DtString> DtRecursiveSimBlockIterator::myVisitedTriggers
protected

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

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)