hops
Namespaces | Classes | Enumerations | Functions
H5Easy Namespace Reference

Namespaces

 detail
 

Classes

class  Compression
 Set compression level for written DataSets. More...
 
class  DumpOptions
 Options for dumping data. More...
 

Enumerations

enum  DumpMode { DumpMode::Create = 0, DumpMode::Overwrite = 1 }
 Write mode for DataSets. More...
 
enum  Flush { Flush::False = 0, Flush::True = 1 }
 Enable/disable automatic flushing after write operations. More...
 

Functions

size_t getSize (const File &file, const std::string &path)
 Get the size of an existing DataSet in an open HDF5 file. More...
 
std::vector< size_t > getShape (const File &file, const std::string &path)
 Get the shape of an existing DataSet in an readable file. More...
 
template<class T >
DataSet dump (File &file, const std::string &path, const T &data, DumpMode mode=DumpMode::Create)
 Write object (templated) to a (new) DataSet in an open HDF5 file. More...
 
template<class T >
DataSet dump (File &file, const std::string &path, const T &data, const DumpOptions &options)
 Write object (templated) to a (new) DataSet in an open HDF5 file. More...
 
template<class T >
DataSet dump (File &file, const std::string &path, const T &data, const std::vector< size_t > &idx)
 Write a scalar to a (new, extendible) DataSet in an open HDF5 file. More...
 
template<class T >
DataSet dump (File &file, const std::string &path, const T &data, const std::initializer_list< size_t > &idx)
 Write a scalar to a (new, extendable) DataSet in an open HDF5 file. More...
 
template<class T >
DataSet dump (File &file, const std::string &path, const T &data, const std::vector< size_t > &idx, const DumpOptions &options)
 Write a scalar to a (new, extendible) DataSet in an open HDF5 file. More...
 
template<class T >
DataSet dump (File &file, const std::string &path, const T &data, const std::initializer_list< size_t > &idx, const DumpOptions &options)
 Write a scalar to a (new, extendible) DataSet in an open HDF5 file. More...
 
template<class T >
load (const File &file, const std::string &path, const std::vector< size_t > &idx)
 Load entry "(i,j)" from a rank-two DataSet in an open HDF5 file to a scalar. More...
 
template<class T >
load (const File &file, const std::string &path)
 Load a DataSet in an open HDF5 file to an object (templated). More...
 
template<class T >
Attribute dumpAttribute (File &file, const std::string &path, const std::string &key, const T &data, DumpMode mode=DumpMode::Create)
 Write object (templated) to a (new) Attribute in an open HDF5 file. More...
 
template<class T >
Attribute dumpAttribute (File &file, const std::string &path, const std::string &key, const T &data, const DumpOptions &options)
 Write object (templated) to a (new) Attribute in an open HDF5 file. More...
 
template<class T >
loadAttribute (const File &file, const std::string &path, const std::string &key)
 Load a Attribute in an open HDF5 file to an object (templated). More...
 

Enumeration Type Documentation

◆ DumpMode

enum H5Easy::DumpMode
strong

Write mode for DataSets.

Enumerator
Create 

Dump only if DataSet does not exist, otherwise throw.

Overwrite 

Create or overwrite if DataSet of correct shape exists, otherwise throw.

◆ Flush

enum H5Easy::Flush
strong

Enable/disable automatic flushing after write operations.

Enumerator
False 

No automatic flushing.

True 

Automatic flushing.

Function Documentation

◆ dump() [1/6]

template<class T >
DataSet H5Easy::dump ( File file,
const std::string path,
const T &  data,
const DumpOptions options 
)
inline

Write object (templated) to a (new) DataSet in an open HDF5 file.

Parameters
fileWriteable opened file
pathPath of the DataSet
dataData to write
optionsDump options
Returns
The newly created DataSet

◆ dump() [2/6]

template<class T >
DataSet H5Easy::dump ( File file,
const std::string path,
const T &  data,
const std::initializer_list< size_t > &  idx 
)
inline

Write a scalar to a (new, extendable) DataSet in an open HDF5 file.

Parameters
fileopen File (has to be writeable)
pathpath of the DataSet
datathe data to write
idxthe indices to which to write
Returns
The newly created DataSet

◆ dump() [3/6]

template<class T >
DataSet H5Easy::dump ( File file,
const std::string path,
const T &  data,
const std::initializer_list< size_t > &  idx,
const DumpOptions options 
)
inline

Write a scalar to a (new, extendible) DataSet in an open HDF5 file.

Parameters
fileopened File (has to be writeable)
pathpath of the DataSet
datathe data to write
idxthe indices to which to write
optionsDump options
Returns
The newly created DataSet

◆ dump() [4/6]

template<class T >
DataSet H5Easy::dump ( File file,
const std::string path,
const T &  data,
const std::vector< size_t > &  idx 
)
inline

Write a scalar to a (new, extendible) DataSet in an open HDF5 file.

Parameters
fileopened File (has to be writeable)
pathpath of the DataSet
datathe data to write
idxthe indices to which to write
Returns
The newly created DataSet

◆ dump() [5/6]

template<class T >
DataSet H5Easy::dump ( File file,
const std::string path,
const T &  data,
const std::vector< size_t > &  idx,
const DumpOptions options 
)
inline

Write a scalar to a (new, extendible) DataSet in an open HDF5 file.

Parameters
fileopened File (has to be writeable)
pathpath of the DataSet
datathe data to write
idxthe indices to which to write
optionsDump options
Returns
The newly created DataSet

◆ dump() [6/6]

template<class T >
DataSet H5Easy::dump ( File file,
const std::string path,
const T &  data,
DumpMode  mode = DumpMode::Create 
)
inline

Write object (templated) to a (new) DataSet in an open HDF5 file.

Parameters
fileWriteable opened file
pathPath of the DataSet
dataData to write
modeWrite mode
Returns
The newly created DataSet

◆ dumpAttribute() [1/2]

template<class T >
Attribute H5Easy::dumpAttribute ( File file,
const std::string path,
const std::string key,
const T &  data,
const DumpOptions options 
)
inline

Write object (templated) to a (new) Attribute in an open HDF5 file.

Parameters
fileWriteable opened file
pathPath of the DataSet
keyName of the attribute
dataData to write
optionsDump options
Returns
The newly created DataSet

◆ dumpAttribute() [2/2]

template<class T >
Attribute H5Easy::dumpAttribute ( File file,
const std::string path,
const std::string key,
const T &  data,
DumpMode  mode = DumpMode::Create 
)
inline

Write object (templated) to a (new) Attribute in an open HDF5 file.

Parameters
fileWriteable opened file
pathPath of the DataSet
keyName of the attribute
dataData to write
modeWrite mode
Returns
The newly created DataSet

◆ getShape()

std::vector< size_t > H5Easy::getShape ( const File file,
const std::string path 
)
inline

Get the shape of an existing DataSet in an readable file.

Parameters
fileA readable opened file
pathPath of the DataSet
Returns
the shape of the DataSet

◆ getSize()

size_t H5Easy::getSize ( const File file,
const std::string path 
)
inline

Get the size of an existing DataSet in an open HDF5 file.

Parameters
fileA readable opened file
pathPath of the DataSet
Returns
Size of the DataSet

◆ load() [1/2]

template<class T >
T H5Easy::load ( const File file,
const std::string path 
)
inline

Load a DataSet in an open HDF5 file to an object (templated).

Parameters
fileopened File (has to be writeable)
pathpath of the DataSet
Returns
the read data

◆ load() [2/2]

template<class T >
T H5Easy::load ( const File file,
const std::string path,
const std::vector< size_t > &  idx 
)
inline

Load entry "(i,j)" from a rank-two DataSet in an open HDF5 file to a scalar.

Parameters
fileopened File (has to be writeable)
idxthe indices to load
pathpath of the DataSet
Returns
the read data

◆ loadAttribute()

template<class T >
T H5Easy::loadAttribute ( const File file,
const std::string path,
const std::string key 
)
inline

Load a Attribute in an open HDF5 file to an object (templated).

Parameters
fileopened File (has to be writeable)
pathpath of the DataSet
keyName of the attribute
Returns
the read data