Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Compound Members  

CollectVisitor Class Template Reference
[NodeVisitor]

This visitor collects all nodes into a vector which is provided through 'getList()'. More...

#include <nodevisitor.h>

Inheritance diagram for CollectVisitor:

Inheritance graph
[legend]
Collaboration diagram for CollectVisitor:

Collaboration graph
[legend]
List of all members.

Public Types

typedef CollectVisitor< _TContent,
_TIter, _TContainer > 
_Self
typedef NodeVisitor< _TIter,
Node< _TContent >, NormalNode<
_TContent >, RootNode< _TContent > > 
_Base

Public Methods

 CollectVisitor ()
virtual _Selfconstruct () const
virtual _Selfclone () const
virtual void operator() (_TIter &iter)
 Start the collection process.

virtual void visitNormalNode (NormalNode< _TContent > *node)
 Take a NormalNode and put it in the list.

virtual void visitRootNode (RootNode< _TContent > *node)
 Take a RootNode and put its subtree in the list.

virtual _TContainer getCollected ()

Protected Methods

 CollectVisitor (const CollectVisitor &cv)
void addNode (Node< _TContent > *node)
 Take a Node and put it in the list.


Protected Attributes

_TContainer m_container

Detailed Description

template<class _TContent, class _TIter, class _TContainer = std::vector<Node<_TContent>*>>
class treecomp::CollectVisitor< _TContent, _TIter, _TContainer >

This visitor collects all nodes into a vector which is provided through 'getList()'.

Definition at line 210 of file nodevisitor.h.


Member Typedef Documentation

typedef NodeVisitor<_TIter,Node<_TContent>, NormalNode<_TContent>, RootNode<_TContent> > _Base
 

Reimplemented from NodeVisitor< _TIter, Node< _TContent >, NormalNode< _TContent >, RootNode< _TContent > >.

Definition at line 216 of file nodevisitor.h.

typedef CollectVisitor<_TContent,_TIter,_TContainer> _Self
 

Reimplemented from NodeVisitor< _TIter, Node< _TContent >, NormalNode< _TContent >, RootNode< _TContent > >.

Definition at line 214 of file nodevisitor.h.

Referenced by CollectVisitor::clone(), and CollectVisitor::construct().


Constructor & Destructor Documentation

CollectVisitor   [inline, explicit]
 

Definition at line 219 of file nodevisitor.h.

CollectVisitor const CollectVisitor< _TContent, _TIter, _TContainer > &    cv [inline, explicit, protected]
 

Definition at line 230 of file nodevisitor.h.


Member Function Documentation

void addNode Node< _TContent > *    node [protected]
 

Take a Node and put it in the list.

Parameters:
node  The Node to add

Definition at line 482 of file nodevisitor.h.

References CollectVisitor::m_container.

Referenced by CollectVisitor::visitNormalNode(), and CollectVisitor::visitRootNode().

virtual _Self* clone   const [inline, virtual]
 

Definition at line 221 of file nodevisitor.h.

References CollectVisitor::_Self.

virtual _Self* construct   const [inline, virtual]
 

Definition at line 220 of file nodevisitor.h.

References CollectVisitor::_Self.

virtual _TContainer getCollected   [inline, virtual]
 

Definition at line 227 of file nodevisitor.h.

References CollectVisitor::m_container.

void operator() _TIter &    iter [virtual]
 

Start the collection process.

Parameters:
iter  The NodeIterator that iterates over all nodes to visit

Implements NodeVisitor< _TIter, Node< _TContent >, NormalNode< _TContent >, RootNode< _TContent > >.

Definition at line 450 of file nodevisitor.h.

References NodeVisitor< _TIter, Node< _TContent >, NormalNode< _TContent >, RootNode< _TContent > >::init(), NodeVisitor< _TIter, Node< _TContent >, NormalNode< _TContent >, RootNode< _TContent > >::iterate(), and CollectVisitor::m_container.

void visitNormalNode NormalNode< _TContent > *    node [virtual]
 

Take a NormalNode and put it in the list.

Parameters:
node  The NormalNode to visit

Implements NodeVisitor< _TIter, Node< _TContent >, NormalNode< _TContent >, RootNode< _TContent > >.

Definition at line 462 of file nodevisitor.h.

References CollectVisitor::addNode().

void visitRootNode RootNode< _TContent > *    node [virtual]
 

Take a RootNode and put its subtree in the list.

Parameters:
node  The RootNode to visit

Implements NodeVisitor< _TIter, Node< _TContent >, NormalNode< _TContent >, RootNode< _TContent > >.

Definition at line 472 of file nodevisitor.h.

References CollectVisitor::addNode().


Member Data Documentation

_TContainer m_container [protected]
 

Definition at line 233 of file nodevisitor.h.

Referenced by CollectVisitor::addNode(), CollectVisitor::getCollected(), and CollectVisitor::operator()().


The documentation for this class was generated from the following file:
Generated on Mon Jan 6 12:02:18 2003 for TreeComp by doxygen1.2.17