35 #ifndef StiCompositeLeafIterator_HH
36 #define StiCompositeLeafIterator_HH
41 #include "StiCompositeTreeNode.h"
42 #include "StlUtilities.h"
71 bool operator!=(
const typename tnode_vec::const_iterator& rhs) {
87 typename tnode_vec::iterator
end() {
return mleaves.end(); }
149 mcurrentleaf=mleaves.begin();
168 return (*mcurrentleaf);
199 return mleaves.size();
273 myLeafFinder(mcurrentnode);
void findLeaves()
Internal function used to find leaves. It is called in the constructor.
void operator++()
Define only prefix of ++ (only a forward iterator)
void reset()
Reset iterator to point to first leaf.
bool operator!=(const typename tnode_vec::const_iterator &rhs)
Define !=.
tnode_t * mcurrentnode
We store a pointer to the root of the tree for internal convenience.
unsigned int getLeafCount() const
vector< tnode_t * > tnode_vec
For internal convenience.
tnode_vec::iterator begin()
Return an iterator marking the beginning of the leaf vector.
tnode_vec::const_iterator const_end() const
Return a const_iterator marking the end of the leaf vector.
tnode_vec::iterator end()
Return an iterator marking the end of the leaf vector.
StiCompositeTreeNode< T > tnode_t
For internal convenience.
StiCompositeLeafIterator()
tnode_t * operator*() const
Dereference iterator, just as an STL iterator.
virtual ~StiCompositeLeafIterator()
Defualt destructor.
tnode_vec mleaves
The vector of leaves.
tnode_vec::const_iterator mcurrentleaf
We have to store an interator into the leaf vector for traversal.
tnode_vec::const_iterator const_begin() const
Return a const_iterator marking the beginning of the leaf vector.