/** * @file include/ActivMiddleware/ActivBase/GenericMessages/Formats/Common/FieldMetaFunctions.h * * @brief Header for field metafunction classes used by the public pluggable format interface. */ #if (!defined ACTIV_BASE_GENERIC_MESSAGES_FORMATS_COMMON_FIELD_META_FUNCTIONS_H) #define ACTIV_BASE_GENERIC_MESSAGES_FORMATS_COMMON_FIELD_META_FUNCTIONS_H #include "ActivMiddleware/CxxYZ/type_traits.h" #include "ActivMiddleware/Misc/ContainerTraits.h" #include ACTIV_BOOST_INCLUDE(mpl/count_if.hpp) //! Activ namespace. namespace Activ { //! GenericMessages namespace. namespace GenericMessages { // TODO doc this class DefinitionToStorageTag; class DefinitionToClassTag; class DefinitionToFieldReferenceListTag; // --------------------------------------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------------------------------------- template class TagToTypeMetaFunction; // --------------------------------------------------------------------------------------------------------------------------------- template class TagToTypeMetaFunction { public: typedef typename Detail::FieldTypeToStorageType::type type; }; // --------------------------------------------------------------------------------------------------------------------------------- template class TagToTypeMetaFunction { public: typedef typename Detail::FieldTypeToReferenceType::type type; }; // --------------------------------------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------------------------------------- //! Does a field list contain a particular field? template class IsFieldInFieldList : public MakeBoolConstant< (1 == Boost::mpl::count_if >::type::value)> { }; // --------------------------------------------------------------------------------------------------------------------------------- //! Metafunction to determine if a type is a ClassField, rather than a Field. template class IsClassField : public MakeBoolConstant< !CxxYZ::is_same >::value> { }; } // namespace GenericMessages } // namespace Activ #endif // (!defined ACTIV_BASE_GENERIC_MESSAGES_FORMATS_COMMON_FIELD_META_FUNCTIONS_H)