Write the fire DataSets into a deterministic structure in the output HDF5 data file. More...
#include <Writer.h>
Public Member Functions | |
| Writer (const std::pair< std::string, std::string > &file_tree_path, bool inplace=false, int rows_per_chunk=10000, bool shuffle=true, int compression_level=6) | |
| Open the file in write mode. More... | |
| ~Writer () | |
| Close up our file, making sure to flush contents to disk. | |
| int | getRowsPerChunk () const |
| get rows per chunk | |
| void | flush () |
| Flush the data to disk. More... | |
| void | increment () |
| increment the number of entries in the HDTree | |
| const std::string & | name () const |
| Get the name of this file. | |
| void | structure (const std::string &branch_name, const std::pair< std::string, int > &type) |
| Persist the structure of the event object at the input branch_name. More... | |
| HighFive::DataSet | createDataSet (const std::string &branch_name, HighFive::DataType data_type) |
| std::size_t | entries () const |
| Get the number of entries in the file. | |
| Writer (const Writer &)=delete | |
| don't allow copies of the Writer | |
| void | operator= (const Writer &)=delete |
| don't allow copies of the Writer | |
Private Attributes | |
| HighFive::File | file_ |
| our highfive file | |
| HighFive::Group | tree_ |
| handle to the HighFive group we will make be an HDTree | |
| HighFive::DataSetCreateProps | create_props_ |
| the creation properties to be used on datasets we are writing | |
| HighFive::DataSpace | space_ |
| the dataspace shared amongst all of our datasets | |
| std::size_t | entries_ |
| the expected number of entries in this file | |
| std::size_t | rows_per_chunk_ |
| number of rows to keep in each chunk | |
Friends | |
| std::ostream & | operator<< (std::ostream &s, const Writer &w) |
| Stream this writer. More... | |
Write the fire DataSets into a deterministic structure in the output HDF5 data file.
| hdtree::Writer::Writer | ( | const std::pair< std::string, std::string > & | file_tree_path, |
| bool | inplace = false, |
||
| int | rows_per_chunk = 10000, |
||
| bool | shuffle = true, |
||
| int | compression_level = 6 |
||
| ) |
Open the file in write mode.
Our write mode is the HDF5 TRUNC (overwrite) mode.
| [in] | event_limit | Maximum number of events that could end up here |
| [in] | ps | Parameters used to configure the writing of the output file |
| void hdtree::Writer::flush | ( | ) |
Flush the data to disk.
We flush all buffers and then flush the file.
| void hdtree::Writer::structure | ( | const std::string & | branch_name, |
| const std::pair< std::string, int > & | type | ||
| ) |
Persist the structure of the event object at the input branch_name.
The "structure" is simply the type and the type's version at the correct location within the tree
| [in] | branch_name | branch_name to the group |
| [in] | {type,version} | pair demangled type name of object and its version number |
| [in] | version | version number of type |
|
friend |
Stream this writer.
We stream 'Writer' and the name of the file we are writing to
| [in] | s | ostream to stream into |
| [in] | w | writer to stream |