![]() |
Lumiera 0.pre.04
»edit your freedom«
|
#include "lib/verb-visitor.hpp"
A self-contained token to embody a specific yet abstracted operation, together with a concrete set of suitable arguments.
The concrete operation is suppled on invocation, when the VerbPack is combined with an actual receiver object, implementing the interface REC and thus providing the function implementation. VerbPack represents a kind of double-dispatch, flexible both on the actual operation (embodied into the given VerbPack object) and also flexible in the concrete receiver.
| REC | the "visitor interface" to invoke operations on |
| RET | expected (common) return value of the bound operations (can be void) |
| arg_storage | maximum storage size to reserve as buffer for actual function parameters. |
arg_storage triggers a static assertionDefinition at line 187 of file verb-visitor.hpp.
Classes | |
| struct | HandlerTypeDetector |
| struct | HandlerTypeDetector< RET(REC::*)(ARGS...)> |
Public Member Functions | |
| template<typename FUN , typename... ARGS> | |
| VerbPack (FUN handler, Literal verbID, ARGS &&... args) | |
setup a VerbPack for a given operation on the interface REC | |
| RET | applyTo (REC &receiver) |
| Core operation: invoke the operation for this "verb" with the pre-bound parameters. | |
| operator string () const | |
| template<typename ARG > | |
| ARG & | accessArg () |
| unsafe downcast and access to an embedded payload argument value | |
Public Member Functions inherited from PolymorphicValue< VerbInvoker< REC, RET >, storageOverhead(arg_storage)> | |
| PolymorphicValue (PolymorphicValue const &o) | |
| Interface & | getPayload () |
| operator Interface & () | |
| operator Interface const & () const | |
| Interface * | operator-> () const |
| ~PolymorphicValue () | |
| PolymorphicValue & | operator= (PolymorphicValue const &o) |
Private Types | |
| using | Dispatcher = VerbInvoker< REC, RET > |
| using | PolyHolder = PolymorphicValue< Dispatcher, storageOverhead(arg_storage)> |
| template<typename FUN > | |
| using | PayloadType = HandlerTypeDetector< FUN >::Payload * |
Additional Inherited Members | |
Public Types inherited from PolymorphicValue< VerbInvoker< REC, RET >, storageOverhead(arg_storage)> | |
| using | Interface = VerbInvoker< REC, RET > |
Static Public Member Functions inherited from PolymorphicValue< VerbInvoker< REC, RET >, storageOverhead(arg_storage)> | |
| static PolymorphicValue | build (ARGS &&... args) |
Protected Member Functions inherited from PolymorphicValue< VerbInvoker< REC, RET >, storageOverhead(arg_storage)> | |
| PolymorphicValue (IMP *, ARGS &&... args) | |
|
inline |
setup a VerbPack for a given operation on the interface REC
| handler | function member-pointer to define the operation |
| verbID | unique ID to designate the token; equality is based on this verbID, all tokens with same ID count as equal |
| args | arbitrary (yet suitable) arguments to pre-bind and use later when actually invoking the operation on a concrete receiver |
Definition at line 218 of file verb-visitor.hpp.
| struct lib::VerbPack::HandlerTypeDetector |
Collaboration diagram for VerbPack< REC, RET, arg_storage >::HandlerTypeDetector< FUN >:| struct lib::VerbPack::HandlerTypeDetector< RET(REC::*)(ARGS...)> |
| Class Members | ||
|---|---|---|
| typedef VerbToken< REC, RET(ARGS...)> | Verb | |
| typedef VerbHolder< REC, RET(ARGS...)> | Payload | |
Collaboration diagram for VerbPack< REC, RET, arg_storage >::HandlerTypeDetector< RET(REC::*)(ARGS...)>:
|
private |
Definition at line 190 of file verb-visitor.hpp.
|
private |
Definition at line 191 of file verb-visitor.hpp.
|
private |
Definition at line 206 of file verb-visitor.hpp.
|
inline |
Core operation: invoke the operation for this "verb" with the pre-bound parameters.
| receiver | a subclass of REC, providing the function to invoke |
Definition at line 228 of file verb-visitor.hpp.
|
inline |
Definition at line 233 of file verb-visitor.hpp.
References util::unConst().
Here is the call graph for this function:
|
inline |
unsafe downcast and access to an embedded payload argument value
Definition at line 243 of file verb-visitor.hpp.
References PolymorphicValue< VerbInvoker< REC, RET >, storageOverhead(arg_storage)>::getPayload(), and INSTANCEOF.
Here is the call graph for this function:
Inheritance diagram for VerbPack< REC, RET, arg_storage >:
Collaboration diagram for VerbPack< REC, RET, arg_storage >: