Lumiera  0.pre.03
»edit your freedom«
Dispatcher< TAR, TOOL > Class Template Reference

#include "lib/visitor-dispatcher.hpp"

Description

template<class TAR, class TOOL>
class lib::visitor::Dispatcher< TAR, TOOL >

For each possible call entry point via some subclass of the visitable hierarchy, we maintain a dispatcher table to keep track of all concrete tool implementations able to receive and process calls on objects of this subclass.

Parameters
TARthe concrete target (subclass) type within the visitable hierarchy
TOOLthe overall tool family (base class of all concrete tools)

Definition at line 118 of file visitor-dispatcher.hpp.

Public Member Functions

template<class TOOLImpl >
void enrol (TOOLImpl *typeref)
 
ReturnType forwardCall (TAR &target, TOOL &tool)
 

Static Public Attributes

static Depend< Dispatcher< TAR, TOOL > > instance
 storage for the dispatcher table(s)
 

Private Types

typedef TOOL::ReturnType ReturnType
 
typedef ReturnType(* Trampoline) (TAR &, TOOL &)
 

Private Member Functions

void accomodate (size_t index)
 
bool is_known (size_t id)
 
Trampoline storedTrampoline (size_t id)
 
void storePtr (size_t id, Trampoline func)
 

Static Private Member Functions

template<class TOOLImpl >
static ReturnType callTrampoline (TAR &obj, TOOL &tool)
 generator for Trampoline functions, used to dispatch calls down to the right "treat"-Function on the correct concrete tool implementation class
 
static ReturnType errorHandler (TAR &target, TOOL &tool)
 

Private Attributes

std::vector< Trampoline > table_
 VTable for storing the Trampoline pointers.
 
+ Collaboration diagram for Dispatcher< TAR, TOOL >:

The documentation for this class was generated from the following file: