Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

FindVisitor< N, V > Class Template Reference

A visitor class for searching a node graph. More...

#include <Composite.h>

List of all members.

Public Methods

virtual bool match (N &node)=0
 The search condition.

void apply (N &node)
 Search for a matching node.

simdata::Ref< N > getNode () const
 Get the node that match the search condition, if any.


Detailed Description

template<class N, class V>
class FindVisitor< N, V >

A visitor class for searching a node graph.

The visitor traverses the graph until the match() method returns true. Implement this method in a derived class to specify the search condition. Traversal stops as soon as a match is found. After traversal the getNode() method can be used to retrieve the matching node (if any).


Member Function Documentation

template<class N, class V>
void FindVisitor< N, V >::apply N &    node [inline]
 

Search for a matching node.

Don't call this directly; use node->accept(visitor);

template<class N, class V>
simdata::Ref<N> FindVisitor< N, V >::getNode   const [inline]
 

Get the node that match the search condition, if any.

template<class N, class V>
virtual bool FindVisitor< N, V >::match N &    node [pure virtual]
 

The search condition.

Implement this condition in derived classes to deterimine which node is found.


The documentation for this class was generated from the following file:
SimData version pre-0.4.0. For more information on SimData, visit the SimData Homepage.

Generated on Tue Oct 14 12:06:41 2003, using Doxygen 1.2.18.

[SF.net]