RMF
RMF::HDF5 Namespace Reference

The namespace for all HDF5 functionality in the library. More...

Classes

class  ConstAttributes
class  ConstDataSetD
class  ConstFile
class  ConstGroup
class  DataSetAccessPropertiesD
struct  DataSetCreationPropertiesD
class  DataSetD
class  DataSetIndexD
class  File
class  Group
class  Handle
 Make sure an HDF5 handle is released. More...
class  MutableAttributes
class  Object
class  SharedHandle
 Share an HDF5 handle. More...

Typedefs

typedef char Char
typedef std::string Chars
typedef ConstAttributes< Object > ConstDataSetAttributes
typedef std::vector< File > ConstFiles
typedef ConstAttributes< Object > ConstGroupAttributes
typedef std::vector< Group > ConstGroups
typedef std::vector< File > Files
typedef float Float
typedef std::vector< Float > Floats
typedef std::vector< Floats > FloatsList
typedef MutableAttributes< ConstGroup > GroupAttributes
typedef std::vector< Group > Groups
typedef herr_t(*) HDF5CloseFunction(hid_t)
 The signature for the HDF5 close functions.
typedef int Index
typedef std::vector< Index > Indexes
typedef std::vector< Indexes > IndexesList
typedef int Int
typedef std::vector< Int > Ints
typedef std::vector< Ints > IntsList
typedef std::string String
typedef std::vector< String > Strings
typedef std::vector< Strings > StringsList

Enumerations

enum  Compression { GZIP_COMPRESSION , SLIB_COMPRESSION , NO_COMPRESSION }

Functions

File create_file (std::string name)
template<class OutType, class InType>
OutType get_as (const std::vector< InType > in)
template<class OutType, class InType>
OutType get_as (InType in)
int get_number_of_open_handles (ConstFile f=ConstFile())
Strings get_open_handle_names (ConstFile f=ConstFile())
template<int D>
std::size_t hash_value (const DataSetIndexD< D > &t)
 Produce hash values for boost hash tables.
File open_file (std::string name)
ConstFile open_file_read_only (std::string name)
void set_show_errors (bool tf)

Detailed Description

We provide a simple set of classes for accessing core HDF5 functionality from C++. This was needed since

  • The HDF5 C interface is not trivial to use properly, particularly in regards to data type conversions and resource management
  • It is very easy to use the C interface incorrectly without knowing it.
  • The standard HDF5 C++ interface doesn't really simplify use of the HDF5 library and doesn't make use of the features of C++.

The main classes provide access too:

The Const variants are for read only files.

They allow one to create a manipulate data sets containing floating point values, integers, strings, variable length arrays of floating point values and a few other types. Attributes on data sets of groups of those types can also be manipulated.

The top level classes are, in turn, derived from RMF::Object, RMF::HDF5::ConstAttributes and RMF::HDF5::MutableAttributes which provide access to general HDF5 per-object and attribute functionality (all objects in HDF5 can have arbitrary small pieces of data attached to them via attributes).

Not all of the functionality of the HDF5 C library is covered in C++. You can get the corresponding native handle from most objects with methods like RMF::File::get_handle() and use that for other operations if needed. Or submit a patch to the library.

In python, the module is also called RMF.HDF5.

Typedef Documentation

◆ Char

typedef char RMF::HDF5::Char

The type used to store char values.

Definition at line 52 of file HDF5/types.h.

◆ Chars

typedef std::string RMF::HDF5::Chars

The type used to store lists of char values.

Definition at line 54 of file HDF5/types.h.

◆ ConstDataSetAttributes

typedef ConstAttributes<Object> RMF::HDF5::ConstDataSetAttributes

Definition at line 28 of file ConstDataSetD.h.

◆ ConstFiles

typedef std::vector<File> RMF::HDF5::ConstFiles

Definition at line 47 of file ConstFile.h.

◆ ConstGroupAttributes

typedef ConstAttributes<Object> RMF::HDF5::ConstGroupAttributes

Definition at line 21 of file ConstGroup.h.

◆ ConstGroups

typedef std::vector<Group> RMF::HDF5::ConstGroups

Definition at line 45 of file ConstFile.h.

◆ Files

typedef std::vector<File> RMF::HDF5::Files

Definition at line 96 of file File.h.

◆ Float

typedef float RMF::HDF5::Float

The type used to store lists of floating point values.

Definition at line 32 of file HDF5/types.h.

◆ Floats

typedef std::vector<Float> RMF::HDF5::Floats

The type used to store lists of floating point values.

Definition at line 34 of file HDF5/types.h.

◆ FloatsList

typedef std::vector<Floats> RMF::HDF5::FloatsList

The type used to store lists of floating point values.

Definition at line 36 of file HDF5/types.h.

◆ GroupAttributes

typedef MutableAttributes<ConstGroup> RMF::HDF5::GroupAttributes

Definition at line 21 of file Group.h.

◆ Groups

typedef std::vector<Group> RMF::HDF5::Groups

Definition at line 94 of file File.h.

◆ HDF5CloseFunction

typedef herr_t(*) RMF::HDF5::HDF5CloseFunction(hid_t)

Definition at line 33 of file handle.h.

◆ Index

typedef int RMF::HDF5::Index

The type used to store lists of index values.

Definition at line 38 of file HDF5/types.h.

◆ Indexes

typedef std::vector<Index> RMF::HDF5::Indexes

The type used to store lists of index values.

Definition at line 40 of file HDF5/types.h.

◆ IndexesList

typedef std::vector<Indexes> RMF::HDF5::IndexesList

The type used to store lists of indexes.

Definition at line 42 of file HDF5/types.h.

◆ Int

typedef int RMF::HDF5::Int

The type used to store integral values.

Definition at line 28 of file HDF5/types.h.

◆ Ints

typedef std::vector<Int> RMF::HDF5::Ints

The type used to store lists of integral values.

Definition at line 30 of file HDF5/types.h.

◆ IntsList

typedef std::vector<Ints> RMF::HDF5::IntsList

The type used to store lists of lists of integers values.

Definition at line 50 of file HDF5/types.h.

◆ String

typedef std::string RMF::HDF5::String

The type used to store lists of string values.

Definition at line 44 of file HDF5/types.h.

◆ Strings

typedef std::vector<String> RMF::HDF5::Strings

The type used to store lists of string values.

Definition at line 46 of file HDF5/types.h.

◆ StringsList

typedef std::vector<Strings> RMF::HDF5::StringsList

The type used to store lists of strings values.

Definition at line 48 of file HDF5/types.h.

Enumeration Type Documentation

◆ Compression

Data sets can be compressed using one of several algorithms.

Definition at line 20 of file DataSetCreationPropertiesD.h.

Function Documentation

◆ create_file()

File RMF::HDF5::create_file ( std::string name)

Create a new HDF5 file, clearing any existing file with the same name if needed. The file cannot already be open.

Exceptions
RMF::IOExceptioncouldn't create file
Here is the call graph for this function:

◆ get_as() [1/2]

template<class OutType, class InType>
OutType RMF::HDF5::get_as ( const std::vector< InType > in)

Get one type as another, handling vectors or scalars.

Definition at line 341 of file HDF5/types.h.

Here is the call graph for this function:

◆ get_as() [2/2]

template<class OutType, class InType>
OutType RMF::HDF5::get_as ( InType in)

Get one type as another, handling vectors or scalars.

Definition at line 333 of file HDF5/types.h.

Here is the call graph for this function:

◆ get_number_of_open_handles()

int RMF::HDF5::get_number_of_open_handles ( ConstFile f = ConstFile())

For debugging, one can get the number of open HDF5 handles for either one file, or the whole system.

Here is the call graph for this function:

◆ get_open_handle_names()

Strings RMF::HDF5::get_open_handle_names ( ConstFile f = ConstFile())

For debugging you can get the names of open handles in either one file or the whole process.

Here is the call graph for this function:

◆ hash_value()

template<int D>
std::size_t RMF::HDF5::hash_value ( const DataSetIndexD< D > & t)

Definition at line 96 of file DataSetIndexD.h.

Here is the call graph for this function:

◆ open_file()

File RMF::HDF5::open_file ( std::string name)

Open an existing HDF5 file. The file cannot already be open/.

Exceptions
RMF::IOExceptioncouldn't open file
Here is the call graph for this function:

◆ open_file_read_only()

ConstFile RMF::HDF5::open_file_read_only ( std::string name)

Open an existing HDF5 file read only. The file cannot already be open.

Here is the call graph for this function:

◆ set_show_errors()

void RMF::HDF5::set_show_errors ( bool tf)

Turn on and off printing of HDF5 error messages. They can help in diagnostics, but, for the moment, can only be output to standard error and so are off by default.

Here is the call graph for this function: