Tanl Linguistic Pipeline

IXE::IVisitor Struct Reference

Define Visitable classes as:. More...

#include <Visitor.h>

List of all members.


Detailed Description

Define Visitable classes as:.

 class Element : public Visitable<>
 {
  public:
   VISITABLE_ACCEPT()
 };
 
 class SubElement : public Element
 {
  public:
   VISITABLE_ACCEPT()
 };
 

Define a Visitor as:

 class SomeVisitor : public IVisitor,
                 public Visitor<Element>,
                 public Visitor<SubElement>
 {
  public:
   void accept(Element&) { ... }
   void accept(SubElement&) { ... }
 };
 

Optionally the visitor accept method may want to return values:

 class Element : public Visitable<Element*>
 

and the visitor defines:

 Element* SomeVisitor::accept(Element&) { ... }
 

Inspired by

See also:
http://loki-lib.sourceforge.net/index.php?n=Pattern.Visitor. visitor interface.

The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
 
Copyright © 2005-2011 G. Attardi. Generated on 4 Mar 2011 by doxygen 1.6.1.