|
ITCH 5.0 Market Data Handler 1.0.0
NASDAQ ITCH 5.0 Market Data Feed Handler
|
Type-erased callback storage. More...
Type-erased callback storage.
Stores a function pointer for a specific signature (R(Args...)). Provides type-safe assignment and invocation of the callback.
The callback includes a void* parameter as the first argument for accessing the handler object stored in the delegate's inline storage.
| R | Return type of the callback |
| Args | Argument types of the callback |
#include <core/src/impl/Delegate.h>
Public Types | |
| using | return_type = R |
| Return type of this callback. | |
| using | args_type = ArgsPack<Args...> |
| Argument types as a pack. | |
| using | pointer_type = R (*)(Args...) |
| Function pointer type. | |
Public Member Functions | |
| void | assign (pointer_type p) |
| Assign a function pointer to this callback. | |
| R | operator() (Args... args) |
| Invoke the callback with provided arguments. | |
Public Attributes | |
| pointer_type | ptr_ = nullptr |
| Function pointer (nullptr if not assigned). | |
| using b2bits::delegate_detail::CallbackPtr< R, Args >::args_type = ArgsPack<Args...> |
Argument types as a pack.
| using b2bits::delegate_detail::CallbackPtr< R, Args >::pointer_type = R (*)(Args...) |
Function pointer type.
| using b2bits::delegate_detail::CallbackPtr< R, Args >::return_type = R |
Return type of this callback.
|
inline |
Assign a function pointer to this callback.
| p | Function pointer to store |
|
inline |
Invoke the callback with provided arguments.
Calls the stored function pointer if assigned, otherwise returns default-constructed return value.
| args | Arguments to forward to the callback |
| pointer_type b2bits::delegate_detail::CallbackPtr< R, Args >::ptr_ = nullptr |
Function pointer (nullptr if not assigned).
Referenced by b2bits::delegate_detail::CallbackPtr< R, void *, Args... >::operator()().