Feel++  0.91.4
List of all members
Feel::Visitor< T, R > Class Template Referenceabstract

#include <visitor.hpp>

Public Types

Typedefs
typedef R return_type
 

Public Member Functions

Constructors, Destructors and methods
virtual ~Visitor ()
 virtual base destructor
 
virtual return_type visit (T *)=0
 visit a data structure
 
return_type visit (T &__t)
 visit a data structure
 

Detailed Description

template<class T, typename R = void>
class Feel::Visitor< T, R >

This class is the base class to implement the Visitor Pattern. Let's A be a visitor class to a class B:

class A: public Visitor<B>
{
public:
...
void visit(B * b)
{
..implement the functionnality to be added to a B class..
}
};
class B:
{
public:
void accept(Visitor<B>* b){ b->visit(this); }
};
Author
Christophe Prud'homme Chris.nosp@m.toph.nosp@m.e.Pru.nosp@m.dhom.nosp@m.me@an.nosp@m.n.ju.nosp@m.ssieu.nosp@m..fr
See Also
Gamma, Helm, Johnson, Vlissides, Design Patterns Pub: Addison Wesley