HDF5Serie

Project Page
Public Member Functions | Static Public Member Functions
H5::SimpleAttribute< T > Class Template Reference

A scalar, vector or matrix attribute. More...

#include <simpleattribute.h>

List of all members.

Public Member Functions

 SimpleAttribute ()
 A stub constructor.
 SimpleAttribute (const SimpleAttribute< T > &attribute)
 Copy constructor.
 SimpleAttribute (const H5Object &parent, const std::string &name, bool create=false)
 Constructor for opening or creating a attribute.
 SimpleAttribute (const H5Object &parent, const std::string &name, const T &data)
 Constructor for creating and writing a attribute.
void create (const H5Object &parent, const std::string &name)
void open (const H5Object &parent, const std::string &name)
 Open a attribute.
void write (const T &data)
 Write data.
T read ()
 Read data.
void write (const H5Object &parent, const std::string &name, const T &data)
 Creating and write a attribute.
T read (const H5Object &parent, const std::string &name)
 Open and read data.
template<>
void write (const string &data)
template<>
string read ()
template<>
void write (const vector< string > &data)
template<>
vector< string > read ()
template<>
void write (const vector< vector< string > > &data)
template<>
vector< vector< string > > read ()
template<>
void write (const string &data)
template<>
string read ()
template<>
void write (const vector< string > &data)
template<>
vector< string > read ()
template<>
void write (const vector< vector< string > > &data)
template<>
vector< vector< string > > read ()

Static Public Member Functions

static T getData (const H5Object &parent, const std::string &name)
static void setData (const H5Object &parent, const std::string &name, const T &data)

Detailed Description

template<class T>
class H5::SimpleAttribute< T >

A scalar, vector or matrix attribute.

A HDF5 attribute of a scalar a vector or a matrix of fixed size of type CTYPE. CTYPE can be one of the folling types.

The template type T is simple CTYPE for a scalar, std::vector<CTYPE> for a vector and std::vector<std::vector<CTYPE> > for a matrix.

A NOTE if using a vector-matrix-library: See class description of VectorSerie.


Constructor & Destructor Documentation

template<class T>
H5::SimpleAttribute< T >::SimpleAttribute ( const H5Object &  parent,
const std::string &  name,
bool  create = false 
)

Constructor for opening or creating a attribute.

For a scalar value T=CTYPE: If create is true see create(), if create is false see open()

For a vector value T=std::vector<CTYPE>: The declaration of this function is SimpleAttribute(const H5Object& parent, const std::string& name, int count=0) If count is not 0 see create(), if create is 0 see open()

For a matrix value T=std::vector<std::vector<CTYPE> >: The declaration of this function is SimpleAttribute(const H5Object& parent, const std::string& name, int rows=0, int columns=0) If rows is not 0 and column is not 0 see create(), if rows and columns is 0 see open()

template<class T>
H5::SimpleAttribute< T >::SimpleAttribute ( const H5Object &  parent,
const std::string &  name,
const T &  data 
)

Constructor for creating and writing a attribute.

See create() and write().


Member Function Documentation

template<class T>
void H5::SimpleAttribute< T >::create ( const H5Object &  parent,
const std::string &  name 
)

Creating a attribute

For a scalar value T=CTYPE: Creates a scalar attribute named name as a child of parent.

For a vector value T=std::vector<CTYPE>: The declaration of this function is void create(const H5Object& parent, const std::string& name, int count); Creates a vector attribute of size count named name as a child of parent.

For a matrix value T=std::vector<std::vector<CTYPE> >: The declaration of this function is void create(const H5Object& parent, const std::string& name, int rows, int columns); Creates a matrix attribute of size count x columns named name as a child of parent.

template<class T>
vector< vector< T > > H5::SimpleAttribute< T >::getData ( const H5Object &  parent,
const std::string &  name 
) [static]
template<class T>
void H5::SimpleAttribute< T >::open ( const H5Object &  parent,
const std::string &  name 
)

Open a attribute.

Opens the attribute named name as a child of position parent.

template<class T >
vector< vector< T > > H5::SimpleAttribute< T >::read ( )

Read data.

Read the data from the HDF5 file

Referenced by H5::SimpleAttribute< T >::getData().

template<class T>
T H5::SimpleAttribute< T >::read ( const H5Object &  parent,
const std::string &  name 
)

Open and read data.

See open() and read()

template<class T >
void H5::SimpleAttribute< T >::setData ( const H5Object &  parent,
const std::string &  name,
const T &  data 
) [static]

Static write data.

This function can be called statically. See write()

References H5::SimpleAttribute< T >::write().

template<class T >
void H5::SimpleAttribute< T >::write ( const T &  data)

Write data.

Writes the data data to the HDF5 file

Referenced by H5::SimpleAttribute< T >::setData().

template<class T>
void H5::SimpleAttribute< T >::write ( const H5Object &  parent,
const std::string &  name,
const T &  data 
)

Creating and write a attribute.

See create() and write().


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