hops
Classes | Public Member Functions | List of all members
HighFive::EnumType< T > Class Template Reference

Create a enum HDF5 datatype. More...

#include <H5DataType.hpp>

Inheritance diagram for HighFive::EnumType< T >:
Inheritance graph
Collaboration diagram for HighFive::EnumType< T >:
Collaboration graph

Classes

struct  member_def
 Use for defining a member of enum type. More...
 

Public Member Functions

 EnumType (const EnumType &other)=default
 
 EnumType (const std::vector< member_def > &t_members)
 
 EnumType (std::initializer_list< member_def > t_members)
 
void commit (const Object &object, const std::string &name) const
 Commit datatype into the given Object. More...
 
- Public Member Functions inherited from HighFive::DataType
bool operator== (const DataType &other) const
 
bool operator!= (const DataType &other) const
 
DataTypeClass getClass () const
 Return the fundamental type. More...
 
size_t getSize () const
 Returns the length (in bytes) of this type elements. More...
 
std::string string () const
 Returns a friendly description of the type (e.g. Float32) More...
 
bool isVariableStr () const
 Returns whether the type is a variable-length string. More...
 
bool isFixedLenStr () const
 Returns whether the type is a fixed-length string. More...
 
bool empty () const noexcept
 Check the DataType was default constructed. Such value might represent auto-detection of the datatype from a buffer. More...
 
bool isReference () const
 Returns whether the type is a Reference. More...
 
- Public Member Functions inherited from HighFive::Object
 ~Object ()
 
bool isValid () const noexcept
 isValid More...
 
hid_t getId () const noexcept
 getId More...
 
ObjectInfo getInfo () const
 Retrieve several infos about the current object (address, dates, etc) More...
 
ObjectType getType () const
 Gets the fundamental type of the object (dataset, group, etc) More...
 

Additional Inherited Members

- Protected Member Functions inherited from HighFive::DataType
 Object ()
 
 Object (const Object &other)
 
 Object (Object &&other) noexcept
 
 Object (hid_t)
 
- Protected Member Functions inherited from HighFive::Object
 Object ()
 
 Object (const Object &other)
 
 Object (Object &&other) noexcept
 
 Object (hid_t)
 
Objectoperator= (const Object &other)
 
- Protected Attributes inherited from HighFive::Object
hid_t _hid
 

Detailed Description

template<typename T>
class HighFive::EnumType< T >

Create a enum HDF5 datatype.

enum class Position {
FIRST = 1,
SECOND = 2,
};
EnumType<Position> create_enum_position() {
return {{"FIRST", Position::FIRST},
{"SECOND", Position::SECOND}};
}
// You have to register the type inside HighFive
void write_first(H5::File& file) {
auto dataset = file.createDataSet("/foo", Position::FIRST);
}

Constructor & Destructor Documentation

◆ EnumType() [1/3]

template<typename T >
HighFive::EnumType< T >::EnumType ( const EnumType< T > &  other)
default

◆ EnumType() [2/3]

template<typename T >
HighFive::EnumType< T >::EnumType ( const std::vector< member_def > &  t_members)
inline

◆ EnumType() [3/3]

template<typename T >
HighFive::EnumType< T >::EnumType ( std::initializer_list< member_def t_members)
inline

Member Function Documentation

◆ commit()

template<typename T >
void HighFive::EnumType< T >::commit ( const Object object,
const std::string name 
) const
inline

Commit datatype into the given Object.

Parameters
objectLocation to commit object into
nameName to give the datatype

The documentation for this class was generated from the following files:
HIGHFIVE_REGISTER_TYPE
#define HIGHFIVE_REGISTER_TYPE(type, function)
Macro to extend datatype of HighFive.
Definition: H5DataType.hpp:361
Position
Position
Definition: tests_high_five_base.cpp:1355
SECOND
@ SECOND
Definition: tests_high_five_base.cpp:1357
create_enum_position
EnumType< Position > create_enum_position()
Definition: tests_high_five_base.cpp:1375
FIRST
@ FIRST
Definition: tests_high_five_base.cpp:1356