#ifndef VISITOR_H
#define VISITOR_H

#include <cassert>

class ElementA;
class ElementB;

/*!
\brief 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. 
*/
class Visitor
{
public:

   /** This functional operates on data ElementA. */
   virtual void visit(ElementA& a) const {};
   /** This functional operates on data ElementB. */
   virtual void visit(ElementB& b) const {};

   virtual ~Visitor() {}
};


#endif



