VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Attributes | Private Member Functions
DtMapIteratorBase< K, T > Class Template Reference

Description: DtMapIteratorBase is the base class for iterators used to iterate over a std::map. More...

Inheritance diagram for DtMapIteratorBase< K, T >:
Inheritance graph
[legend]

Public Member Functions

 DtMapIteratorBase (const std::map< K, T * > &map)
 Constructor. Supply the DtList to be iterated over. More...
 
 DtMapIteratorBase (const DtMapIteratorBase &orig)
 Copy constructor. More...
 
virtual ~DtMapIteratorBase ()
 
virtual unsigned int size () const
 
virtual bool empty () const
 
virtual const std::map< K, T * > & map ()
 
virtual bool reset (bool reverse=false)
 Sets the cursor and the direction of this iterator over the list. More...
 
virtual bool reset (DtIteratorLocation location, DtIteratorDirection direction=DtIteratorForward)
 Sets the cursor and the direction of this iterator over the list. More...
 
virtual void reverse ()
 Reverses the direction of this iterator. The cursor is not moved. More...
 
virtual void setDirection (DtIteratorDirection direction)
 Sets the direction of this iterator. The cursor is not moved. More...
 
virtual DtIteratorDirection direction ()
 Returns the current direction of the iterator. More...
 
virtual T * internalFirst (bool move=true)
 Returns the first vertex in the list if going DtIteratorForward, and the last vertex if going DtIteratorReverse. More...
 
T * operator-> ()
 
T * operator* ()
 
virtual T * internalCurrent () const
 Returns the current vertex. The cursor is not moved. More...
 
virtual T * internalNext (bool move=true)
 
virtual T * internalLast (bool move=true)
 Returns the last vertex in the list if going DtIteratorForward, and the first vertex if going DtIteratorReverse. More...
 
virtual T * internalWrapNext (bool move=true)
 If the cursor is 0, returns 0 (move is ignored in this case). More...
 
virtual T * internalPrev (bool move=true)
 If the cursor is 0, returns 0 (move is ignored in this case). More...
 
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

const std::map< K, T * > & myMap
 
std::map< K, T * >::const_iterator myCursor
 
DtIteratorDirection myDirection
 

Private Member Functions

 DtMapIteratorBase ()
 
const DtMapIteratorBaseoperator= (const DtMapIteratorBase &orig)
 Assignment Operator. More...
 

Detailed Description

template<class K, class T>
class DtMapIteratorBase< K, T >

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.

Constructor & Destructor Documentation

template<class K , class T >
DtMapIteratorBase< K, T >::DtMapIteratorBase ( )
private
template<class K , class T >
DtMapIteratorBase< K, T >::DtMapIteratorBase ( const std::map< K, T * > &  map)
inline

Constructor. Supply the DtList to be iterated over.

References DtMapIteratorBase< K, T >::first().

template<class K , class T >
DtMapIteratorBase< K, T >::DtMapIteratorBase ( const DtMapIteratorBase< K, T > &  orig)
inline

Copy constructor.

template<class K , class T >
virtual DtMapIteratorBase< K, T >::~DtMapIteratorBase ( )
inlinevirtual

Member Function Documentation

template<class K , class T >
const DtMapIteratorBase& DtMapIteratorBase< K, T >::operator= ( const DtMapIteratorBase< K, T > &  orig)
private

Assignment Operator.

template<class K , class T >
virtual unsigned int DtMapIteratorBase< K, T >::size ( ) const
inlinevirtual
Returns
The size of the container being iterated over.

References DtMapIteratorBase< K, T >::myMap.

template<class K , class T >
virtual bool DtMapIteratorBase< K, T >::empty ( ) const
inlinevirtual
Returns
A boolean specifying whether or not the container being iterated over is empty or not.

References DtMapIteratorBase< K, T >::myMap.

template<class K , class T >
virtual const std::map<K, T*>& DtMapIteratorBase< K, T >::map ( )
inlinevirtual
template<class K , class T >
virtual bool DtMapIteratorBase< K, T >::reset ( bool  reverse = false)
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().

template<class K , class T >
virtual bool DtMapIteratorBase< K, T >::reset ( DtIteratorLocation  location,
DtIteratorDirection  direction = DtIteratorForward 
)
inlinevirtual
template<class K , class T >
virtual void DtMapIteratorBase< K, T >::reverse ( )
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().

template<class K , class T >
virtual void DtMapIteratorBase< K, T >::setDirection ( DtIteratorDirection  direction)
inlinevirtual

Sets the direction of this iterator. The cursor is not moved.

References DtMapIteratorBase< K, T >::direction(), and DtMapIteratorBase< K, T >::myDirection.

template<class K , class T >
virtual DtIteratorDirection DtMapIteratorBase< K, T >::direction ( )
inlinevirtual

Returns the current direction of the iterator.

References DtMapIteratorBase< K, T >::myDirection.

Referenced by DtMapIteratorBase< K, T >::reset(), and DtMapIteratorBase< K, T >::setDirection().

template<class K , class T >
virtual T* DtMapIteratorBase< K, T >::internalFirst ( bool  move = true)
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().

template<class K , class T >
T* DtMapIteratorBase< K, T >::operator-> ( )
inline
template<class K , class T >
T* DtMapIteratorBase< K, T >::operator* ( )
inline
template<class K , class T >
virtual T* DtMapIteratorBase< K, T >::internalCurrent ( ) const
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().

template<class K , class T >
virtual T* DtMapIteratorBase< K, T >::internalNext ( bool  move = true)
inlinevirtual
template<class K , class T >
virtual T* DtMapIteratorBase< K, T >::internalLast ( bool  move = true)
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().

template<class K , class T >
virtual T* DtMapIteratorBase< K, T >::internalWrapNext ( bool  move = true)
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().

template<class K , class T >
virtual T* DtMapIteratorBase< K, T >::internalPrev ( bool  move = true)
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().

template<class K , class T >
virtual T* DtMapIteratorBase< K, T >::internalWrapPrev ( bool  move = true)
inlinevirtual
template<class K , class T >
virtual T* DtMapIteratorBase< K, T >::current ( )
inlinevirtual
template<class K , class T >
virtual T* DtMapIteratorBase< K, T >::first ( bool  move = true)
inlinevirtual
template<class K , class T >
virtual T* DtMapIteratorBase< K, T >::next ( bool  move = true)
inlinevirtual
template<class K , class T >
virtual T* DtMapIteratorBase< K, T >::prev ( bool  move = true)
inlinevirtual
template<class K , class T >
virtual T* DtMapIteratorBase< K, T >::last ( bool  move = true)
inlinevirtual
template<class K , class T >
virtual T* DtMapIteratorBase< K, T >::wrapNext ( bool  move = true)
inlinevirtual
template<class K , class T >
virtual T* DtMapIteratorBase< K, T >::wrapPrev ( bool  move = true)
inlinevirtual
template<class K , class T >
T* DtMapIteratorBase< K, T >::operator++ ( )
inline
template<class K , class T >
T* DtMapIteratorBase< K, T >::operator-- ( )
inline

Member Data Documentation

template<class K , class T >
const std::map<K, T*>& DtMapIteratorBase< K, T >::myMap
protected
template<class K , class T >
std::map<K, T*>::const_iterator DtMapIteratorBase< K, T >::myCursor
protected
template<class K , class T >
DtIteratorDirection DtMapIteratorBase< K, T >::myDirection
protected

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

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)