26 #define CONCAT( a, b ) a b
33 template <
typename DataType>
36 static std::string name() {
return typeid( DataType ).name(); }
42 #define CAFFA_DEFINE_PORTABLE_TYPE( DataType ) \
44 struct PortableDataType<DataType> \
46 static std::string name() \
53 struct PortableDataType<std::vector<DataType>> \
55 static std::string name() \
57 return CONCAT( #DataType, "[]" ); \
62 struct PortableDataType<std::vector<std::vector<DataType>>> \
64 static std::string name() \
66 return CONCAT( #DataType, "[][]" ); \
70 #define CAFFA_DEFINE_PORTABLE_TYPE_NAME( DataType, StringAlias ) \
72 struct PortableDataType<DataType> \
74 static std::string name() \
81 struct PortableDataType<std::vector<DataType>> \
83 static std::string name() \
85 return CONCAT( StringAlias, "[]" ); \
90 struct PortableDataType<std::vector<std::vector<DataType>>> \
92 static std::string name() \
94 return CONCAT( StringAlias, "[][]" ); \
98 CAFFA_DEFINE_PORTABLE_TYPE(
double )
99 CAFFA_DEFINE_PORTABLE_TYPE(
float )
100 CAFFA_DEFINE_PORTABLE_TYPE(
bool )
101 CAFFA_DEFINE_PORTABLE_TYPE(
char )
102 CAFFA_DEFINE_PORTABLE_TYPE_NAME(
int,
"int32" )
103 CAFFA_DEFINE_PORTABLE_TYPE_NAME(
unsigned, "uint32" )
104 CAFFA_DEFINE_PORTABLE_TYPE_NAME( uint64_t, "uint64" )
105 CAFFA_DEFINE_PORTABLE_TYPE_NAME( int64_t, "int64" )
106 CAFFA_DEFINE_PORTABLE_TYPE_NAME( std::
string, "
string" )
107 CAFFA_DEFINE_PORTABLE_TYPE_NAME(
void, "
void" )
Main Caffa namespace.
Definition: __init__.py:1
Definition: cafPortableDataType.h:35