proj home

Files   Classes   Functions   Hierarchy  

Visitor Class Reference

Base of function tree in Vistor pattern. More...

#include <visitor.h>

Inheritance diagram for Visitor:

List of all members.

Public Member Functions

virtual void visit (ElementA &a) const
 This functional operates on data ElementA.
virtual void visit (ElementB &b) const
 This functional operates on data ElementB.
virtual ~Visitor ()


Detailed Description

Base of function tree in Vistor pattern.

Through inheritance, derive functions from Visitor. For this pattern variations, these function forward work to templated functions in the data tree. Therefore there is not a separation between function and data as usually characterised in the visitor pattern.

ie implementing a new function adds a functional Visitor to the function tree, and each data member needs to implement a templated function for the new functional visitor function.

Definition at line 20 of file visitor.h.


Constructor & Destructor Documentation

virtual Visitor::~Visitor (  )  [inline, virtual]

Definition at line 29 of file visitor.h.

00029 {}


Member Function Documentation

virtual void Visitor::visit ( ElementB b  )  const [inline, virtual]

This functional operates on data ElementB.

Reimplemented in visitorPrint< T >, and visitorPrint2< T >.

Definition at line 27 of file visitor.h.

00027 {};

virtual void Visitor::visit ( ElementA a  )  const [inline, virtual]

This functional operates on data ElementA.

Reimplemented in visitorPrint< T >, and visitorPrint2< T >.

Definition at line 25 of file visitor.h.

Referenced by ElementB::accept(), and ElementA::accept().

00025 {};


The documentation for this class was generated from the following file:

Generated on Fri Mar 4 00:50:24 2011 for Chelton Evans Source by  doxygen 1.5.8