|
hdf5serie
2.0.0
HDF5 Serie
|
Serie of structs (compount datas). More...
#include <structserie.h>
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. | |
| S | 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 | |
| Atom & | operator= (const Atom &) |
| void | setMessageStreamActive (MsgType type, bool activeFlag) |
| void | getMessageStream (MsgType type, std::shared_ptr< bool > &a, std::shared_ptr< std::ostream > &s) const |
| void | adoptMessageStreams (const Atom *src=nullptr) |
| std::ostream & | msg (MsgType type) const |
| bool | msgAct (MsgType type) const |
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 std::shared_ptr< bool > &a=std::make_shared< bool >(true), const std::shared_ptr< std::ostream > &s=std::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) | |
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.
| H5::StructSerie< S >::StructSerie | ( | ) |
A stub constructor.
Creates a empty object.
| 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.
| 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)
| std::string H5::StructSerie< S >::getDescription | ( | ) |
Return the description for the dataset.
Returns the value of the string attribute named Description of the dataset.
| 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.
| 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.
| 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)
| 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.