34 #ifndef CARTOBASE_TYPE_DATATYPETRAITS_H 35 #define CARTOBASE_TYPE_DATATYPETRAITS_H 44 #define DATA_TYPE_TRAITS_DECLARE_SPECIALIZATION_SINGLE_CHANNEL( T, IS_SCALAR, LONG, HAS_BOOL_CONVERSION ) \ 46 struct DataTypeTraits< T > \ 49 typedef T ChannelType; \ 50 typedef LONG LongType; \ 52 static const bool is_scalar = IS_SCALAR; \ 53 static const bool is_multichannel = false; \ 54 static const bool has_bool_conversion = HAS_BOOL_CONVERSION; \ 55 static const unsigned int channelcount = 1; \ 58 #define DATA_TYPE_TRAITS_DECLARE_SPECIALIZATION_MULTI_CHANNEL( T, IS_SCALAR, LONG, HAS_BOOL_CONVERSION ) \ 60 struct DataTypeTraits< T > \ 63 typedef T::ChannelType ChannelType; \ 64 typedef LONG LongType; \ 66 static const bool is_scalar = false; \ 67 static const bool is_multichannel = true; \ 68 static const bool has_bool_conversion = HAS_BOOL_CONVERSION; \ 69 static const unsigned int channelcount = T::channelcount; \ 72 #define DATA_TYPE_TRAITS_DECLARE_SPECIALIZATION( T, IS_SCALAR, IS_MULTICHANNEL, LONG, HAS_BOOL_CONVERSION ) \ 73 DATA_TYPE_TRAITS_DECLARE_SPECIALIZATION_##IS_MULTICHANNEL(T, IS_SCALAR, LONG, HAS_BOOL_CONVERSION) \ 75 #define DATA_TYPE_TRAITS_INSTANCIATE_SPECIALIZATION( T ) \ 76 const bool carto::DataTypeTraits< T >::is_scalar; \ 77 const bool carto::DataTypeTraits< T >::is_multichannel; \ 78 const bool carto::DataTypeTraits< T >::has_bool_conversion; \ 79 const unsigned int carto::DataTypeTraits< T >::channelcount; \ 81 #define DATA_TYPE_TRAITS_INSTANCIATE_TEMPLATE_SPECIALIZATION( T ) \ 82 template<> const bool carto::DataTypeTraits< T >::is_scalar; \ 83 template<> const bool carto::DataTypeTraits< T >::is_multichannel; \ 84 template<> const bool carto::DataTypeTraits< T >::has_bool_conversion; \ 85 template<> const unsigned int carto::DataTypeTraits< T >::channelcount; \ 102 template<
typename DataType>
static const unsigned int channelcount
static const bool is_multichannel
std::complex< float > cfloat
Complex 32 bits float.
Properties of data types.
static const bool is_scalar
static const bool has_bool_conversion
#define DATA_TYPE_TRAITS_DECLARE_SPECIALIZATION(T, IS_SCALAR, IS_MULTICHANNEL, LONG, HAS_BOOL_CONVERSION)
std::complex< double > cdouble
Complex 64 bits float.
Void does not contain anything.