h5cpp 0.7.1
A modern C++ wrapper for the HDF5 C library
hdf5::datatype::Enum Class Reference

compound data type More...

#include <enum.hpp>

Inheritance diagram for hdf5::datatype::Enum:
Collaboration diagram for hdf5::datatype::Enum:

Public Member Functions

 Enum ()=default
 default constructor More...
 
 Enum (ObjectHandle &&handle)
 construct from handle More...
 
 Enum (const Datatype &type)
 construct from generic datatype More...
 
template<typename T >
void insert (const std::string &name, const T &data) const
 insert enum value definition (with underlying type deduction) More...
 
size_t number_of_values () const
 return the total number of enum values More...
 
std::string name (size_t index) const
 get value name More...
 
template<typename T >
value (size_t index) const
 get value at index (with underlying type deduction) More...
 
template<typename T >
value (const std::string &name) const
 get value by name (with underlying type deduction) More...
 
template<typename T >
void insert_underlying (const std::string &name, const T &data) const
 insert enum value definition More...
 
template<typename T >
void underlying_value (size_t index, T &data) const
 get value at index More...
 
template<typename T >
void underlying_value (const std::string &name, T &data) const
 get value by name More...
 
- Public Member Functions inherited from hdf5::datatype::Datatype
virtual ~Datatype ()
 destructor More...
 
 Datatype ()=default
 default constructor More...
 
 Datatype (ObjectHandle &&handle)
 constructor More...
 
 Datatype (Datatype &&type)=default
 move constructor More...
 
 Datatype (const Datatype &type)
 copy constructor More...
 
Datatypeoperator= (const Datatype &type)
 copy assignment More...
 
Datatypeoperator= (Datatype &&type)=default
 move assignment More...
 
Class get_class () const
 returns the datatypes class More...
 
Datatype super () const
 get the base type More...
 
Datatype native_type (Direction dir=Direction::Ascend) const
 get native type More...
 
bool has_class (Class type_class) const
 search for a type class More...
 
virtual size_t size () const
 get size of type in bytes More...
 
virtual void size (size_t size) const
 set the size of a type in bytes More...
 
 operator hid_t () const
 
bool is_valid () const
 check status of the object More...
 

Static Public Member Functions

template<typename T >
static Enum create (const T &)
 named constructor (with underlying type deduction) More...
 
static Enum create_underlying (const Datatype &base_type)
 named constructor from underlying datatype More...
 

Detailed Description

An enum data type which can be used to save enum values along with metadata describing their meaning.

Constructor & Destructor Documentation

◆ Enum() [1/3]

hdf5::datatype::Enum::Enum ( )
default

◆ Enum() [2/3]

hdf5::datatype::Enum::Enum ( ObjectHandle &&  handle)
explicit

◆ Enum() [3/3]

hdf5::datatype::Enum::Enum ( const Datatype type)
explicit

Member Function Documentation

◆ create()

template<typename T >
Enum hdf5::datatype::Enum::create ( const T &  )
static

◆ create_underlying()

static Enum hdf5::datatype::Enum::create_underlying ( const Datatype base_type)
static

◆ insert()

template<typename T >
void hdf5::datatype::Enum::insert ( const std::string &  name,
const T &  data 
) const

◆ insert_underlying()

template<typename T >
void hdf5::datatype::Enum::insert_underlying ( const std::string &  name,
const T &  data 
) const

◆ name()

std::string hdf5::datatype::Enum::name ( size_t  index) const

◆ number_of_values()

size_t hdf5::datatype::Enum::number_of_values ( ) const

◆ underlying_value() [1/2]

template<typename T >
void hdf5::datatype::Enum::underlying_value ( const std::string &  name,
T &  data 
) const

◆ underlying_value() [2/2]

template<typename T >
void hdf5::datatype::Enum::underlying_value ( size_t  index,
T &  data 
) const

◆ value() [1/2]

template<typename T >
T hdf5::datatype::Enum::value ( const std::string &  name) const

◆ value() [2/2]

template<typename T >
T hdf5::datatype::Enum::value ( size_t  index) const

The documentation for this class was generated from the following file: