|
ITCH 5.0 Market Data Handler 1.0.0
NASDAQ ITCH 5.0 Market Data Feed Handler
|
Invoker utility for dispatching calls to handler objects. More...
Invoker utility for dispatching calls to handler objects.
Provides static methods for:
The invoker bridges the gap between type-erased function pointers and the strongly-typed handler object.
#include <core/src/impl/Delegate.h>
Static Public Member Functions | |
| template<typename Handler, typename R, typename... Args> | |
| static R | invoke (void *mem, Args... args) |
| Invoke a handler method with provided arguments. | |
| template<typename Handler, typename Callback, typename VoidPtr, typename... Args> | |
| static std::enable_if< IsInvocableR< typenameCallback::return_type, Handler, Args... >, void >::type | assign (Callback &cb, ArgsPack< VoidPtr, Args... >) |
| Assign invoker to callback (enabled case). | |
| template<typename Handler, typename Callback, typename VoidPtr, typename... Args> | |
| static std::enable_if<!IsInvocableR< typenameCallback::return_type, Handler, Args... >, void >::type | assign (Callback &cb, ArgsPack< VoidPtr, Args... >) |
| Assign invoker to callback (disabled case). | |
|
inlinestatic |
Assign invoker to callback (disabled case).
If the handler is NOT invocable with the callback's signature, this overload is selected and does nothing. This allows a handler to support only some of the delegate's signatures.
| Handler | Type of the handler object |
| Callback | Type of the callback |
| VoidPtr | void* type (first parameter) |
| Args | Remaining argument types |
| cb | Callback (unused) |
| ArgsPack | for template argument deduction |
|
inlinestatic |
Assign invoker to callback (enabled case).
If the handler is invocable with the callback's signature, creates a wrapper function and assigns it to the callback.
| Handler | Type of the handler object |
| Callback | Type of the callback to assign |
| VoidPtr | void* type (first parameter) |
| Args | Remaining argument types |
| cb | Callback to assign to |
| ArgsPack | for template argument deduction |
References invoke().
Referenced by b2bits::delegate_detail::ForEach< Callbacks >::assign().
|
inlinestatic |
Invoke a handler method with provided arguments.
Static function that casts the void* to the handler type and invokes its operator() with the arguments.
| Handler | Type of the handler object |
| R | Return type |
| Args | Argument types |
| mem | Pointer to handler object (stored in delegate) |
| args | Arguments to forward to handler |
Referenced by assign().