VSM C++ SDK
Vehicle Specific Modules SDK
ugcs::vsm::Callback< Method, typename std::enable_if< callback_internal::Is_method_ptr< Method >()>::type, Class_ptr, Args... > Class Template Reference

Generic callback which uses bound class method as callable. More...

#include <callback.h>

Inheritance diagram for ugcs::vsm::Callback< Method, typename std::enable_if< callback_internal::Is_method_ptr< Method >()>::type, Class_ptr, Args... >:
ugcs::vsm::Callback_base< std::result_of< Method(Class_ptr, Args...)>::type >

Public Types

typedef Callback_base< typename std::result_of< Method(Class_ptr, Args...)>::type > Base_type
 Base class type. More...
 
typedef Base_type::template Ptr< CallbackPtr
 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...
 
- Public Types inherited from ugcs::vsm::Callback_base< std::result_of< Method(Class_ptr, Args...)>::type >
typedef std::result_of< Method(Class_ptr, Args...)>::type Result_t
 Result type. More...
 

Public Member Functions

 Callback (Method method, Class_ptr &&obj_ptr, Args &&...args)
 Constructor for class method bound callback. 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 (Method method, Class_ptr &&obj_ptr, Args &&...args)
 Create callback instance. More...
 

Detailed Description

template<class Method, class Class_ptr, typename... Args>
class ugcs::vsm::Callback< Method, typename std::enable_if< callback_internal::Is_method_ptr< Method >()>::type, Class_ptr, Args... >

Generic callback which uses bound class method as callable.

Use Make_callback for convenient instantiation. Specialized template version for class member function.

Parameters
Class_ptrPointer to class object (used with pointer semantic, can be any smart pointer as well).
Classmethod to call.
ArgsArguments pack.
See also
Make_callback

Member Typedef Documentation

template<class Method , class Class_ptr , typename... Args>
template<size_t arg_idx>
using ugcs::vsm::Callback< Method, typename std::enable_if< callback_internal::Is_method_ptr< Method >()>::type, Class_ptr, Args... >::Arg_type = typename std::tuple_element<arg_idx, Args_tuple>::type

Get type of the specified argument.

Parameters
arg_idxIndex of the argument. Should be in range [0, sizeof...(Args)).
template<class Method , class Class_ptr , typename... Args>
typedef Callback_base<typename std::result_of<Method(Class_ptr, Args...)>::type> ugcs::vsm::Callback< Method, typename std::enable_if< callback_internal::Is_method_ptr< Method >()>::type, Class_ptr, Args... >::Base_type

Base class type.

template<class Method , class Class_ptr , typename... Args>
typedef Base_type::template Ptr<Callback> ugcs::vsm::Callback< Method, typename std::enable_if< callback_internal::Is_method_ptr< Method >()>::type, Class_ptr, Args... >::Ptr

Callable pointer class type.

Constructor & Destructor Documentation

template<class Method , class Class_ptr , typename... Args>
ugcs::vsm::Callback< Method, typename std::enable_if< callback_internal::Is_method_ptr< Method >()>::type, Class_ptr, Args... >::Callback ( Method  method,
Class_ptr &&  obj_ptr,
Args &&...  args 
)
inline

Constructor for class method bound callback.

template<class Method , class Class_ptr , typename... Args>
ugcs::vsm::Callback< Method, typename std::enable_if< callback_internal::Is_method_ptr< Method >()>::type, Class_ptr, Args... >::Callback ( Callback< Method, typename std::enable_if< callback_internal::Is_method_ptr< Method >()>::type, Class_ptr, Args... > &&  )
default

Move constructor.

Member Function Documentation

template<class Method , class Class_ptr , typename... Args>
static Ptr ugcs::vsm::Callback< Method, typename std::enable_if< callback_internal::Is_method_ptr< Method >()>::type, Class_ptr, Args... >::Create ( Method  method,
Class_ptr &&  obj_ptr,
Args &&...  args 
)
inlinestatic

Create callback instance.

template<class Method , class Class_ptr , typename... Args>
template<size_t arg_idx>
Arg_type<arg_idx>& ugcs::vsm::Callback< Method, typename std::enable_if< callback_internal::Is_method_ptr< Method >()>::type, Class_ptr, Args... >::Get_arg ( )
inline

Get reference to an argument at the specified position.

Template parameters:

  • arg_idx Index of the argument to get.
    Returns
    Reference to the stored argument.
template<class Method , class Class_ptr , typename... Args>
virtual Base_type::Result_t ugcs::vsm::Callback< Method, typename std::enable_if< callback_internal::Is_method_ptr< Method >()>::type, Class_ptr, Args... >::operator() ( )
inlineoverridevirtual

The documentation for this class was generated from the following file: