![]() |
VR-Forces 5.0.2 Developer's Guide
|
Description: DtMapIteratorBase is the base class for iterators used to iterate over a std::map. It wraps the std::map::iterator to provide an interface similar to DtIteratorBase.
Public Member Functions | |
| DtMapIteratorBase (const std::map< K, T * > &map) | |
| DtMapIteratorBase (const DtMapIteratorBase &orig) | |
| virtual | ~DtMapIteratorBase () |
| virtual unsigned int | size () const |
| virtual bool | empty () const |
| virtual const std::map< K, T * > & | map () |
| virtual bool | reset (bool reverse=false) |
| virtual bool | reset (DtIteratorLocation location, DtIteratorDirection direction=DtIteratorForward) |
| virtual void | reverse () |
| virtual void | setDirection (DtIteratorDirection direction) |
| virtual DtIteratorDirection | direction () |
| virtual T * | internalFirst (bool move=true) |
| T * | operator-> () |
| T * | operator* () |
| virtual T * | internalCurrent () const |
| virtual T * | internalNext (bool move=true) |
| virtual T * | internalLast (bool move=true) |
| virtual T * | internalWrapNext (bool move=true) |
| virtual T * | internalPrev (bool move=true) |
| virtual T * | internalWrapPrev (bool move=true) |
| virtual T * | current () |
| virtual T * | first (bool move=true) |
| virtual T * | next (bool move=true) |
| virtual T * | prev (bool move=true) |
| virtual T * | last (bool move=true) |
| virtual T * | wrapNext (bool move=true) |
| virtual T * | wrapPrev (bool move=true) |
| T * | operator++ () |
| T * | operator-- () |
Protected Attributes | |
| std::map< K, T * > | myMap |
| std::map< K, T * >::const_iterator | myCursor |
| DtIteratorDirection | myDirection |
Private Member Functions | |
| DtMapIteratorBase () | |
| const DtMapIteratorBase & | operator= (const DtMapIteratorBase &orig) |
|
private |
|
inline |
Constructor. Supply the DtList to be iterated over.
References DtMapIteratorBase< K, T >::first().
|
inline |
Copy constructor.
|
inlinevirtual |
|
private |
Assignment Operator.
|
inlinevirtual |
References DtMapIteratorBase< K, T >::myMap.
|
inlinevirtual |
References DtMapIteratorBase< K, T >::myMap.
|
inlinevirtual |
References DtMapIteratorBase< K, T >::myMap.
|
inlinevirtual |
Sets the cursor and the direction of this iterator over the list. If reverse is false, DtIteratorBeginning and DtIteratorForward are used, otherwise, DtIteratorEnd and DtIteratorReverse are used. Returns true unless the list is empty.
References DtIteratorBeginning, DtIteratorEnd, DtIteratorForward, DtIteratorReverse, and DtMapIteratorBase< K, T >::reverse().
Referenced by DtMapIteratorBase< K, T >::internalFirst(), and DtMapIteratorBase< K, T >::internalLast().
|
inlinevirtual |
Sets the cursor and the direction of this iterator over the list.
References DtMapIteratorBase< K, T >::direction(), DtIteratorBeginning, DtIteratorEnd, DtMapIteratorBase< K, T >::myCursor, DtMapIteratorBase< K, T >::myDirection, and DtMapIteratorBase< K, T >::myMap.
|
inlinevirtual |
Reverses the direction of this iterator. The cursor is not moved.
References DtIteratorForward, DtIteratorReverse, and DtMapIteratorBase< K, T >::myDirection.
Referenced by DtMapIteratorBase< K, T >::reset().
|
inlinevirtual |
Sets the direction of this iterator. The cursor is not moved.
References DtMapIteratorBase< K, T >::direction(), and DtMapIteratorBase< K, T >::myDirection.
|
inlinevirtual |
Returns the current direction of the iterator.
References DtMapIteratorBase< K, T >::myDirection.
Referenced by DtMapIteratorBase< K, T >::reset(), and DtMapIteratorBase< K, T >::setDirection().
|
inlinevirtual |
Returns the first vertex in the list if going DtIteratorForward, and the last vertex if going DtIteratorReverse. If move is true, first() resets this iterator to DtIteratorBeginning and DtIteratorForward if going DtIteratorForward DtIteratorEnd and DtIteratorReverse if going DtIteratorReverse.
References DtIteratorForward, DtMapIteratorBase< K, T >::myDirection, DtMapIteratorBase< K, T >::myMap, and DtMapIteratorBase< K, T >::reset().
Referenced by DtMapIteratorBase< K, T >::first().
|
inline |
References DtMapIteratorBase< K, T >::current().
|
inline |
References DtMapIteratorBase< K, T >::current().
|
inlinevirtual |
Returns the current vertex. The cursor is not moved.
References DtMapIteratorBase< K, T >::myCursor, and DtMapIteratorBase< K, T >::myMap.
Referenced by DtMapIteratorBase< K, T >::current().
|
inlinevirtual |
|
inlinevirtual |
Returns the last vertex in the list if going DtIteratorForward, and the first vertex if going DtIteratorReverse. If move is true, last() resets this iterator to DtIteratorEnd and DtIteratorReverse if going DtIteratorForward DtIteratorBeginning and DtIteratorForward if going DtIteratorReverse.
References DtIteratorForward, DtMapIteratorBase< K, T >::myDirection, DtMapIteratorBase< K, T >::myMap, and DtMapIteratorBase< K, T >::reset().
Referenced by DtMapIteratorBase< K, T >::last().
|
inlinevirtual |
If the cursor is 0, returns 0 (move is ignored in this case). Otherwise, returns the vertex at the next position in the list in the current direction and if move is true, moves the cursor there.
References DtIteratorForward, DtMapIteratorBase< K, T >::myCursor, DtMapIteratorBase< K, T >::myDirection, and DtMapIteratorBase< K, T >::myMap.
Referenced by DtMapIteratorBase< K, T >::wrapNext().
|
inlinevirtual |
If the cursor is 0, returns 0 (move is ignored in this case). Otherwise, returns the vertex at the previous position in the list in the current direction and if move is true, moves the cursor there.
References DtIteratorForward, DtMapIteratorBase< K, T >::myCursor, DtMapIteratorBase< K, T >::myDirection, and DtMapIteratorBase< K, T >::myMap.
Referenced by DtMapIteratorBase< K, T >::prev().
|
inlinevirtual |
|
inlinevirtual |
References DtMapIteratorBase< K, T >::internalCurrent().
Referenced by DtMapIteratorBase< K, T >::operator*(), and DtMapIteratorBase< K, T >::operator->().
|
inlinevirtual |
References DtMapIteratorBase< K, T >::internalFirst().
Referenced by DtMapIteratorBase< K, T >::DtMapIteratorBase().
|
inlinevirtual |
References DtMapIteratorBase< K, T >::internalNext().
Referenced by DtMapIteratorBase< K, T >::operator++().
|
inlinevirtual |
References DtMapIteratorBase< K, T >::internalPrev().
Referenced by DtMapIteratorBase< K, T >::operator--().
|
inlinevirtual |
References DtMapIteratorBase< K, T >::internalLast().
|
inlinevirtual |
References DtMapIteratorBase< K, T >::internalWrapNext().
|
inlinevirtual |
References DtMapIteratorBase< K, T >::internalWrapPrev().
|
inline |
References DtMapIteratorBase< K, T >::next().
|
inline |
References DtMapIteratorBase< K, T >::prev().
|
protected |
const std::map<K, T*>& myMap; Will be slower, but, in order to be thread safe this must be a copy, not a pointer to the list
Referenced by DtMapIteratorBase< K, T >::empty(), DtMapIteratorBase< K, T >::internalCurrent(), DtMapIteratorBase< K, T >::internalFirst(), DtMapIteratorBase< K, T >::internalLast(), DtMapIteratorBase< K, T >::internalNext(), DtMapIteratorBase< K, T >::internalPrev(), DtMapIteratorBase< K, T >::internalWrapNext(), DtMapIteratorBase< K, T >::internalWrapPrev(), DtMapIteratorBase< K, T >::map(), DtMapIteratorBase< K, T >::reset(), and DtMapIteratorBase< K, T >::size().
|
protected |
|
protected |
Referenced by DtMapIteratorBase< K, T >::direction(), DtMapIteratorBase< K, T >::internalFirst(), DtMapIteratorBase< K, T >::internalLast(), DtMapIteratorBase< K, T >::internalNext(), DtMapIteratorBase< K, T >::internalPrev(), DtMapIteratorBase< K, T >::internalWrapNext(), DtMapIteratorBase< K, T >::internalWrapPrev(), DtMapIteratorBase< K, T >::reset(), DtMapIteratorBase< K, T >::reverse(), and DtMapIteratorBase< K, T >::setDirection().