Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
Dispatcher< TAR, TOOL > Class Template Reference

Description

template<class TAR, class TOOL>
class lumiera::visitor_concept_draft::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.

Definition at line 153 of file visitingtool-concept.cpp.

Static Public Attributes

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

Public Member Functions

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

Private Types

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

Private Member Functions

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

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 &, TOOL &)
 

Private Attributes

std::vector< Trampolinetable_
 custom VTable for storing the Trampoline pointers
 

Member Typedef Documentation

◆ ReturnType

template<class TAR , class TOOL >
using ReturnType = TOOL::ReturnType
private

Definition at line 155 of file visitingtool-concept.cpp.

◆ Trampoline

template<class TAR , class TOOL >
typedef ReturnType(* Trampoline) (TAR &, TOOL &)
private

Definition at line 176 of file visitingtool-concept.cpp.

Member Function Documentation

◆ callTrampoline()

template<class TAR , class TOOL >
template<class TOOLImpl >
static ReturnType callTrampoline ( TAR &  obj,
TOOL &  tool 
)
inlinestaticprivate

generator for Trampoline functions, used to dispatch calls down to the right "treat"-Function on the correct concrete tool implementation class

Definition at line 164 of file visitingtool-concept.cpp.

References INSTANCEOF.

◆ is_known()

template<class TAR , class TOOL >
bool is_known ( size_t  id)
inlineprivate

Definition at line 184 of file visitingtool-concept.cpp.

References Dispatcher< TAR, TOOL >::table_.

Referenced by Dispatcher< TAR, TOOL >::enrol().

+ Here is the caller graph for this function:

◆ storePtr()

template<class TAR , class TOOL >
void storePtr ( size_t  id,
Trampoline  func 
)
inlineprivate

Definition at line 190 of file visitingtool-concept.cpp.

References Dispatcher< TAR, TOOL >::table_.

Referenced by Dispatcher< TAR, TOOL >::enrol().

+ Here is the caller graph for this function:

◆ storedTrampoline()

template<class TAR , class TOOL >
Trampoline storedTrampoline ( size_t  id)
inlineprivate

Definition at line 199 of file visitingtool-concept.cpp.

References Dispatcher< TAR, TOOL >::errorHandler(), and Dispatcher< TAR, TOOL >::table_.

Referenced by Dispatcher< TAR, TOOL >::forwardCall().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ errorHandler()

template<class TAR , class TOOL >
static ReturnType errorHandler ( TAR &  ,
TOOL &   
)
inlinestaticprivate

Definition at line 208 of file visitingtool-concept.cpp.

Referenced by Dispatcher< TAR, TOOL >::storedTrampoline().

+ Here is the caller graph for this function:

◆ forwardCall()

template<class TAR , class TOOL >
ReturnType forwardCall ( TAR &  target,
TOOL &  tool 
)
inline

Definition at line 218 of file visitingtool-concept.cpp.

References Dispatcher< TAR, TOOL >::storedTrampoline().

+ Here is the call graph for this function:

◆ enrol()

template<class TAR , class TOOL >
template<class TOOLImpl >
void enrol ( TOOLImpl *  typeKey)
inline

Definition at line 227 of file visitingtool-concept.cpp.

References Tag< TOOL >::get(), Dispatcher< TAR, TOOL >::is_known(), and Dispatcher< TAR, TOOL >::storePtr().

+ Here is the call graph for this function:

Member Data Documentation

◆ table_

template<class TAR , class TOOL >
std::vector<Trampoline> table_
private

custom VTable for storing the Trampoline pointers

Definition at line 180 of file visitingtool-concept.cpp.

Referenced by Dispatcher< TAR, TOOL >::is_known(), Dispatcher< TAR, TOOL >::storedTrampoline(), and Dispatcher< TAR, TOOL >::storePtr().

◆ instance

template<class TAR , class TOOL >
lib::Depend< Dispatcher< TAR, TOOL > > instance
static

storage for the dispatcher table(s)

Definition at line 215 of file visitingtool-concept.cpp.

Referenced by Applicable< TAR, TOOLImpl, BASE >::Applicable(), and Visitable< TOOL >::dispatchOp().

+ Collaboration diagram for Dispatcher< TAR, TOOL >:

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