MCKL
Monte Carlo Kernel Library
Classes | Functions
HDF5 objects I/O

Load and store objects in the HDF5 format. More...

Classes

class  mckl::HDF5Attribute
 RAII class for HDF5 attribute. More...
 
class  mckl::HDF5DataSet
 RAII class for HDF5 data set. More...
 
class  mckl::HDF5DataSpace
 RAII class for HDF5 data space. More...
 
class  mckl::HDF5DataType
 RAII class for HDF5 data type. More...
 
class  mckl::HDF5File
 RAII class for HDF5 file object. More...
 
class  mckl::HDF5Group
 RAII class for HDF5 group. More...
 
class  mckl::HDF5ID< Derived >
 RAII class for HDF5 IDs. More...
 
class  mckl::HDF5PropertyList
 RAII class for HDF5 property list. More...
 

Functions

bool mckl::hdf5_error_printing (bool enabled)
 Enable and disable HDF5 low level error printing. More...
 
template<typename Location , typename T , typename Alloc >
bool mckl::hdf5append (Location &&location, const std::string &name, const Vector< T, Alloc > &vec)
 Append a vector in HDF5 format. More...
 
template<typename Location , typename T >
bool mckl::hdf5load (Location &&location, const std::string &name, T *value, bool isattr=false, decltype(hdf5type< T >()) *=nullptr)
 Load a value form HDF5 format. More...
 
template<typename Location >
bool mckl::hdf5load (Location &&location, const std::string &name, std::string *str, bool isattr=false)
 Load a string form HDF5 format. More...
 
template<typename Location , typename T , typename Alloc >
bool mckl::hdf5load (Location &&location, const std::string &name, Vector< T, Alloc > *vec, bool isattr=false)
 Load a vector form HDF5 format. More...
 
template<typename Location , typename T , MatrixLayout Layout, typename Alloc >
bool mckl::hdf5load (Location &&location, const std::string &name, Matrix< T, Layout, Alloc > *mat, bool isattr=false)
 Load a row major matrix form HDF5 format. More...
 
template<typename Location , typename T >
bool mckl::hdf5store (Location &&location, const std::string &name, const T &value, bool isattr=false, decltype(hdf5type< T >()) *=nullptr)
 Store a value in HDF5 format. More...
 
template<typename Location >
bool mckl::hdf5store (Location &&location, const std::string &name, const std::string &str, bool isattr=false)
 Store a string in HDF5 format. More...
 
template<typename Location , typename T , typename Alloc >
bool mckl::hdf5store (Location &&location, const std::string &name, const Vector< T, Alloc > &vec, bool isattr=false, bool extensible=false, std::size_t chunk_size=1024)
 Store a vector in HDF5 format. More...
 
template<typename Location , typename T , MatrixLayout Layout, typename Alloc >
bool mckl::hdf5store (Location &&location, const std::string &name, const Matrix< T, Layout, Alloc > &mat, bool isattr=false)
 Store a Matrix in HDF5 format. More...
 
inline ::hid_t mckl::hdf5typeid (char *)
 HDF5 data type id overload for char. More...
 
inline ::hid_t mckl::hdf5typeid (signed char *)
 HDF5 data type id overload for signed char. More...
 
inline ::hid_t mckl::hdf5typeid (unsigned char *)
 HDF5 data type id overload for unsigned char. More...
 
inline ::hid_t mckl::hdf5typeid (short *)
 HDF5 data type id overload for short. More...
 
inline ::hid_t mckl::hdf5typeid (unsigned short *)
 HDF5 data type id overload for unsigned short. More...
 
inline ::hid_t mckl::hdf5typeid (int *)
 HDF5 data type id overload for int. More...
 
inline ::hid_t mckl::hdf5typeid (unsigned int *)
 HDF5 data type id overload for unsigned int. More...
 
inline ::hid_t mckl::hdf5typeid (long *)
 HDF5 data type id overload for long. More...
 
inline ::hid_t mckl::hdf5typeid (unsigned long *)
 HDF5 data type id overload for unsigned long. More...
 
inline ::hid_t mckl::hdf5typeid (long long *)
 HDF5 data type id overload for long long. More...
 
inline ::hid_t mckl::hdf5typeid (unsigned long long *)
 HDF5 data type id overload for unsigned long. More...
 
inline ::hid_t mckl::hdf5typeid (float *)
 HDF5 data type id overload for float. More...
 
inline ::hid_t mckl::hdf5typeid (double *)
 HDF5 data type id overload for double. More...
 
inline ::hid_t mckl::hdf5typeid (long double *)
 HDF5 data type id overload for long double. More...
 

Detailed Description

Load and store objects in the HDF5 format.

Function Documentation

◆ hdf5_error_printing()

bool mckl::hdf5_error_printing ( bool  enabled)
inline

Enable and disable HDF5 low level error printing.

Parameters
enabledIf true, error printing will be enabled after the function call, otherwise it will be disabled.
Returns
The original status before the function call

Definition at line 125 of file hdf5.hpp.

◆ hdf5append()

template<typename Location , typename T , typename Alloc >
bool mckl::hdf5append ( Location &&  location,
const std::string &  name,
const Vector< T, Alloc > &  vec 
)
inline

Append a vector in HDF5 format.

Definition at line 692 of file hdf5.hpp.

◆ hdf5load() [1/4]

template<typename Location , typename T >
bool mckl::hdf5load ( Location &&  location,
const std::string &  name,
T *  value,
bool  isattr = false,
decltype(hdf5type< T >()) *  = nullptr 
)
inline

Load a value form HDF5 format.

Definition at line 787 of file hdf5.hpp.

◆ hdf5load() [2/4]

template<typename Location >
bool mckl::hdf5load ( Location &&  location,
const std::string &  name,
std::string *  str,
bool  isattr = false 
)
inline

Load a string form HDF5 format.

Definition at line 813 of file hdf5.hpp.

◆ hdf5load() [3/4]

template<typename Location , typename T , typename Alloc >
bool mckl::hdf5load ( Location &&  location,
const std::string &  name,
Vector< T, Alloc > *  vec,
bool  isattr = false 
)
inline

Load a vector form HDF5 format.

Definition at line 850 of file hdf5.hpp.

◆ hdf5load() [4/4]

template<typename Location , typename T , MatrixLayout Layout, typename Alloc >
bool mckl::hdf5load ( Location &&  location,
const std::string &  name,
Matrix< T, Layout, Alloc > *  mat,
bool  isattr = false 
)
inline

Load a row major matrix form HDF5 format.

Definition at line 898 of file hdf5.hpp.

◆ hdf5store() [1/4]

template<typename Location , typename T >
bool mckl::hdf5store ( Location &&  location,
const std::string &  name,
const T &  value,
bool  isattr = false,
decltype(hdf5type< T >()) *  = nullptr 
)
inline

Store a value in HDF5 format.

Definition at line 559 of file hdf5.hpp.

◆ hdf5store() [2/4]

template<typename Location >
bool mckl::hdf5store ( Location &&  location,
const std::string &  name,
const std::string &  str,
bool  isattr = false 
)
inline

Store a string in HDF5 format.

Definition at line 591 of file hdf5.hpp.

◆ hdf5store() [3/4]

template<typename Location , typename T , typename Alloc >
bool mckl::hdf5store ( Location &&  location,
const std::string &  name,
const Vector< T, Alloc > &  vec,
bool  isattr = false,
bool  extensible = false,
std::size_t  chunk_size = 1024 
)
inline

Store a vector in HDF5 format.

Definition at line 635 of file hdf5.hpp.

◆ hdf5store() [4/4]

template<typename Location , typename T , MatrixLayout Layout, typename Alloc >
bool mckl::hdf5store ( Location &&  location,
const std::string &  name,
const Matrix< T, Layout, Alloc > &  mat,
bool  isattr = false 
)
inline

Store a Matrix in HDF5 format.

Definition at line 747 of file hdf5.hpp.

◆ hdf5typeid() [1/14]

inline ::hid_t mckl::hdf5typeid ( char *  )

HDF5 data type id overload for char.

Definition at line 474 of file hdf5.hpp.

◆ hdf5typeid() [2/14]

inline ::hid_t mckl::hdf5typeid ( signed char *  )

HDF5 data type id overload for signed char.

Definition at line 478 of file hdf5.hpp.

◆ hdf5typeid() [3/14]

inline ::hid_t mckl::hdf5typeid ( unsigned char *  )

HDF5 data type id overload for unsigned char.

Definition at line 485 of file hdf5.hpp.

◆ hdf5typeid() [4/14]

inline ::hid_t mckl::hdf5typeid ( short *  )

HDF5 data type id overload for short.

Definition at line 492 of file hdf5.hpp.

◆ hdf5typeid() [5/14]

inline ::hid_t mckl::hdf5typeid ( unsigned short *  )

HDF5 data type id overload for unsigned short.

Definition at line 496 of file hdf5.hpp.

◆ hdf5typeid() [6/14]

inline ::hid_t mckl::hdf5typeid ( int *  )

HDF5 data type id overload for int.

Definition at line 503 of file hdf5.hpp.

◆ hdf5typeid() [7/14]

inline ::hid_t mckl::hdf5typeid ( unsigned int *  )

HDF5 data type id overload for unsigned int.

Definition at line 507 of file hdf5.hpp.

◆ hdf5typeid() [8/14]

inline ::hid_t mckl::hdf5typeid ( long *  )

HDF5 data type id overload for long.

Definition at line 514 of file hdf5.hpp.

◆ hdf5typeid() [9/14]

inline ::hid_t mckl::hdf5typeid ( unsigned long *  )

HDF5 data type id overload for unsigned long.

Definition at line 518 of file hdf5.hpp.

◆ hdf5typeid() [10/14]

inline ::hid_t mckl::hdf5typeid ( long long *  )

HDF5 data type id overload for long long.

Definition at line 525 of file hdf5.hpp.

◆ hdf5typeid() [11/14]

inline ::hid_t mckl::hdf5typeid ( unsigned long long *  )

HDF5 data type id overload for unsigned long.

Definition at line 529 of file hdf5.hpp.

◆ hdf5typeid() [12/14]

inline ::hid_t mckl::hdf5typeid ( float *  )

HDF5 data type id overload for float.

Definition at line 536 of file hdf5.hpp.

◆ hdf5typeid() [13/14]

inline ::hid_t mckl::hdf5typeid ( double *  )

HDF5 data type id overload for double.

Definition at line 540 of file hdf5.hpp.

◆ hdf5typeid() [14/14]

inline ::hid_t mckl::hdf5typeid ( long double *  )

HDF5 data type id overload for long double.

Definition at line 544 of file hdf5.hpp.