22#ifndef LUMIERA_VISITOR_DISPATCHER_H
23#define LUMIERA_VISITOR_DISPATCHER_H
41 template<
class TOOL>
class Tag;
44 template<
class TOOL,
class TOOLImpl>
71 operator size_t()
const {
return tagID; }
74 template<
class TOOLImpl>
76 get (TOOLImpl*
const =0)
88 template<
class TOOL,
class TOOLImpl>
108 template<
class TAR,
class TOOL>
118 template<
class TOOLImpl>
124 TOOLImpl& toolObj =
static_cast<TOOLImpl&
> (tool);
129 return toolObj.treat (obj);
143 if (index >
table_.size())
175 return tool.onUnknown (target);
190 template<
class TOOLImpl>
206 template<
class TAR,
class TOOL>
A synchronisation protection guard employing a lock scoped to the parameter type as a whole,...
Access point to singletons and other kinds of dependencies designated by type.
For each possible call entry point via some subclass of the visitable hierarchy, we maintain a dispat...
ReturnType forwardCall(TAR &target, TOOL &tool)
std::vector< Trampoline > table_
VTable for storing the Trampoline pointers.
void enrol(TOOLImpl *typeref)
static Depend< Dispatcher< TAR, TOOL > > instance
storage for the dispatcher table(s)
void accomodate(size_t index)
TOOL::ReturnType ReturnType
void storePtr(size_t id, Trampoline func)
static ReturnType errorHandler(TAR &target, TOOL &tool)
ReturnType(* Trampoline)(TAR &, TOOL &)
static ReturnType callTrampoline(TAR &obj, TOOL &tool)
generator for Trampoline functions, used to dispatch calls down to the right "treat"-Function on the ...
Trampoline storedTrampoline(size_t id)
Type tag for concrete visiting tool classes.
static void generateID(size_t &id)
static Tag & get(TOOLImpl *const =0)
static size_t lastRegisteredID
Singleton services and Dependency Injection.
Lumiera error handling (C++ interface).
Implementation namespace for support and library code.
static Tag< TOOL > tag
storage for the Tag registry for each concrete tool
A special implementation of lib::Sync, where the storage of the object monitor is associated directly...
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
#define INSTANCEOF(CLASS, EXPR)
shortcut for subclass test, intended for assertions only.