Support for static array in HDF5
This commit is contained in:
parent
5395097fa7
commit
2164198f82
@ -238,6 +238,31 @@ namespace CosmoTool { \
|
||||
}; \
|
||||
};
|
||||
|
||||
#define CTOOL_ARRAY_TYPE(ARRAY_TYPE, DIM, TNAME) \
|
||||
namespace CosmoTool { \
|
||||
class TNAME { \
|
||||
public: \
|
||||
H5::ArrayType *type; \
|
||||
\
|
||||
TNAME() \
|
||||
{ \
|
||||
hsize_t dims[1] = { DIM }; \
|
||||
type = new H5::ArrayType(get_hdf5_data_type<ARRAY_TYPE>::type(), 1, dims); \
|
||||
} \
|
||||
~TNAME() { delete type; } \
|
||||
\
|
||||
static const TNAME *ctype() \
|
||||
{ \
|
||||
static TNAME singleton; \
|
||||
return &singleton; \
|
||||
} \
|
||||
}; \
|
||||
\
|
||||
template<> struct get_hdf5_data_type< ARRAY_TYPE[DIM] > { \
|
||||
static H5::DataType type() { return *(TNAME::ctype()->type); }; \
|
||||
}; \
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user