VSM C++ SDK
Vehicle Specific Modules SDK
callback.h
Go to the documentation of this file.
1 // Copyright (c) 2014, Smart Projects Holdings Ltd
2 // All rights reserved.
3 // See LICENSE file for license details.
4 
13 #ifndef _CALLBACK_H_
14 #define _CALLBACK_H_
15 
16 #include <ugcs/vsm/defs.h>
17 #include <ugcs/vsm/exception.h>
18 #include <ugcs/vsm/debug.h>
19 
20 #include <tuple>
21 #include <memory>
22 #include <functional>
23 
25 #define __UNPACK_PARAMS(...) __VA_ARGS__
26 
42 #define DEFINE_CALLBACK_BUILDER(__name, __types, __values) \
43  template <class __Callable, typename... __Args> \
44  __DEFINE_CALLBACK_BUILDER_BODY(__name, __types, __values)
45 
55 #define DEFINE_CALLBACK_BUILDER_TEMPLATE(__name, __template, __types, __values) \
56  template <__UNPACK_PARAMS __template, class __Callable, typename... __Args> \
57  __DEFINE_CALLBACK_BUILDER_BODY(__name, __types, __values)
58 
59 #ifndef NO_DOXYGEN
60 /* Common part of DEFINE_CALLBACK_BUILDER and DEFINE_CALLBACK_BUILDER_TEMPLATE. */
61 #define __DEFINE_CALLBACK_BUILDER_BODY(__name, __types, __values) \
62  static \
63  typename ugcs::vsm::Callback_forced_args<__Callable, \
64  std::tuple<__UNPACK_PARAMS __types>, \
65  __Args...>::Callback_type::Ptr \
66  __name(__Callable &&__callable, __Args &&... __args) \
67  { \
68  return ugcs::vsm::Callback_forced_args<__Callable, \
69  std::tuple<__UNPACK_PARAMS __types>, \
70  __Args...>::Create( \
71  std::forward<__Callable>(__callable), \
72  std::forward_as_tuple<__UNPACK_PARAMS __types>(__UNPACK_PARAMS __values), \
73  std::forward<__Args>(__args)...); \
74  }
75 #endif
76 
77 namespace ugcs {
78 namespace vsm {
79 
85 template<typename Result>
87 public:
89  typedef Result Result_t;
90 
92  template <class Callback = Callback_base>
93  class Ptr: public std::shared_ptr<Callback> {
94  public:
97 
99  template <typename... Args>
100  Ptr(Args &&... args):
101  std::shared_ptr<Callback_type>(std::forward<Args>(args)...)
102  {}
103 
107  Result_t
109  {
110  if (!std::shared_ptr<Callback_type>::get()) {
112  "Attempted to invoke empty callback");
113  }
114  return (*std::shared_ptr<Callback_type>::get())();
115  }
116  };
117 
119  virtual Result_t
120  operator ()() = 0;
121 };
122 
123 #ifndef NO_DOXYGEN
124 
125 namespace callback_internal {
126 
130 template <int...>
131 struct Sequence
132 {};
133 
137 template<int n, int... s>
138 struct Sequence_generator: Sequence_generator<n - 1, n - 1, s...>
139 {};
140 
142 template<int... s>
143 struct Sequence_generator<0, s...>
144 {
146  typedef Sequence<s...> Sequence_type;
147 };
148 
152 template <typename T>
153 struct Adapt_arg_type {
155  typedef typename std::remove_cv<typename std::remove_reference<T>::type>::type type;
156 };
157 
159 template <size_t size>
160 struct Adapt_arg_type<const char (&)[size]> {
162  typedef const char *type;
163 };
164 
168 template <typename T, typename Enable = void>
169 struct Adapt_callable_type {
171  typedef typename std::remove_cv<typename std::remove_reference<T>::type>::type type;
172 };
173 
175 template <typename F>
176 struct Adapt_callable_type<F,
177  typename std::enable_if<
178  std::is_function<
179  typename std::remove_reference<F>::type>::value>::type> {
181  typedef F type;
182 };
183 
186 template <class Method>
187 struct Is_method_ptr_type {
188  static constexpr bool value =
189  std::is_member_function_pointer<typename callback_internal::Adapt_callable_type<Method>::type>::value;
190 };
191 
193 template <class Method>
194 constexpr bool
195 Is_method_ptr()
196 {
197  return Is_method_ptr_type<Method>::value;
198 }
199 
200 } /* namespace callback_internal */
201 #endif
202 
212 template <class Callable, class Enable, typename... Args>
213 class Callback:
214  public Callback_base<typename std::result_of<Callable(Args...)>::type> {
215 public:
217  typedef Callback_base<typename std::result_of<Callable(Args...)>::type>
220  typedef typename Base_type::template Ptr<Callback> Ptr;
221 
222 private:
224  typedef std::tuple<typename callback_internal::Adapt_arg_type<Args>::type...> Args_tuple;
225 
226 public:
230  template <size_t arg_idx>
231  using Arg_type = typename std::tuple_element<arg_idx, Args_tuple>::type;
232 
234  static Ptr
235  Create(Callable &&callable, Args &&... args)
236  {
237  return std::make_shared<Callback>(std::forward<Callable>(callable),
238  std::forward<Args>(args)...);
239  }
240 
246  Callback(Callable &&callable, Args &&... args):
247  callable(std::forward<Callable>(callable)),
248  args(std::forward<Args>(args)...)
249  {}
250 
252  Callback(Callback &&) = default;
253 
255  virtual typename Base_type::Result_t
256  operator ()() override
257  {
258  return Invoke(typename callback_internal::Sequence_generator
259  <sizeof...(Args)>::Sequence_type());
260  }
261 
267  template <size_t arg_idx>
270  {
271  return std::get<arg_idx>(args);
272  }
273 
274 protected:
276  typename callback_internal::Adapt_callable_type<Callable>::type callable;
278  Args_tuple args;
279 
281  template <int... s>
282  typename Base_type::Result_t
283  Invoke(callback_internal::Sequence<s...>)
284  {
285  return callable(std::get<s>(args)...);
286  }
287 };
288 
299 template <class Method, class Class_ptr, typename... Args>
300 class Callback<Method,
301  typename std::enable_if<callback_internal::Is_method_ptr<Method>()>::type,
302  Class_ptr, Args...>:
303  public Callback_base<typename std::result_of<Method(Class_ptr, Args...)>::type> {
304 public:
306  typedef Callback_base<typename std::result_of<Method(Class_ptr, Args...)>::type>
309  typedef typename Base_type::template Ptr<Callback> Ptr;
310 
311 private:
313  typedef std::tuple<typename callback_internal::Adapt_arg_type<Args>::type...> Args_tuple;
314 
315 public:
319  template <size_t arg_idx>
320  using Arg_type = typename std::tuple_element<arg_idx, Args_tuple>::type;
321 
323  static Ptr
324  Create(Method method, Class_ptr &&obj_ptr, Args &&... args)
325  {
326  return std::make_shared<Callback>(method,
327  std::forward<Class_ptr>(obj_ptr),
328  std::forward<Args>(args)...);
329  }
330 
332  Callback(Method method, Class_ptr &&obj_ptr, Args &&... args):
333  obj_ptr(std::forward<Class_ptr>(obj_ptr)), method(method),
334  args(std::forward<Args>(args)...)
335  {}
336 
338  Callback(Callback &&) = default;
339 
341  virtual typename Base_type::Result_t
342  operator ()() override
343  {
344  return Invoke(typename callback_internal::Sequence_generator
345  <sizeof...(Args)>::Sequence_type());
346  }
347 
353  template <size_t arg_idx>
356  {
357  return std::get<arg_idx>(args);
358  }
359 
360 private:
362  typename std::remove_reference<Class_ptr>::type obj_ptr;
364  typename callback_internal::Adapt_callable_type<Method>::type method;
366  Args_tuple args;
367 
369  template <int... s>
370  typename Base_type::Result_t
371  Invoke(callback_internal::Sequence<s...>)
372  {
373  return ((*obj_ptr).*method)(std::get<s>(args)...);
374  }
375 };
376 
387 template <class Callable, typename... Args>
388 typename Callback<Callable, void, Args...>::Ptr
389 Make_callback(Callable &&callable, Args&& ...args)
390 {
391  return Callback<Callable,
392  void,
393  Args...>::Create
394  (std::forward<Callable>(callable), std::forward<Args>(args)...);
395 }
396 
397 namespace callback_internal {
398 
400 template <class Result, typename... Args>
402 public:
404  typedef std::function<Result(Args...)> Callable;
406  typedef Callback<Callable, void, Args...> Callback_type;
407 
409  static Callable
411  {
412  return [](Args __UNUSED... args) { return Result(); };
413  }
414 };
415 
417 template <typename... Args>
418 class Dummy_callback_helper<void, Args...> {
419 public:
421  typedef std::function<void(Args...)> Callable;
423  typedef Callback<Callable, void, Args...> Callback_type;
424 
426  static Callable
428  {
429  return [](Args __UNUSED... args) {};
430  }
431 };
432 
433 } /* namespace callback_internal */
434 
442 template <class Result, typename... Args>
445 {
446  typedef callback_internal::Dummy_callback_helper<Result, Args...> Helper;
447  return Make_callback<typename Helper::Callable>(Helper::Create(), Args()...);
448 }
449 
450 namespace callback_internal {
451 
453 template <class Callback, size_t idx, typename... Args>
455 
457 template <class Callback>
460  constexpr static bool value = true;
461 };
462 
464 template <class Callback, size_t idx, typename Arg>
465 struct Callback_args_checker<Callback, idx, Arg> {
467  typedef typename Callback::template Arg_type<idx> Cbk_arg;
469  constexpr static bool value = std::is_convertible<Cbk_arg, Arg>::value;
470 
471  static_assert(value, "Argument type mismatch");
472 };
473 
475 template <class Callback, size_t idx, typename Arg, typename... Args>
476 struct Callback_args_checker<Callback, idx, Arg, Args...> {
478  typedef typename Callback::template Arg_type<idx> Cbk_arg;
480  constexpr static bool value = std::is_convertible<Cbk_arg, Arg>::value &&
481  Callback_args_checker<Callback, idx + 1, Args...>::value;
482 
483  static_assert(value, "Argument type mismatch");
484 };
485 
486 } /* namespace callback_internal */
487 
497 template <class Callback_ptr, typename Result, typename... Args>
498 constexpr void
500 {
501  typedef typename
502  std::remove_reference<decltype(*std::declval<Callback_ptr>())>::type Callback;
503 
504  /* Check result type. */
505  static_assert(std::is_convertible<typename Callback::Base_type::Result_t, Result>::value,
506  "Callback result value type mismatch");
507  /* Check argument types. */
509  "Arguments type mismatch");
510 }
511 
512 
513 #ifndef NO_DOXYGEN
514 namespace callback_internal {
515 
522 template <class Callable, typename Enable, typename... Args>
523 class Callback_forced_args_helper {
524 public:
525  template <typename... Forced_args>
526  static typename Callback<Callable, void, Forced_args..., Args...>::Ptr
527  Create(Callable &&callable, std::tuple<Forced_args...> &&forced_args,
528  Args &&... args)
529  {
530  return Create_impl<decltype(forced_args)>(
531  std::forward<Callable>(callable),
532  std::tuple_cat(std::forward<std::tuple<Forced_args...>>(forced_args),
533  std::forward_as_tuple(std::forward<Args>(args)...)),
534  typename callback_internal::Sequence_generator<sizeof...(Forced_args) + sizeof...(Args)>::Sequence_type());
535  }
536 
538  template <class Forced_args_tuple>
539  using Callback_type = decltype(Callback_forced_args_helper::Create(
540  std::declval<Callable>(),
541  std::declval<Forced_args_tuple>(),
542  std::declval<Args>()...));
543 private:
544  template <class Forced_args_tuple, class All_args_tuple, int... args_seq>
546  Create_impl(Callable &&callable, All_args_tuple &&all_args_tuple,
547  callback_internal::Sequence<args_seq...>)
548  {
549  return Make_callback(
550  std::forward<Callable>(callable),
551  std::forward<typename std::tuple_element<args_seq, All_args_tuple>::type>
552  (std::get<args_seq>(all_args_tuple))...);
553  }
554 };
555 
557 template <class Method, class Class_ptr, typename... Args>
558 class Callback_forced_args_helper<
559  Method,
560  typename std::enable_if<callback_internal::Is_method_ptr<Method>()>::type,
561  Class_ptr, Args...> {
562 public:
563  template <typename... Forced_args>
564  static typename Callback<Method, void, Class_ptr, Forced_args..., Args...>::Ptr
565  Create(Method &&method, std::tuple<Forced_args...> &&forced_args,
566  Class_ptr &&class_ptr, Args &&... args)
567  {
568  return Create_impl<decltype(forced_args)>(
569  std::forward<Method>(method),
570  std::tuple_cat(std::forward_as_tuple(std::forward<Class_ptr>(class_ptr)),
571  std::forward<std::tuple<Forced_args...>>(forced_args),
572  std::forward_as_tuple(std::forward<Args>(args)...)),
573  typename callback_internal::Sequence_generator<1 + sizeof...(Forced_args) + sizeof...(Args)>::Sequence_type());
574  }
575 
577  template <class Forced_args_tuple>
578  using Callback_type = decltype(Callback_forced_args_helper::Create(
579  std::declval<Method>(),
580  std::declval<Forced_args_tuple>(),
581  std::declval<Class_ptr>(),
582  std::declval<Args>()...));
583 private:
584  template <class Forced_args_tuple, class All_args_tuple, int... args_seq>
586  Create_impl(Method &&method, All_args_tuple &&all_args_tuple,
587  callback_internal::Sequence<args_seq...>)
588  {
589  return Make_callback(
590  std::forward<Method>(method),
591  std::forward<typename std::tuple_element<args_seq, All_args_tuple>::type>
592  (std::get<args_seq>(all_args_tuple))...);
593  }
594 };
595 
596 } /* namespace callback_internal */
597 #endif
598 
599 
623 template <class Callable, class Forced_args_tuple, typename... Args>
625  public callback_internal::Callback_forced_args_helper<Callable, void, Args...>::
626  template Callback_type<Forced_args_tuple> {
627 
628 public:
630  typedef callback_internal::Callback_forced_args_helper<Callable, void, Args...> Helper;
632  typedef typename Helper::template Callback_type<Forced_args_tuple> Callback_type;
633 
643  static typename Callback_type::Ptr
644  Create(Callable &&callable, Forced_args_tuple &&forced_args_tuple,
645  Args &&... args)
646  {
647  return Helper::Create(std::forward<Callable>(callable),
648  std::forward<Forced_args_tuple>(forced_args_tuple),
649  std::forward<Args>(args)...);
650  }
651 };
652 
653 namespace internal {
654 
658 template <class Ptr_tuple, size_t arg_idx>
659 void
661 {}
662 
664 template <class Ptr_tuple, size_t arg_idx, typename Arg, typename... Args>
665 void
666 Assign_ptr_tuple_impl(Ptr_tuple &tuple, Arg &&arg, Args &&... args)
667 {
668  *std::get<arg_idx>(tuple) = std::forward<Arg>(arg);
669  Assign_ptr_tuple_impl<Ptr_tuple, arg_idx + 1, Args...>
670  (tuple, std::forward<Args>(args)...);
671 }
672 
675 template <class Ptr_tuple, typename... Args>
676 void
677 Assign_ptr_tuple(Ptr_tuple &tuple, Args &&... args)
678 {
679  Assign_ptr_tuple_impl<Ptr_tuple, 0, Args...>(tuple, std::forward<Args>(args)...);
680 }
681 
682 } /* namespace internal */
683 
690 template <class Result, typename... Args>
692 public:
696  typedef typename Callback_type::template Ptr<> Callback_ptr;
697 
698 private:
700  typedef std::tuple<typename std::add_lvalue_reference<Args>::type...> Args_ref_tuple;
702  typedef std::tuple<typename std::add_pointer<Args>::type...> Args_ptr_tuple;
703 
704 public:
706  template <size_t arg_idx>
707  using Arg_ref_type = typename std::tuple_element<arg_idx, Args_ref_tuple>::type;
708 
710  template <size_t arg_idx>
711  using Arg_ptr_type = typename std::tuple_element<arg_idx, Args_ptr_tuple>::type;
712 
714  Callback_proxy() = default;
715 
717  template <class Callback_ptr>
718  Callback_proxy(Callback_ptr cbk):
719  cbk(cbk), args_ptr(Get_args_ptr_tuple(cbk, Args_seq()))
720  {
721  Callback_check_type<Callback_ptr, Result, Args...>();
722  }
723 
725  template <typename... Invoke_args>
726  void
727  Set_args(Invoke_args &&... invoke_args) const
728  {
729  internal::Assign_ptr_tuple(args_ptr, std::forward<Invoke_args>(invoke_args)...);
730  }
731 
733  template <typename... Invoke_args>
734  Result
735  operator()(Invoke_args &&... invoke_args) const
736  {
737  Set_args<Invoke_args...>(std::forward<Invoke_args>(invoke_args)...);
738  return Invoke();
739  }
740 
742  Result
743  Invoke() const
744  {
745  return cbk();
746  }
747 
749  Callback_ptr
751  {
752  return cbk;
753  }
754 
756  explicit operator bool() const
757  {
758  return cbk != nullptr;
759  }
760 
762  operator Callback_ptr()
763  {
764  return cbk;
765  }
766 
772  template <size_t arg_idx>
775  {
776  /*
777  * Proxy should be bound to be able to access arguments.
778  * In release build the code will anyway crash somewhere else.
779  */
780  ASSERT(*this);
781  return *std::get<arg_idx>(args_ptr);
782  }
783 
789  template <size_t arg_idx, typename Arg_type>
790  void
791  Set_arg(Arg_type &&arg)
792  {
793  Get_arg<arg_idx>() = std::forward<Arg_type>(arg);
794  }
795 
799  bool
800  operator ==(const Callback_proxy& other) const
801  {
802  return other.cbk == cbk;
803  }
804 
808  bool
809  operator !=(const Callback_proxy& other) const
810  {
811  return other.cbk != cbk;
812  }
813 
815  class Hasher
816  {
817  public:
819  size_t
820  operator ()(const Callback_proxy& proxy) const
821  {
822  static std::hash<decltype(proxy.cbk.get())> hasher;
823 
824  return hasher(proxy.cbk.get());
825  }
826  };
827 
828 private:
830  typedef typename callback_internal::Sequence_generator<sizeof...(Args)>::Sequence_type Args_seq;
831 
833  mutable Callback_ptr cbk;
835  Args_ptr_tuple args_ptr;
836 
840  template <class Callback_ptr, int... args_seq>
841  static Args_ptr_tuple
842  Get_args_ptr_tuple(Callback_ptr cbk, callback_internal::Sequence<args_seq...>)
843  {
844  return Args_ptr_tuple(&cbk->template Get_arg<args_seq>()...);
845  }
846 };
847 
848 } /* namespace vsm */
849 } /* namespace ugcs */
850 
851 #endif /* _CALLBACK_H_ */
UGCS root namespace.
Definition: android-linux/ugcs/vsm/platform_sockets.h:27
static Callback_type::Ptr Create(Callable &&callable, Forced_args_tuple &&forced_args_tuple, Args &&...args)
Create callback with forced first arguments.
Definition: callback.h:644
static Callable Create()
Create callable object.
Definition: callback.h:410
Helper structure for checking callback argument types.
Definition: callback.h:454
void Set_arg(Arg_type &&arg)
Set argument value at the specified position.
Definition: callback.h:791
void Set_args(Invoke_args &&...invoke_args) const
Set arguments values for callback invocation.
Definition: callback.h:727
Callback_base< Result > Callback_type
Base type of the underlying callback object.
Definition: callback.h:694
Exception class with one parameter.
Definition: exception.h:88
Debugging and troubleshooting helpers.
Result Result_t
Result type.
Definition: callback.h:89
Helper class for creating dummy callbacks.
Definition: callback.h:401
static Callable Create()
Create callable object.
Definition: callback.h:427
Callback::template Arg_type< idx > Cbk_arg
Corresponding real argument type in the callback.
Definition: callback.h:478
Callback_type::template Ptr Callback_ptr
Pointer to the underlying callback object.
Definition: callback.h:696
Result Invoke() const
Invoke the callback with the previously set argument values.
Definition: callback.h:743
Callback(Method method, Class_ptr &&obj_ptr, Args &&...args)
Constructor for class method bound callback.
Definition: callback.h:332
typename std::tuple_element< arg_idx, Args_tuple >::type Arg_type
Get type of the specified argument.
Definition: callback.h:231
Arg_ref_type< arg_idx > Get_arg()
Get reference to an argument at the specified position.
Definition: callback.h:774
STL namespace.
Callback Callback_type
Type of target callback.
Definition: callback.h:96
Common preprocessor definitions.
Callback which can be executed.
Definition: callback.h:86
#define ASSERT(x)
No action in release.
Definition: debug.h:68
VSM exceptions definition.
void Assign_ptr_tuple(Ptr_tuple &tuple, Args &&...args)
Helper function for assigning values to location pointers by pointers stored in a tuple...
Definition: callback.h:677
callback_internal::Adapt_callable_type< Callable >::type callable
Callable entity from user.
Definition: callback.h:276
#define __UNUSED
Use with unused arguments if you like to declare that it is not (yet) used a the function.
Definition: defs.h:30
void Assign_ptr_tuple_impl(Ptr_tuple &tuple __UNUSED)
Assign_ptr_tuple implementation specialization for tail last recursive call.
Definition: callback.h:660
constexpr void Callback_check_type()
Check if the specified callback type corresponds to the partial prototype.
Definition: callback.h:499
Result_t operator()()
Call the associated callback.
Definition: callback.h:108
Args_tuple args
User provided arguments pack.
Definition: callback.h:278
Callback(Callable &&callable, Args &&...args)
Construct callback instance.
Definition: callback.h:246
Arg_type< arg_idx > & Get_arg()
Get reference to an argument at the specified position.
Definition: callback.h:269
std::function< Result(Args...)> Callable
Callable type.
Definition: callback.h:404
Callback_base< typename std::result_of< Callable(Args...)>::type > Base_type
Base class type.
Definition: callback.h:218
Pointer class type.
Definition: callback.h:93
Base_type::template Ptr< Callback > Ptr
Callable pointer class type.
Definition: callback.h:220
Helper class for proxying callback invocation.
Definition: callback.h:691
Callback< Callable, void, Args... >::Ptr Make_callback(Callable &&callable, Args &&...args)
Create a callback.
Definition: callback.h:389
Callback_proxy(Callback_ptr cbk)
Constructs instance bound to the provided callback object.
Definition: callback.h:718
typename std::tuple_element< arg_idx, Args_ref_tuple >::type Arg_ref_type
Creates reference type to the argument with index arg_idx.
Definition: callback.h:707
Helper::template Callback_type< Forced_args_tuple > Callback_type
Resulted callback type.
Definition: callback.h:632
Arg_type< arg_idx > & Get_arg()
Get reference to an argument at the specified position.
Definition: callback.h:355
Base_type::Result_t Invoke(callback_internal::Sequence< s... >)
Invoke callable entity with user provided arguments.
Definition: callback.h:283
Result operator()(Invoke_args &&...invoke_args) const
Invoke the callback with the specified first arguments.
Definition: callback.h:735
static Ptr Create(Method method, Class_ptr &&obj_ptr, Args &&...args)
Create callback instance.
Definition: callback.h:324
Callback::template Arg_type< idx > Cbk_arg
Corresponding real argument type in the callback.
Definition: callback.h:467
Callback< Callable, void, Args... > Callback_type
Resulted callback type.
Definition: callback.h:406
Callback_base< typename std::result_of< Method(Class_ptr, Args...)>::type > Base_type
Base class type.
Definition: callback.h:307
Helper class for defining custom callback creation functions which force several first arguments for ...
Definition: callback.h:624
Callback proxy hasher based on referenced callback.
Definition: callback.h:815
static Ptr Create(Callable &&callable, Args &&...args)
Create callback instance.
Definition: callback.h:235
Generic callback.
Definition: callback.h:213
Callback< Callable, void, Args... > Callback_type
Resulted callback type.
Definition: callback.h:423
Callback_ptr Get_callback()
Get the associated callback.
Definition: callback.h:750
Base_type::template Ptr< Callback > Ptr
Callable pointer class type.
Definition: callback.h:309
callback_internal::Dummy_callback_helper< Result, Args... >::Callback_type::Ptr Make_dummy_callback()
Create dummy callback.
Definition: callback.h:444
std::function< void(Args...)> Callable
Callable type.
Definition: callback.h:421
Ptr(Args &&...args)
Constructor accepts the same arguments as std::shared_ptr.
Definition: callback.h:100
typename std::tuple_element< arg_idx, Args_tuple >::type Arg_type
Get type of the specified argument.
Definition: callback.h:320
#define VSM_EXCEPTION(__exc_class, __msg,...)
Throw VSM exception instance.
Definition: exception.h:170
typename std::tuple_element< arg_idx, Args_ptr_tuple >::type Arg_ptr_type
Creates pointer type to the argument with index arg_idx.
Definition: callback.h:711
callback_internal::Callback_forced_args_helper< Callable, void, Args... > Helper
Helper type.
Definition: callback.h:630