All Classes Namespaces Functions Typedefs Enumerations Pages
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
H5::VectorSerie< T > Class Template Reference

Serie of vectors. More...

#include <vectorserie.h>

Inheritance diagram for H5::VectorSerie< T >:
H5::Dataset H5::Object H5::Element H5::Container< Attribute, Object > fmatvec::Atom

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[])
 
- Public Member Functions inherited from H5::Dataset
std::vector< hsize_t > getExtentDims ()
 
- Public Member Functions inherited from H5::Object
template<class T >
Creator< T > createChildAttribute (const std::string &path)
 
template<class T >
T * openChildAttribute (const std::string &path)
 
AttributeopenChildAttribute (const std::string &name_, ElementType *objectType=NULL, hid_t *type=NULL)
 
std::set< std::string > getChildAttributeNames ()
 
bool hasChildAttribute (const std::string &name_)
 
GroupBasegetParent ()
 
FilegetFile ()
 
std::string getPath ()
 
- Public Member Functions inherited from H5::Element
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 ()
 
- 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)
 

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 ()
 
- Protected Member Functions inherited from H5::Dataset
 Dataset (GroupBase *parent_, const std::string &name_)
 
 Dataset (int dummy, GroupBase *parent_, const std::string &name_)
 
void refresh ()
 
void flush ()
 
- Protected Member Functions inherited from H5::Object
 Object (GroupBase *parent_, const std::string &name_)
 
ObjectgetFileAsObject ()
 
ObjectgetAttrParent (const std::string &path, size_t pos)
 
- Protected Member Functions inherited from H5::Element
 Element (const std::string &name_)
 
- Protected Member Functions inherited from fmatvec::Atom
 Atom (const Atom &src)
 
- Protected Member Functions inherited from H5::Container< Attribute, Object >
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

- 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 Attributes inherited from H5::Object
GroupBaseparent
 
Filefile
 
- Protected Attributes inherited from H5::Element
ScopedHID id
 
std::string name
 
- Protected Attributes inherited from H5::Container< Attribute, Object >
std::map< std::string,
Attribute * > 
childs
 

Detailed Description

template<class T>
class H5::VectorSerie< T >

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

Member Function Documentation

template<class T >
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.

template<class T >
template<class DataType >
void H5::VectorSerie< T >::append ( const DataType &  data)
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

template<class T >
void H5::VectorSerie< T >::getColumn ( const int  column,
size_t  size,
data[] 
)

Returns the data vector at column column.

The first column is 0. The last avaliable column ist getColumns()-1.

template<class T >
template<class DataType >
void H5::VectorSerie< T >::getColumn ( const int  column,
DataType &  data 
)
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.

template<class T >
std::vector<T> H5::VectorSerie< T >::getColumn ( const int  row)
inline

Convinience getColumn function for backward compatiblity. Returns a copy in form of a std::vector<T>.

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

template<class T >
string H5::VectorSerie< T >::getDescription ( )

Return the description for the dataset.

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

template<class T >
template<class DataType >
void H5::VectorSerie< T >::getRow ( const int  row,
DataType &  data 
)
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.

template<class T >
std::vector<T> H5::VectorSerie< T >::getRow ( const int  row)
inline

Convinience getRow function for backward compatiblity. Returns a copy in form of a std::vector<T>.

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


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

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML