Go to the documentation of this file.
10 #define H5DATATYPE_HPP
81 bool empty()
const noexcept;
117 :
name(std::move(t_name))
131 inline CompoundType(
const std::vector<member_def>& t_members,
size_t size = 0)
132 : members(t_members) {
135 inline CompoundType(std::vector<member_def>&& t_members,
size_t size = 0)
136 : members(std::move(t_members)) {
139 inline CompoundType(
const std::initializer_list<member_def>& t_members,
141 : members(t_members) {
151 inline const std::vector<member_def>&
getMembers() const noexcept {
158 std::vector<member_def> members;
163 void create(
size_t size = 0);
195 ,
value(std::move(t_value)) {}
203 : members(t_members) {
207 EnumType(std::initializer_list<member_def> t_members)
216 std::vector<member_def> members;
223 template <
typename T>
228 template <
typename T>
238 template <std::
size_t N>
239 class FixedLenStringArray {
264 void push_back(
const std::array<char, N>&);
272 inline const char*
operator[](std::size_t i)
const noexcept {
273 return datavec[i].data();
275 inline const char*
at(std::size_t i)
const {
276 return datavec.at(i).data();
278 inline bool empty() const noexcept {
279 return datavec.empty();
281 inline std::size_t
size() const noexcept {
282 return datavec.size();
288 return datavec.front().data();
290 inline const char*
back()
const {
291 return datavec.back().data();
294 return datavec[0].data();
296 inline const char*
data() const noexcept {
297 return datavec[0].data();
301 using vector_t =
typename std::vector<std::array<char, N>>;
312 return datavec.begin();
315 return datavec.end();
318 return datavec.begin();
321 return datavec.cbegin();
324 return datavec.end();
327 return datavec.cend();
330 return datavec.rbegin();
333 return datavec.rend();
336 return datavec.rbegin();
339 return datavec.rend();
361 #define HIGHFIVE_REGISTER_TYPE(type, function) \
362 namespace HighFive { \
364 DataType create_datatype<type>() { \
371 #endif // H5DATATYPE_HPP
Use for defining a sub-type of compound type.
Definition: H5DataType.hpp:115
iterator end() noexcept
Definition: H5DataType.hpp:314
const_reverse_iterator rend() const noexcept
Definition: H5DataType.hpp:338
T value
Definition: H5DataType.hpp:197
size_t offset
Definition: H5DataType.hpp:122
const char * front() const
Definition: H5DataType.hpp:287
const char * at(std::size_t i) const
Definition: H5DataType.hpp:275
void commit(const Object &object, const std::string &name) const
Commit datatype into the given Object.
Definition: H5DataType_misc.hpp:315
CompoundType(const CompoundType &other)=default
member_def(const std::string &t_name, T t_value)
Definition: H5DataType.hpp:193
member_def(std::string t_name, DataType t_base_type, size_t t_offset=0)
Definition: H5DataType.hpp:116
EnumType(std::initializer_list< member_def > t_members)
Definition: H5DataType.hpp:207
void push_back(const std::string &)
Append an std::string to the buffer structure.
Definition: H5DataType_misc.hpp:220
size_t getSize() const
Returns the length (in bytes) of this type elements.
Definition: H5DataType_misc.hpp:36
const_reverse_iterator rbegin() const noexcept
Definition: H5DataType.hpp:335
bool isFixedLenStr() const
Returns whether the type is a fixed-length string.
Definition: H5DataType_misc.hpp:57
bool empty() const noexcept
Definition: H5DataType.hpp:278
HDF5 Data Type.
Definition: H5DataType.hpp:42
Use for defining a member of enum type.
Definition: H5DataType.hpp:192
bool isVariableStr() const
Returns whether the type is a variable-length string.
Definition: H5DataType_misc.hpp:48
reverse_iterator rbegin() noexcept
Definition: H5DataType.hpp:329
EnumType(const std::vector< member_def > &t_members)
Definition: H5DataType.hpp:202
std::string name
Definition: H5DataType.hpp:196
Create a compound HDF5 datatype.
Definition: H5DataType.hpp:111
const char * operator[](std::size_t i) const noexcept
Definition: H5DataType.hpp:272
iterator begin() noexcept
Definition: H5DataType.hpp:311
const char * data() const noexcept
Definition: H5DataType.hpp:296
typename vector_t::iterator iterator
Definition: H5DataType.hpp:305
void commit(const Object &object, const std::string &name) const
Commit datatype into the given Object.
Definition: H5DataType_misc.hpp:292
const char * back() const
Definition: H5DataType.hpp:290
Definition: H5Object.hpp:36
CompoundType(std::vector< member_def > &&t_members, size_t size=0)
Definition: H5DataType.hpp:135
std::string getString(std::size_t index) const
Retrieve a string from the structure as std::string.
Definition: H5DataType_misc.hpp:234
typename vector_t::reverse_iterator reverse_iterator
Definition: H5DataType.hpp:307
EnumType(const EnumType &other)=default
typename vector_t::value_type value_type
Definition: H5DataType.hpp:309
FixedLenStringArray()=default
char * data() noexcept
Definition: H5DataType.hpp:293
typename vector_t::const_iterator const_iterator
Definition: H5DataType.hpp:306
AtomicType()
Definition: H5DataType_misc.hpp:181
std::size_t size() const noexcept
Definition: H5DataType.hpp:281
std::string string() const
Returns a friendly description of the type (e.g. Float32)
Definition: H5DataType_misc.hpp:65
const_iterator cbegin() const noexcept
Definition: H5DataType.hpp:320
std::string name
Definition: H5DataType.hpp:120
bool operator==(const DataType &other) const
Definition: H5DataType_misc.hpp:40
bool empty() const noexcept
Check the DataType was default constructed. Such value might represent auto-detection of the datatype...
Definition: H5DataType_misc.hpp:28
File class.
Definition: H5File.hpp:24
DataTypeClass
Enum of Fundamental data classes.
Definition: H5DataType.hpp:23
create an HDF5 DataType from a C++ type
Definition: H5_definitions.hpp:36
typename vector_t::const_reverse_iterator const_reverse_iterator
Definition: H5DataType.hpp:308
Class representing an attribute of a dataset or group.
Definition: H5Attribute.hpp:23
bool isReference() const
Returns whether the type is a Reference.
Definition: H5DataType_misc.hpp:61
bool operator!=(const DataType &other) const
Definition: H5DataType_misc.hpp:44
CompoundType(const std::initializer_list< member_def > &t_members, size_t size=0)
Definition: H5DataType.hpp:139
DataType create_and_check_datatype()
Create a DataType instance representing type T and perform a sanity check on its size.
Definition: H5DataType_misc.hpp:406
const_iterator end() const noexcept
Definition: H5DataType.hpp:323
Object()
Definition: H5Object_misc.hpp:16
DataType create_datatype()
Create a DataType instance representing type T.
Definition: H5DataType_misc.hpp:399
NAME string(REPLACE ".cpp" "_bin" example_name ${example_filename}) if($
Definition: hops/Third-party/HighFive/src/examples/CMakeLists.txt:6
DataTypeClass getClass() const
Return the fundamental type.
Definition: H5DataType_misc.hpp:32
CompoundType(const std::vector< member_def > &t_members, size_t size=0)
Initializes a compound type from a vector of member definitions.
Definition: H5DataType.hpp:131
reverse_iterator rend() noexcept
Definition: H5DataType.hpp:332
DataType base_type
Definition: H5DataType.hpp:121
void resize(std::size_t n)
Definition: H5DataType.hpp:284
T basic_type
Definition: H5DataType.hpp:104
const_iterator cend() const noexcept
Definition: H5DataType.hpp:326
Create a enum HDF5 datatype.
Definition: H5DataType.hpp:188
const_iterator begin() const noexcept
Definition: H5DataType.hpp:317
Class representing a dataset.
Definition: H5DataSet.hpp:27
Definition: H5_definitions.hpp:15
const std::vector< member_def > & getMembers() const noexcept
Get read access to the CompoundType members.
Definition: H5DataType.hpp:151