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< ObjectConstDataSetAttributes
 
typedef std::vector< FileConstFiles
 
typedef ConstAttributes< ObjectConstGroupAttributes
 
typedef std::vector< GroupConstGroups
 
typedef std::vector< FileFiles
 
typedef float Float
 
typedef std::vector< FloatFloats
 
typedef std::vector< FloatsFloatsList
 
typedef MutableAttributes
< ConstGroup
GroupAttributes
 
typedef std::vector< GroupGroups
 
typedef herr_t(* HDF5CloseFunction )(hid_t)
 The signature for the HDF5 close functions.
 
typedef int Index
 
typedef std::vector< IndexIndexes
 
typedef std::vector< IndexesIndexesList
 
typedef int Int
 
typedef std::vector< IntInts
 
typedef std::vector< IntsIntsList
 
typedef std::string String
 
typedef std::vector< StringStrings
 
typedef std::vector< StringsStringsList
 

Enumerations

enum  Compression { GZIP_COMPRESSION, SLIB_COMPRESSION, NO_COMPRESSION }
 

Functions

File create_file (std::string name)
 
template<class OutType , class InType >
OutType get_as (InType in)
 
template<class OutType , class InType >
OutType get_as (const std::vector< 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

typedef char RMF::HDF5::Char

The type used to store char values.

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

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

The type used to store lists of char values.

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

typedef float RMF::HDF5::Float

The type used to store lists of floating point values.

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

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.

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.

typedef int RMF::HDF5::Index

The type used to store lists of index values.

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

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.

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

The type used to store lists of indexes.

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

typedef int RMF::HDF5::Int

The type used to store integral values.

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

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.

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.

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

The type used to store lists of string values.

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

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.

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

Data sets can be compressed using one of several algorithms.

Definition at line 20 of file DataSetCreationPropertiesD.h.

Function Documentation

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
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.

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.

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.

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.

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
ConstFile RMF::HDF5::open_file_read_only ( std::string  name)

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

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.