latest version v1.9 - last update 10 Apr 2010 |
Const iterator type (allows read-only operations). More...
#include <ltiTree.h>
Public Member Functions | |
const_iterator () | |
const_iterator (const const_iterator &other) | |
const_iterator (const iterator &other) | |
const_iterator & | operator++ () |
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 node & | operator* () const |
const_iterator & | operator= (const const_iterator &other) |
const_iterator & | operator= (const iterator &other) |
Protected Member Functions | |
const_iterator (const node &theNode, const nodeManager &owner) | |
Protected Attributes | |
std::list< int > | stack |
const node * | pointedNode |
const nodeManager * | theOwner |
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 :-(
lti::tree< T >::const_iterator::const_iterator | ( | const node & | theNode, | |
const nodeManager & | owner | |||
) | [inline, explicit, protected] |
lti::tree< T >::const_iterator::const_iterator | ( | ) | [inline] |
Default constructor.
lti::tree< T >::const_iterator::const_iterator | ( | const const_iterator & | other | ) | [inline] |
Copy constructor.
lti::tree< T >::const_iterator::const_iterator | ( | const iterator & | other | ) | [inline] |
Copy constructor.
bool lti::tree< T >::const_iterator::operator!= | ( | const iterator & | other | ) | const [inline] |
Compare this iterator with the other one.
References lti::tree< T >::iterator::pointedNode, and lti::tree< T >::const_iterator::pointedNode.
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.
Get pointed data.
References lti::tree< T >::const_iterator::pointedNode.
const_iterator lti::tree< T >::const_iterator::operator++ | ( | int | ) | [inline] |
Advance to next item (this postfix version is slower than the prefix one.
References lti::tree< T >::node::child(), lti::tree< T >::node::degree(), lti::tree< T >::nodeManager::getIndexOfNode(), lti::tree< T >::nodeManager::getNode(), lti::tree< T >::node::isChildValid(), lti::tree< T >::const_iterator::pointedNode, lti::tree< T >::size(), lti::tree< T >::const_iterator::stack, and lti::tree< T >::const_iterator::theOwner.
const_iterator& lti::tree< T >::const_iterator::operator++ | ( | ) | [inline] |
Advance to next item (prefix increment operator).
References lti::tree< T >::node::child(), lti::tree< T >::node::degree(), lti::tree< T >::nodeManager::getIndexOfNode(), lti::tree< T >::nodeManager::getNode(), lti::tree< T >::node::isChildValid(), lti::tree< T >::const_iterator::pointedNode, lti::tree< T >::size(), lti::tree< T >::const_iterator::stack, and lti::tree< T >::const_iterator::theOwner.
const_iterator& lti::tree< T >::const_iterator::operator= | ( | const iterator & | other | ) | [inline] |
const_iterator& lti::tree< T >::const_iterator::operator= | ( | const const_iterator & | other | ) | [inline] |
Copy member.
References lti::tree< T >::const_iterator::pointedNode, lti::tree< T >::const_iterator::stack, and lti::tree< T >::const_iterator::theOwner.
bool lti::tree< T >::const_iterator::operator== | ( | const iterator & | other | ) | const [inline] |
Compare this iterator with the other one.
References lti::tree< T >::iterator::pointedNode, and lti::tree< T >::const_iterator::pointedNode.
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.
const node* lti::tree< T >::const_iterator::pointedNode [protected] |
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=().
const nodeManager* lti::tree< T >::const_iterator::theOwner [protected] |
The owner tree.
Referenced by lti::tree< T >::const_iterator::operator++(), and lti::tree< T >::const_iterator::operator=().