46 #ifndef MIRA_HASMEMBER_H_ 47 #define MIRA_HASMEMBER_H_ 50 #include <boost/type_traits/integral_constant.hpp> 51 #include <boost/type_traits/is_class.hpp> 59 struct HasMemberCheckNonClassTypeDummy {};
77 #define MIRA_MEMBER_DETECTOR_EX(Identifier, Member) \ 78 template <typename Type> \ 79 class MIRAHasMemberCheck##Identifier \ 81 struct NotFound { char x[1]; }; \ 82 struct Found { char x[2]; }; \ 87 struct Base : public Type, public BaseMixin {}; \ 88 template <typename T, T t> class Helper{}; \ 90 template <typename U> \ 91 static NotFound deduce(U*, Helper<void (BaseMixin::*)(), &U::Member>* = 0);\ 92 static Found deduce(...); \ 95 enum { value = (sizeof(Found) == sizeof(deduce((Base*)(0))))}; \ 96 typedef boost::integral_constant<bool, \ 97 (sizeof(Found) == sizeof(deduce((Base*)(0)))) > type; \ 102 #define MIRA_MEMBER_DETECTOR(Member) MIRA_MEMBER_DETECTOR_EX(Member,Member) 105 template <
typename T,
typename IsClassType>
106 struct MIRAHasMemberCheckTraitHelper {
typedef T
type; };
110 template <
typename T>
111 struct MIRAHasMemberCheckTraitHelper<T,
boost::false_type> {
112 typedef mira::HasMemberCheckNonClassTypeDummy
type;
115 template <
typename T>
116 struct MIRAHasMemberCheckTrait {
117 typedef typename MIRAHasMemberCheckTraitHelper<T,
137 #define MIRA_HAS_MEMBER(Class, Identifier) \ 138 MIRAHasMemberCheck##Identifier<MIRAHasMemberCheckTrait<Class>::type> 140 #define MIRA_HAS_MEMBER_TEMPLATE(Class, Identifier) \ 141 MIRAHasMemberCheck##Identifier<typename MIRAHasMemberCheckTrait<Class>::type> Definition: SyncTimedRead.h:62
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
PropertyHint type(const std::string &t)
Sets the attribute "type" to the specified value.
Definition: PropertyHint.h:295