Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
A library implementation of the Visitor Pattern tailored specifically to Lumiera's needs within the Steam Layer.
Visitor enables double dispatch calls, based both on the concrete type of some target object and the concrete type of a tool object being applied to this target. The code carrying out this tool application (and thus triggering the double dispatch) need not know any of these concrete types and is thus completely decoupled form implementation details encapsulated within the visiting tool. The visiting tool implementation class provides specific "treat(ConcreteVisitable&)" functions, and this visitor lib will dispatch the call to the* correct "treat"-function based on the concrete target visitable type.
Implementation notes
DECLARE_PROCESSABLE_BY(TOOLBASE)
macro. By this, it gets an virtual apply(TOOLBASE&)
function. Otherwise, it will be treated by the interface of the next base class using this macro.Definition in file visitor.hpp.
#include "lib/visitor-policies.hpp"
#include "lib/visitor-dispatcher.hpp"
#include "lib/meta/typelist.hpp"
Classes | |
class | Applicable< TOOLImpl, TYPES, BASE > |
Marker template to declare that some "visiting tool" wants to treat a set of concrete Visitable classes. More... | |
class | Applicable< TOOLImpl, typelist::Node< TAR, TYPES >, BASE > |
class | Applicable< TOOLImpl, typelist::NullType, BASE > |
class | Tool< RET, ERR > |
Marker interface / base class for all "visiting tools". More... | |
class | Visitable< TOOL > |
Marker interface or base class for all "Visitables". More... | |
Macros | |
#define | DEFINE_PROCESSABLE_BY(TOOL) |
mark a Visitable subclass as actually treat-able by some "visiting tool" base interface. More... | |
Namespaces | |
lib | |
Implementation namespace for support and library code. | |
#define DEFINE_PROCESSABLE_BY | ( | TOOL | ) |
mark a Visitable subclass as actually treat-able by some "visiting tool" base interface.
Defines the apply-function, which is the actual access point to invoke the visiting
Definition at line 231 of file visitor.hpp.