#pragma once namespace ros_bridge { namespace traits { //! @brief Checks if class T has a member function z. //! //! Checks if class T has a member function z. E.g if the class Point has a member function //! z than HasMemberZ::value is equal to 1 and 0 either. template class HasMemberZ { typedef char Small; struct Big { char x[2]; }; template static Small test( typeof(&C::z) ) ; template static Big test(...); public: enum { value = sizeof(test(0)) == sizeof(Small) }; }; //! @brief Checks if class T has a member function SetZ. //! //! Checks if class T has a member function SetZ. E.g if the class Point has a member function //! SetZ than HasMemberSetZ::value is equal to 1 and 0 either. template class HasMemberSetZ { typedef char Small; struct Big { char x[2]; }; template static Small test( typeof(&C::SetZ) ) ; template static Big test(...); public: enum { value = sizeof(test(0)) == sizeof(Small) }; }; //! @brief Checks if class T has a member function labels. //! //! Checks if class T has a member function labels. E.g if the class T has a member function //! labels than HasMemberLabels::value is equal to 1 and 0 either. template class HasMemberLabels { typedef char Small; struct Big { char x[2]; }; template static Small test( typeof(&C::labels) ) ; template static Big test(...); public: enum { value = sizeof(test(0)) == sizeof(Small) }; }; //! @brief Checks if class T has a member function SetLabels. //! //! Checks if class T has a member function SetLabels. E.g if the class T has a member function //! SetLabels than HasMemberSetLabels::value is equal to 1 and 0 either. template class HasMemberSetLabels { typedef char Small; struct Big { char x[2]; }; template static Small test( typeof(&C::SetLabels) ) ; template static Big test(...); public: enum { value = sizeof(test(0)) == sizeof(Small) }; }; //! @brief Checks if class T has a member function labels. //! //! Checks if class T has a member function likelihood. E.g if the class T has a member function //! likelihood than HasMemberLikelihood::value is equal to 1 and 0 either. template class HasMemberLikelihood { typedef char Small; struct Big { char x[2]; }; template static Small test( typeof(&C::likelihood) ) ; template static Big test(...); public: enum { value = sizeof(test(0)) == sizeof(Small) }; }; //! @brief Checks if class T has a member function setLikelihood. //! //! Checks if class T has a member function setLikelihood. E.g if the class T has a member function //! setLikelihood than HasMemberSetLikelihood::value is equal to 1 and 0 either. template class HasMemberSetLikelihood { typedef char Small; struct Big { char x[2]; }; template static Small test( typeof(&C::setLikelihood) ) ; template static Big test(...); public: enum { value = sizeof(test(0)) == sizeof(Small) }; }; //! @brief Checks if class T has a member function header. //! //! Checks if class T has a member function header. E.g if the class T has a member function //! header than HasMemberHeader::value is equal to 1 and 0 either. template class HasMemberHeader { typedef char Small; struct Big { char x[2]; }; template static Small test( typeof(&C::header) ) ; template static Big test(...); public: enum { value = sizeof(test(0)) == sizeof(Small) }; }; //! @brief Checks if class T has a member function setHeader. //! //! Checks if class T has a member function setHeader. E.g if the class T has a member function //! setHeader than HasMemberSetHeader::value is equal to 1 and 0 either. template class HasMemberSetHeader { typedef char Small; struct Big { char x[2]; }; template static Small test( typeof(&C::setHeader) ) ; template static Big test(...); public: enum { value = sizeof(test(0)) == sizeof(Small) }; }; //! @brief Checks if class T has a member function altitude. //! //! Checks if class T has a member function altitude. E.g if the class T has a member function //! altitude than HasMemberAltitude::value is equal to 1 and 0 either. template class HasMemberAltitude { typedef char Small; struct Big { char x[2]; }; template static Small test( typeof(&C::altitude) ) ; template static Big test(...); public: enum { value = sizeof(test(0)) == sizeof(Small) }; }; //! @brief Checks if class T has a member function setAltitude. //! //! Checks if class T has a member function setAltitude. E.g if the class T has a member function //! setAltitude than HasMemberSetAltitude::value is equal to 1 and 0 either. template class HasMemberSetAltitude { typedef char Small; struct Big { char x[2]; }; template static Small test( typeof(&C::setAltitude) ) ; template static Big test(...); public: enum { value = sizeof(test(0)) == sizeof(Small) }; }; //! @brief Selects the Type T or U depending on flag and stores it inside Result. template struct Select {typedef T Result;}; template struct Select<0, T, U> {typedef U Result;}; struct HasComponents {}; struct Has3Components : public HasComponents {}; struct Has2Components : public HasComponents {}; template struct Type2Type{ typedef T OriginalType; }; template struct Int2Type{ enum {value = k}; }; } }