LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::tree< T >::const_iterator Class Reference

Const iterator type (allows read-only operations). More...

#include <ltiTree.h>

Collaboration diagram for lti::tree< T >::const_iterator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 const_iterator ()
 const_iterator (const const_iterator &other)
 const_iterator (const iterator &other)
const_iteratoroperator++ ()
const_iterator operator++ (int)
bool operator== (const const_iterator &other) const
bool operator!= (const const_iterator &other) const
bool operator== (const iterator &other) const
bool operator!= (const iterator &other) const
const nodeoperator* () const
const_iteratoroperator= (const const_iterator &other)
const_iteratoroperator= (const iterator &other)

Protected Member Functions

 const_iterator (const node &theNode, const nodeManager &owner)

Protected Attributes

std::list< int > stack
const nodepointedNode
const nodeManagertheOwner

Detailed Description

template<class T>
class lti::tree< T >::const_iterator

Const iterator type (allows read-only operations).

The use of the iterator classes is similar to the iterators of the STL (Standard Template Library). See lti::tree::begin() for an example.

CAUTION: Do not delete sibling nodes of already iterated nodes: the iterator keeps track of them, and if you delete them invalid references to unexistent nodes could be returned by late iterations. It IS save to insert or delete children of the nodes pointed by the iterator (but this could invalidate other iterators on the same tree). If you really really need to do things like that, you should use your own node pointers and iteration mechanisms :-(


Constructor & Destructor Documentation

template<class T>
lti::tree< T >::const_iterator::const_iterator ( const node theNode,
const nodeManager owner 
) [inline, explicit, protected]

Create an iterator initialized with the given pointer to a node.

template<class T>
lti::tree< T >::const_iterator::const_iterator (  )  [inline]

Default constructor.

template<class T>
lti::tree< T >::const_iterator::const_iterator ( const const_iterator other  )  [inline]

Copy constructor.

template<class T>
lti::tree< T >::const_iterator::const_iterator ( const iterator other  )  [inline]

Copy constructor.


Member Function Documentation

template<class T>
bool lti::tree< T >::const_iterator::operator!= ( const iterator other  )  const [inline]
template<class T>
bool lti::tree< T >::const_iterator::operator!= ( const const_iterator other  )  const [inline]

Compare this iterator with the other one.

References lti::tree< T >::const_iterator::pointedNode.

template<class T>
const node& lti::tree< T >::const_iterator::operator* (  )  const [inline]

Get pointed data.

References lti::tree< T >::const_iterator::pointedNode.

template<class T>
const_iterator lti::tree< T >::const_iterator::operator++ ( int   )  [inline]
template<class T>
const_iterator& lti::tree< T >::const_iterator::operator++ (  )  [inline]
template<class T>
const_iterator& lti::tree< T >::const_iterator::operator= ( const iterator other  )  [inline]
template<class T>
const_iterator& lti::tree< T >::const_iterator::operator= ( const const_iterator other  )  [inline]
template<class T>
bool lti::tree< T >::const_iterator::operator== ( const iterator other  )  const [inline]
template<class T>
bool lti::tree< T >::const_iterator::operator== ( const const_iterator other  )  const [inline]

Compare this iterator with the other one.

References lti::tree< T >::const_iterator::pointedNode.


Member Data Documentation

template<class T>
const node* lti::tree< T >::const_iterator::pointedNode [protected]
template<class T>
std::list<int> lti::tree< T >::const_iterator::stack [protected]

Stack with all still-to-be-iterated children.

Referenced by lti::tree< T >::const_iterator::operator++(), and lti::tree< T >::const_iterator::operator=().

template<class T>
const nodeManager* lti::tree< T >::const_iterator::theOwner [protected]

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

Generated on Sat Apr 10 15:28:47 2010 for LTI-Lib by Doxygen 1.6.1