cgma
|
#include <DynamicTreeIterator.hpp>
Public Member Functions | |
DynamicTreeIterator () | |
~DynamicTreeIterator () | |
void | watch (TreeType &the_tree) |
virtual void | reset () |
virtual void | step (int n=1) |
virtual unsigned int | size () const |
virtual OutType * | get () const |
virtual OutType * | next (int n=1) const |
virtual OutType * | get_and_step (int n=1) |
virtual CubitBoolean | move_to (OutType *item) |
virtual CubitBoolean | is_in_list (OutType *item) const |
virtual CubitBoolean | is_at_end () const |
virtual CubitBoolean | is_at_beginning () const |
virtual DynamicDLIIterator < OutType > * | clone () const |
Private Member Functions | |
TreeType::iterator | find_item (OutType *item) const |
Private Attributes | |
TreeType * | mTree |
TreeType::iterator | mIter |
Definition at line 60 of file DynamicTreeIterator.hpp.
DynamicTreeIterator< TreeType, OutType, Which >::DynamicTreeIterator | ( | ) | [inline] |
Definition at line 64 of file DynamicTreeIterator.hpp.
: mTree(0) {}
DynamicTreeIterator< TreeType, OutType, Which >::~DynamicTreeIterator | ( | ) | [inline] |
Definition at line 65 of file DynamicTreeIterator.hpp.
{}
virtual DynamicDLIIterator<OutType>* DynamicTreeIterator< TreeType, OutType, Which >::clone | ( | ) | const [inline, virtual] |
Implements DynamicDLIIterator< OutType >.
Definition at line 145 of file DynamicTreeIterator.hpp.
{ DynamicTreeIterator<TreeType, OutType, Which>* new_iterator = new DynamicTreeIterator<TreeType, OutType, Which>; *new_iterator = *this; return new_iterator; }
TreeType::iterator DynamicTreeIterator< TreeType, OutType, Which >::find_item | ( | OutType * | item | ) | const [inline, private] |
Definition at line 153 of file DynamicTreeIterator.hpp.
{ typename TreeType::iterator iter = std::find_if(mIter, mTree->end(), TreeSelectFind<TreeType, OutType, Which>(item)); if(iter == mTree->end()) { iter = std::find_if(mTree->begin(), mIter, TreeSelectFind<TreeType, OutType, Which>(item)); if(iter == mIter) iter = mTree->end(); } return iter; }
virtual OutType* DynamicTreeIterator< TreeType, OutType, Which >::get | ( | ) | const [inline, virtual] |
Implements DynamicDLIIterator< OutType >.
Definition at line 93 of file DynamicTreeIterator.hpp.
{ if(mTree->empty()) return NULL; return Which()(*mIter); }
virtual OutType* DynamicTreeIterator< TreeType, OutType, Which >::get_and_step | ( | int | n = 1 | ) | [inline, virtual] |
Implements DynamicDLIIterator< OutType >.
Definition at line 111 of file DynamicTreeIterator.hpp.
{ OutType* tmp = get(); step(n); return tmp; }
virtual CubitBoolean DynamicTreeIterator< TreeType, OutType, Which >::is_at_beginning | ( | ) | const [inline, virtual] |
Implements DynamicDLIIterator< OutType >.
Definition at line 141 of file DynamicTreeIterator.hpp.
virtual CubitBoolean DynamicTreeIterator< TreeType, OutType, Which >::is_at_end | ( | ) | const [inline, virtual] |
Implements DynamicDLIIterator< OutType >.
Definition at line 133 of file DynamicTreeIterator.hpp.
{ if(mTree->empty()) return CUBIT_TRUE; typename TreeType::iterator iter = mIter; ++iter; return iter == mTree->end(); }
virtual CubitBoolean DynamicTreeIterator< TreeType, OutType, Which >::is_in_list | ( | OutType * | item | ) | const [inline, virtual] |
Implements DynamicDLIIterator< OutType >.
Definition at line 129 of file DynamicTreeIterator.hpp.
virtual CubitBoolean DynamicTreeIterator< TreeType, OutType, Which >::move_to | ( | OutType * | item | ) | [inline, virtual] |
Implements DynamicDLIIterator< OutType >.
Definition at line 118 of file DynamicTreeIterator.hpp.
{ typename TreeType::iterator iter = find_item(item); if(iter != mTree->end()) { mIter = iter; return CUBIT_TRUE; } return CUBIT_FALSE; }
virtual OutType* DynamicTreeIterator< TreeType, OutType, Which >::next | ( | int | n = 1 | ) | const [inline, virtual] |
Implements DynamicDLIIterator< OutType >.
Definition at line 99 of file DynamicTreeIterator.hpp.
virtual void DynamicTreeIterator< TreeType, OutType, Which >::reset | ( | ) | [inline, virtual] |
Implements DynamicDLIIterator< OutType >.
Definition at line 73 of file DynamicTreeIterator.hpp.
virtual unsigned int DynamicTreeIterator< TreeType, OutType, Which >::size | ( | ) | const [inline, virtual] |
Implements DynamicDLIIterator< OutType >.
Definition at line 89 of file DynamicTreeIterator.hpp.
{ return mTree->size(); }
virtual void DynamicTreeIterator< TreeType, OutType, Which >::step | ( | int | n = 1 | ) | [inline, virtual] |
Implements DynamicDLIIterator< OutType >.
Definition at line 78 of file DynamicTreeIterator.hpp.
void DynamicTreeIterator< TreeType, OutType, Which >::watch | ( | TreeType & | the_tree | ) | [inline] |
Definition at line 67 of file DynamicTreeIterator.hpp.
TreeType::iterator DynamicTreeIterator< TreeType, OutType, Which >::mIter [private] |
Definition at line 167 of file DynamicTreeIterator.hpp.
TreeType* DynamicTreeIterator< TreeType, OutType, Which >::mTree [private] |
Definition at line 166 of file DynamicTreeIterator.hpp.