Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

OMF::ModelIterator Class Reference

#include <ModelIterator.hpp>

List of all members.


Detailed Description

The ModelIterator class is used to iterate through the containment tree of a model in a prefix visiter pattern. That is to say that dereferencing the iterator after an assignment will give you the object you just assigned it. This does NOT work like a typical std library iterator because it isn't specifically attached to a model. Instead, the iterator can be given to an arbitrary object and walk the containment tree.


Public Types

enum  Traversal { Prefix, Postfix }

Public Member Functions

 ModelIterator ()
 ModelIterator (const ModelIterator &iter)
 ModelIterator (ModelObject *obj)
 ModelIterator (Model *model)
 ~ModelIterator ()
const ModelIteratoroperator= (ModelObject *begin)
const ModelIteratoroperator= (Model *begin)
const ModelIteratoroperator++ ()
ModelIterator operator++ (int)
 operator bool () const
ModelObjectoperator * ()
ModelObjectoperator-> ()
void pre (ModelObject *obj)
void pre (Model *model)
void post (ModelObject *obj)
void post (Model *model)


Member Enumeration Documentation

enum OMF::ModelIterator::Traversal
 

This enumeration defines how the containment tree iteration is performed. Options are prefix traversal or postfix traversal.

Enumeration values:
Prefix 
Postfix 


Constructor & Destructor Documentation

OMF::ModelIterator::ModelIterator  ) 
 

OMF::ModelIterator::ModelIterator const ModelIterator iter  ) 
 

OMF::ModelIterator::ModelIterator ModelObject obj  ) 
 

OMF::ModelIterator::ModelIterator Model model  ) 
 

OMF::ModelIterator::~ModelIterator  ) 
 


Member Function Documentation

ModelObject* OMF::ModelIterator::operator *  ) 
 

Dereference the iterator.

OMF::ModelIterator::operator bool  )  const
 

Returns true while there are still elements.

ModelIterator OMF::ModelIterator::operator++ int   ) 
 

const ModelIterator& OMF::ModelIterator::operator++  ) 
 

Increment the iterator.

ModelObject* OMF::ModelIterator::operator->  ) 
 

Dereference the iterator.

const ModelIterator& OMF::ModelIterator::operator= Model begin  ) 
 

const ModelIterator& OMF::ModelIterator::operator= ModelObject begin  ) 
 

Assign the iterator to a starting object.

void OMF::ModelIterator::post Model model  ) 
 

void OMF::ModelIterator::post ModelObject obj  ) 
 

Initialie the iterator with a postfix traversal.

void OMF::ModelIterator::pre Model model  ) 
 

void OMF::ModelIterator::pre ModelObject obj  ) 
 

Initialize the iterator with a prefix traversal.


The documentation for this class was generated from the following file:
Generated on Fri Sep 10 13:07:38 2004 for OpenModelingFramework by doxygen 1.3.8