Tapkee
callbacks_traits.hpp
Go to the documentation of this file.
00001 /* This software is distributed under BSD 3-clause license (see LICENSE file).
00002  *
00003  * Copyright (c) 2012-2013 Sergey Lisitsyn
00004  */
00005 
00006 #ifndef TAPKEE_CALLBACK_TRAITS_H_
00007 #define TAPKEE_CALLBACK_TRAITS_H_
00008 
00009 namespace tapkee
00010 {
00011 
00012     template <class Callback>
00013     struct BatchCallbackTraits
00014     {
00015         static const bool supports_batch;
00016     };
00017     #define TAPKEE_CALLBACK_SUPPORTS_BATCH(X)                               \
00018     template<> const bool BatchCallbackTraits<X>::supports_batch = true;    \
00019     
00020     template <class T>
00021     class is_dummy
00022     {
00023         typedef char yes;
00024         typedef long no;
00025 
00026         template <typename C> static yes dummy(typename C::dummy*);
00027         template <typename C> static no dummy(...);
00028     
00029         public:
00030         static const bool value = (sizeof(dummy<T>(0)) == sizeof(yes));
00031     };
00032 
00033 }
00034 
00035 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines