Serie of vectors. More...
#include <vectorserie.h>
Public Member Functions | |
void | setDescription (const std::string &desc) |
Sets a description for the dataset. More... | |
void | append (const T data[], size_t size) |
Append a data vector. More... | |
template<class DataType > | |
void | append (const DataType &data) |
int | getRows () |
Returns the number of rows in the dataset. | |
unsigned int | getColumns () |
Returns the number of columns(=number of data elements) in the dataset. | |
void | getRow (const int row, size_t size, T data[]) |
Returns the data vector at row row The first row is 0. The last avaliable row ist getRows()-1. data points to an array of size elements of type T. | |
template<class DataType > | |
void | getRow (const int row, DataType &data) |
std::vector< T > | getRow (const int row) |
void | getColumn (const int column, size_t size, T data[]) |
Returns the data vector at column column. More... | |
template<class DataType > | |
void | getColumn (const int column, DataType &data) |
std::vector< T > | getColumn (const int row) |
std::string | getDescription () |
Return the description for the dataset. More... | |
void | setColumnLabel (const std::vector< std::string > &columnLabel) |
std::vector< std::string > | getColumnLabel () |
Returns the column labels. More... | |
template<> | |
void | append (const string data[], size_t size) |
template<> | |
void | getRow (const int row, size_t size, string data[]) |
template<> | |
void | getColumn (const int column, size_t size, string data[]) |
![]() | |
std::vector< hsize_t > | getExtentDims () |
![]() | |
template<class T > | |
Creator< T > | createChildAttribute (const std::string &path) |
template<class T > | |
T * | openChildAttribute (const std::string &path) |
Attribute * | openChildAttribute (const std::string &name_, ElementType *objectType=NULL, hid_t *type=NULL) |
std::set< std::string > | getChildAttributeNames () |
bool | hasChildAttribute (const std::string &name_) |
GroupBase * | getParent () |
File * | getFile () |
std::string | getPath () |
![]() | |
hid_t | getID () |
Note: use the returned hid_t only temporarily since its value may change, at least when File::reopenAsSWMR is called. | |
std::string | getName () |
![]() | |
Atom & | operator= (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) |
Protected Member Functions | |
VectorSerie (int dummy, GroupBase *parent_, const std::string &name_) | |
VectorSerie (GroupBase *parent_, const std::string &name_, int cols, int compression=File::getDefaultCompression(), int chunkSize=File::getDefaultChunkSize()) | |
void | close () |
void | open () |
![]() | |
Dataset (GroupBase *parent_, const std::string &name_) | |
Dataset (int dummy, GroupBase *parent_, const std::string &name_) | |
void | refresh () |
void | flush () |
![]() | |
Object (GroupBase *parent_, const std::string &name_) | |
Object * | getFileAsObject () |
Object * | getAttrParent (const std::string &path, size_t pos) |
![]() | |
Element (const std::string &name_) | |
![]() | |
Atom (const Atom &src) | |
![]() | |
void | close () |
void | open () |
void | refresh () |
void | flush () |
Creator< T > | createChild (const std::string &name_) |
T * | openChild (const std::string &name_) |
Private Attributes | |
hid_t | memDataTypeID |
ScopedHID | memDataSpaceID |
hsize_t | dims [2] |
Friends | |
class | Container< Object, GroupBase > |
Additional Inherited Members | |
![]() | |
enum | MsgType |
![]() | |
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) |
![]() | |
GroupBase * | parent |
File * | file |
![]() | |
ScopedHID | id |
std::string | name |
![]() | |
std::map< std::string, Attribute * > | childs |
Serie of vectors.
A HDF5 dataset for reading and writing a serie of data vectors. The type of the elements of the vector (template type T) can be of:
The data is stored as a 2D array in the HDF5 file. Each row is onw data vector.
A note when using a vector-matrix-library: It is likly that the data is calculated by a vector-matrix-library. If so, and the vector object (of type T) of the library (e.g. fmatvec) has a size() member function, returning the size of the vector, and operator[](int i) returns for i=0 a reference to the first element and all other elements are store continously after the address of this element, then you can use the vector-object as parameter for append(const DataType &data).
void H5::VectorSerie< T >::append | ( | const T | data[], |
size_t | size | ||
) |
Append a data vector.
Appends the data vector data at the end of the dataset. The number of rows of the HDF5 array will be incremented by this operation.
|
inline |
Convinience append function. DataType must provide a "size_t size()" member function which returns the number of elements as well as a "T &operator[](int i)" member function which returns a reference to the i-te element. All elements must be lie in order in memory
void H5::VectorSerie< T >::getColumn | ( | const int | column, |
size_t | size, | ||
T | data[] | ||
) |
Returns the data vector at column column.
The first column is 0. The last avaliable column ist getColumns()-1.
|
inline |
Convinience getRow function. DataType must provide a "size_t size()" member function which returns the number of elements as well as a "T &operator[](int i)" member function which returns a reference to the i-te element. The elements of DataType must be of Type T and must be stored sequencially in memory.
|
inline |
Convinience getColumn function for backward compatiblity. Returns a copy in form of a std::vector<T>.
vector< string > H5::VectorSerie< T >::getColumnLabel | ( | ) |
Returns the column labels.
Return the value of the string vector attribute named Column
Label
of the dataset.
string H5::VectorSerie< T >::getDescription | ( | ) |
Return the description for the dataset.
Returns the value of the string attribute named Description
of the dataset.
|
inline |
Convinience getRow function. DataType must provide a "size_t size()" member function which returns the number of elements as well as a "T &operator[](int i)" member function which returns a reference to the i-te element. The elements of DataType must be of Type T and must be stored sequencially in memory.
|
inline |
Convinience getRow function for backward compatiblity. Returns a copy in form of a std::vector<T>.
void H5::VectorSerie< T >::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.