![]() |
VSM C++ SDK
Vehicle Specific Modules SDK
|
Generic callback. More...
#include <callback.h>
Public Types | |
using | Base_type = Callback_base< typename std::result_of< Callable(Args...)>::type > |
Base class type. More... | |
using | Ptr = typename Base_type::template Ptr< Callback > |
Callable pointer class type. More... | |
template<size_t arg_idx> | |
using | Arg_type = typename std::tuple_element< arg_idx, Args_tuple >::type |
Get type of the specified argument. More... | |
![]() | |
using | Result_t = std::result_of< Callable(Args...)>::type |
Result type. More... | |
Public Member Functions | |
Callback (Callable &&callable, Args &&...args) | |
Construct callback instance. More... | |
Callback (Callback &&)=default | |
Move constructor. More... | |
virtual Base_type::Result_t | operator() () override |
Execute callback. More... | |
template<size_t arg_idx> | |
Arg_type< arg_idx > & | Get_arg () |
Get reference to an argument at the specified position. More... | |
Static Public Member Functions | |
static Ptr | Create (Callable &&callable, Args &&...args) |
Create callback instance. More... | |
Protected Member Functions | |
template<int... s> | |
Base_type::Result_t | Invoke (callback_internal::Sequence< s...>) |
Invoke callable entity with user provided arguments. More... | |
Protected Attributes | |
callback_internal::Adapt_callable_type < Callable >::type | callable |
Callable entity from user. More... | |
Args_tuple | args |
User provided arguments pack. More... | |
Generic callback.
Use Make_callback for convenient instantiation. Generic template version for any callable object.
Callable | Any callable object type (function, lambda, class with overloaded call operator etc.). |
Enable | Dummy template argument for conditional specialization. |
Args | Arguments pack. |
using ugcs::vsm::Callback< Callable, Enable, Args >::Arg_type = typename std::tuple_element<arg_idx, Args_tuple>::type |
Get type of the specified argument.
arg_idx | Index of the argument. Should be in range [0, sizeof...(Args)). |
using ugcs::vsm::Callback< Callable, Enable, Args >::Base_type = Callback_base<typename std::result_of<Callable(Args...)>::type> |
Base class type.
using ugcs::vsm::Callback< Callable, Enable, Args >::Ptr = typename Base_type::template Ptr<Callback> |
Callable pointer class type.
|
inline |
Construct callback instance.
callable | Callable entity instance. |
args | User defined arguments pack. |
|
default |
Move constructor.
|
inlinestatic |
Create callback instance.
|
inline |
Get reference to an argument at the specified position.
Template parameters:
|
inlineprotected |
Invoke callable entity with user provided arguments.
|
inlineoverridevirtual |
Execute callback.
Implements ugcs::vsm::Callback_base< std::result_of< Callable(Args...)>::type >.
|
protected |
User provided arguments pack.
|
protected |
Callable entity from user.