All Classes Namespaces Functions Typedefs Enumerations Pages
Public Member Functions | Private Attributes | List of all members
H5::StructSerie< S > Class Template Reference

Serie of structs (compount datas). More...

#include <structserie.h>

Inheritance diagram for H5::StructSerie< S >:
fmatvec::Atom

Public Member Functions

 StructSerie ()
 A stub constructor. More...
 
void create (const CommonFG &parent, const std::string &name, int compression=FileSerie::getDefaultCompression(), int chunkSize=FileSerie::getDefaultChunkSize())
 Creating a dataset. More...
 
void open (const CommonFG &parent, const std::string &name)
 Open a dataset. More...
 
void setDescription (const std::string &desc)
 Sets a description for the dataset. More...
 
std::string getDescription ()
 Return the description for the dataset. More...
 
void append (const S &data)
 Append a data struct. More...
 
int getRows ()
 Returns the number of elements in the dataset.
 
unsigned int getMembers ()
 Returns the number of members in the struct.
 
getRow (const int row)
 Returns the data struct at element row. More...
 
std::vector< std::string > getMemberLabel ()
 Returns the member labels. More...
 
void extend (const hsize_t *size)
 
- Public Member Functions inherited from fmatvec::Atom
Atomoperator= (const Atom &)
 
void setMessageStreamActive (MsgType type, bool active)
 
void getMessageStream (MsgType type, boost::shared_ptr< bool > &a, boost::shared_ptr< std::ostream > &s)
 
void adoptMessageStreams (const Atom *src=NULL)
 
std::ostream & msg (MsgType type)
 
bool msgAct (MsgType type)
 

Private Attributes

CompType memDataType
 
DataSpace memDataSpace
 
hsize_t dims [1]
 
bool firstCall
 
std::vector< int > structOffset
 

Additional Inherited Members

- Public Types inherited from fmatvec::Atom
enum  MsgType
 
- Static Public Member Functions inherited from fmatvec::Atom
static void setCurrentMessageStream (MsgType type, const boost::shared_ptr< bool > &a=boost::make_shared< bool >(true), const boost::shared_ptr< std::ostream > &s=boost::make_shared< std::ostream >(std::cout.rdbuf()))
 
static std::ostream & msgStatic (MsgType type)
 
static bool msgActStatic (MsgType type)
 
- Protected Member Functions inherited from fmatvec::Atom
 Atom (const Atom &src)
 

Detailed Description

template<class S>
class H5::StructSerie< S >

Serie of structs (compount datas).

A HDF5 dataset for reading and writing a serie of structs (compount datas). The type of each data of the struct can be of:

Or a vector of fixed lenght of this type.

The data is stored as a 1D array in the HDF5 file. Each element in the array is one struct.

Constructor & Destructor Documentation

template<class S >
H5::StructSerie< S >::StructSerie ( )

A stub constructor.

Creates a empty object.

Member Function Documentation

template<class S >
void H5::StructSerie< S >::append ( const S &  data)

Append a data struct.

Appends the data struct data at the end of the dataset. The number of elements of the HDF5 array will be incremented by this operation.

template<class S >
void H5::StructSerie< S >::create ( const CommonFG &  parent,
const std::string &  name,
int  compression = FileSerie::getDefaultCompression(),
int  chunkSize = FileSerie::getDefaultChunkSize() 
)

Creating a dataset.

Creates a dataset named name as a child of position parent. By default the dataset is compressed using deflate (gzip) with compression level FileSerie::defaultCompression. Use compression to adjuste the compression level [1-9] or 0 to disable compression. NOTE that the object can not be created before the members of the struct are registered using registerMember(const S& s, const CTYPE& e, const std::string name) or registerMember(const S& s, const std::vector<CTYPE>& e, unsigned int N, const std::string name)

template<class S >
std::string H5::StructSerie< S >::getDescription ( )

Return the description for the dataset.

Returns the value of the string attribute named Description of the dataset.

template<class S >
std::vector< std::string > H5::StructSerie< S >::getMemberLabel ( )

Returns the member labels.

Returns the value of the string vector of all member labels in the dataset.

template<class S >
S H5::StructSerie< S >::getRow ( const int  row)

Returns the data struct at element row.

The first element is 0. The last avaliable element ist getRows()-1.

template<class S >
void H5::StructSerie< S >::open ( const CommonFG &  parent,
const std::string &  name 
)

Open a dataset.

Opens the dataset named name as a child of position parent. NOTE that the object can not be opened before the members of the struct are registered using registerMember(const S& s, const CTYPE& e, const std::string name) or registerMember(const S& s, const std::vector<CTYPE>& e, unsigned int N, const std::string name)

template<class S >
void H5::StructSerie< S >::setDescription ( const std::string &  desc)

Sets a description for the dataset.

The value of desc is stored as an string attribute named Description in the dataset.


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

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML