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

OutputVisitor Class Template Reference
[NodeVisitor]

OutputVisitor is used for output of the tree. It uses an configurable OutputStrategy (see OutputStrategy), 'DefaultOutputStrategy' if none is given. More...

#include <nodevisitor.h>

Inheritance diagram for OutputVisitor:

Inheritance graph
[legend]
Collaboration diagram for OutputVisitor:

Collaboration graph
[legend]
List of all members.

Public Types

typedef OutputVisitor< _TContent,
_TIter > 
_Self
typedef NodeVisitor< typename
_TIter::const_iterator, const
Node< _TContent >, const NormalNode<
_TContent >, const RootNode<
_TContent > > 
_Base
typedef OutputStrategy< _TContent > strategy_type

Public Methods

 OutputVisitor (strategy_type *os=0)
 Constructor If no outputstrategy is given the visitor uses NullOutputStrategy that writes to stdout.

virtual ~OutputVisitor ()
virtual _Selfconstruct () const
virtual _Selfclone () const
virtual void operator() (const Node< _TContent > *node)
virtual void operator() (_TIter &iter)
 Start the output process.

virtual void visitNormalNode (const NormalNode< _TContent > *node)
 Take a NormalNode and output its content.

virtual void visitRootNode (const RootNode< _TContent > *node)
 Take a RootNode and output its content.

void setOutputStrategy (strategy_type *os)
 Set the OutputStrategy for the node content output.

void setNullOutputStrategy ()
 Reset the OutputStrategy to a NullOutputStrategy.

virtual strategy_typeoutputStrategy ()

Protected Methods

 OutputVisitor (const OutputVisitor &ov)

Protected Attributes

strategy_typem_outputStrategy
NullOutputStrategy< _TContent > m_nulloutputstrategy

Detailed Description

template<class _TContent, class _TIter>
class treecomp::OutputVisitor< _TContent, _TIter >

OutputVisitor is used for output of the tree. It uses an configurable OutputStrategy (see OutputStrategy), 'DefaultOutputStrategy' if none is given.

Definition at line 158 of file nodevisitor.h.


Member Typedef Documentation

typedef NodeVisitor<typename _TIter::const_iterator, const Node<_TContent>,const NormalNode<_TContent>,const RootNode<_TContent> > _Base
 

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

Definition at line 166 of file nodevisitor.h.

Referenced by OutputVisitor::OutputVisitor().

typedef OutputVisitor<_TContent,_TIter> _Self
 

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

Definition at line 163 of file nodevisitor.h.

Referenced by OutputVisitor::clone().

typedef OutputStrategy<_TContent> strategy_type
 

Definition at line 167 of file nodevisitor.h.


Constructor & Destructor Documentation

OutputVisitor strategy_type   os = 0 [explicit]
 

Constructor If no outputstrategy is given the visitor uses NullOutputStrategy that writes to stdout.

Parameters:
os  The OutputStrategy to use

Definition at line 366 of file nodevisitor.h.

References OutputVisitor::m_nulloutputstrategy, and OutputVisitor::m_outputStrategy.

virtual ~OutputVisitor   [inline, virtual]
 

Definition at line 172 of file nodevisitor.h.

OutputVisitor const OutputVisitor< _TContent, _TIter > &    ov [inline, explicit, protected]
 

Definition at line 188 of file nodevisitor.h.

References OutputVisitor::_Base, and OutputVisitor::m_outputStrategy.


Member Function Documentation

virtual _Self* clone   const [inline, virtual]
 

Definition at line 175 of file nodevisitor.h.

References OutputVisitor::_Self.

virtual _Self* construct   const [inline, virtual]
 

Definition at line 174 of file nodevisitor.h.

void operator() _TIter &    iter [virtual]
 

Start the output process.

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

Definition at line 383 of file nodevisitor.h.

References NodeVisitor< _TIter::const_iterator, const Node< _TContent >, const NormalNode< _TContent >, const RootNode< _TContent > >::init(), NodeVisitor< _TIter::const_iterator, const Node< _TContent >, const NormalNode< _TContent >, const RootNode< _TContent > >::iterate(), and OutputVisitor::m_outputStrategy.

virtual void operator() const Node< _TContent > *    node [inline, virtual]
 

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

Definition at line 177 of file nodevisitor.h.

virtual strategy_type* outputStrategy   [inline, virtual]
 

Definition at line 185 of file nodevisitor.h.

References OutputVisitor::m_outputStrategy.

void setNullOutputStrategy  
 

Reset the OutputStrategy to a NullOutputStrategy.

Definition at line 433 of file nodevisitor.h.

References OutputVisitor::m_outputStrategy, and OutputVisitor::setOutputStrategy().

void setOutputStrategy strategy_type   os
 

Set the OutputStrategy for the node content output.

Parameters:
os  The OutputStrategy to use

Definition at line 420 of file nodevisitor.h.

References OutputVisitor::m_nulloutputstrategy, and OutputVisitor::m_outputStrategy.

Referenced by OutputVisitor::setNullOutputStrategy().

void visitNormalNode const NormalNode< _TContent > *    node [virtual]
 

Take a NormalNode and output its content.

Parameters:
node  The NormalNode to visit

Implements NodeVisitor< _TIter::const_iterator, const Node< _TContent >, const NormalNode< _TContent >, const RootNode< _TContent > >.

Definition at line 398 of file nodevisitor.h.

References OutputVisitor::m_outputStrategy.

void visitRootNode const RootNode< _TContent > *    node [virtual]
 

Take a RootNode and output its content.

Parameters:
node  The RootNode to visit

Implements NodeVisitor< _TIter::const_iterator, const Node< _TContent >, const NormalNode< _TContent >, const RootNode< _TContent > >.

Definition at line 409 of file nodevisitor.h.

References OutputVisitor::m_outputStrategy.


Member Data Documentation

NullOutputStrategy<_TContent> m_nulloutputstrategy [protected]
 

Definition at line 192 of file nodevisitor.h.

Referenced by OutputVisitor::OutputVisitor(), and OutputVisitor::setOutputStrategy().

strategy_type* m_outputStrategy [protected]
 

Definition at line 191 of file nodevisitor.h.

Referenced by OutputVisitor::operator()(), OutputVisitor::outputStrategy(), OutputVisitor::OutputVisitor(), OutputVisitor::setNullOutputStrategy(), OutputVisitor::setOutputStrategy(), OutputVisitor::visitNormalNode(), and OutputVisitor::visitRootNode().


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