Feel++ 0.111.0-preview.14
Finite Element Embedded Library in C++
Feel::Visitor< T, R > Class Template Referenceabstract

This class is the base class to implement the Visitor Pattern. More...

+ Collaboration diagram for Feel::Visitor< T, R >:

Typedefs

typedef R return_type
 

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); }
};
Definition: test_factory.cpp:35
Definition: test_factory.cpp:45
virtual return_type visit(T *)=0
visit a data structure
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