/** * @file include/ActivMiddleware/ActivBase/GenericMessages/Detail/MetaFunctions.h * * @brief Header for miscellaneous metafunction classes. */ #if (!defined ACTIV_BASE_GENERIC_MESSAGES_DETAIL_META_FUNCTIONS_H) #define ACTIV_BASE_GENERIC_MESSAGES_DETAIL_META_FUNCTIONS_H #include "ActivMiddleware/ActivBase/External.h" #include "ActivMiddleware/CxxYZ/type_traits.h" #include "ActivMiddleware/Misc/MetaFunctions.h" #include ACTIV_BOOST_INCLUDE(mpl/for_each.hpp) #include ACTIV_BOOST_INCLUDE(tti/has_static_member_function.hpp) //! Activ namespace. namespace Activ { //! GenericMessages namespace. namespace GenericMessages { namespace Detail { //! Is a type a Definition? template class IsDefinition : public CxxYZ::false_type { }; // --------------------------------------------------------------------------------------------------------------------------------- template class IsDefinition > : public CxxYZ::true_type { }; // --------------------------------------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------------------------------------- ACTIV_BOOST_TTI_HAS_MEMBER_FUNCTION(GetSerializedLength) ACTIV_BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION(GetSerializedLength) //! Metafunction to inspect if a class has a GetSerializedLength() function of some form we can use. template class HasGetSerializedLength : public Boost::mpl::or_< has_member_function_GetSerializedLength, has_member_function_GetSerializedLength, has_static_member_function_GetSerializedLength, has_static_member_function_GetSerializedLength > { }; // --------------------------------------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------------------------------------- // Get the front element of a sequence. template class SequenceFront : public Boost::mpl::front { }; // --------------------------------------------------------------------------------------------------------------------------------- // Specialization to support an empty sequence; returns Empty as the type. template<> class SequenceFront { public: typedef Empty type; }; } // namespace Detail } // namespace GenericMessages } // namespace Activ #endif // (!defined ACTIV_BASE_GENERIC_MESSAGES_DETAIL_META_FUNCTIONS_H)