Tapkee
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
callbacks_traits.hpp
Go to the documentation of this file.
1 /* This software is distributed under BSD 3-clause license (see LICENSE file).
2  *
3  * Copyright (c) 2012-2013 Sergey Lisitsyn
4  */
5 
6 #ifndef TAPKEE_CALLBACK_TRAITS_H_
7 #define TAPKEE_CALLBACK_TRAITS_H_
8 
9 namespace tapkee
10 {
11 
12  template <class Callback>
14  {
15  static const bool supports_batch;
16  };
17  #define TAPKEE_CALLBACK_SUPPORTS_BATCH(X) \
18  template<> const bool BatchCallbackTraits<X>::supports_batch = true; \
19 
20  template <class T>
21  class is_dummy
22  {
23  typedef char yes;
24  typedef long no;
25 
26  template <typename C> static yes dummy(typename C::dummy*);
27  template <typename C> static no dummy(...);
28 
29  public:
30  static const bool value = (sizeof(dummy<T>(0)) == sizeof(yes));
31  };
32 
33 }
34 
35 #endif
static yes dummy(typename C::dummy *)
static const bool supports_batch
static const bool value