DUECA/DUSIME
|
Functor class to write DCO objects elements to a HDF file. More...
#include <HDF5DCOWriteFunctor.hxx>
Classes | |
struct | LogDataSet |
Organize data per element. More... | |
Public Member Functions | |
virtual | ~HDF5DCOWriteFunctor () |
Destructor. | |
Public Member Functions inherited from dueca::DCOFunctor | |
DCOFunctor () | |
Constructor. | |
virtual | ~DCOFunctor () |
Destructor. | |
virtual bool | operator() (const void *dpointer, const DataTimeSpec &ts) |
function base, with const pointer (for channel reading) | |
virtual bool | operator() (void *dpointer) |
function base, updates data object | |
Protected Member Functions | |
H5::Group | createPath (const std::string &path) |
Prepare the path. | |
void | configureDataSet (unsigned idx, const std::string &name, hsize_t offset, const H5::DataType *datatype, hsize_t ncols) |
Configure a dataset. | |
void | prepareRow () |
Local function to flush/write and prepare for next present data. | |
HDF5DCOWriteFunctor (std::weak_ptr< H5::H5File > &file, const std::string &path, size_t chunksize, const std::string &label, size_t nelts, bool compress, bool writeticks, const dueca::DataTimeSpec *startend) | |
Constructor. | |
Protected Attributes | |
const dueca::DataTimeSpec * | startend |
Time span for writing. | |
bool | writeticks |
Write ticks? | |
bool | compress |
Compress dataset? | |
size_t | chunksize |
Size of each data chunk, in rows. | |
size_t | chunkidx |
Index in the chunk sets. | |
std::vector< LogDataSet > | sets |
One set per element. | |
std::string | basepath |
Base path for writing the data; under this a set of 1 + 2d vectors will be defined. | |
Functor class to write DCO objects elements to a HDF file.
Actually the name is a bit ambiguous, it reads from a channel, and then writes the data to file.
A derived class, generated for each DCO class with the option "hdf5" or "hdf5nest" set, will implement the actual interaction between the channel and the data, through two DCOFunctor::operator() overrides from the DCOFunctor class.
This middle class implements the interface on the HDF filing side.
DCO objects will be defined to HDF structures; single members will be written as 1D arrays, with each data point corresponding to a DCO in the channel. Fixed length vectors are written as 2d arrays. Variable length vectors as 1D array of vectors. The time tick is written separately
Due to this structure, DCO classes can be nested in (containers of) other DCO classes only if they are fixed-size. For this they need code generation with the hdf5nest option.