|
HIPO
4.3.0
High Performance Output data format for experimental physics
|
Writer for creating HIPO files. More...
#include <writer.h>
Public Member Functions | |
| writer () | |
| virtual | ~writer () |
| void | addEvent (hipo::event &hevent) |
| Add an event to the current record buffer. More... | |
| void | addEvent (std::vector< char > &vec, int size=-1) |
| Add raw event data from a byte vector. More... | |
| void | addUserConfig (std::string key, std::string value) |
| Add a user configuration key-value pair to the file header. More... | |
| void | addUserConfig (const char *key, const char *value) |
| Add a user configuration key-value pair to the file header (C-string overload). More... | |
| void | writeRecord (recordbuilder &builder) |
| Write a completed record to the output file. More... | |
| void | open (const char *filename) |
| Open a file for writing. More... | |
| void | close () |
| Close the file, flushing remaining events and writing the trailer. More... | |
| void | showSummary () |
| Print a summary of records written to stdout. More... | |
| void | addDictionary (hipo::dictionary &dict) |
| Set the dictionary to be written into the file header. More... | |
| hipo::dictionary & | getDictionary () |
| void | setUserIntegerOne (long userIntOne) |
| Set the first user-defined integer in the file header. More... | |
| void | setUserIntegerTwo (long userIntTwo) |
| Set the second user-defined integer in the file header. More... | |
| void | flush () |
| Flush the current record buffer to disk. More... | |
| void | setVerbose (int level) |
| Set the verbosity level for output messages. More... | |
Writer for creating HIPO files.
Events are buffered in records and automatically flushed to disk. A dictionary of schemas must be added before opening the file.
| void hipo::writer::addDictionary | ( | hipo::dictionary & | dict | ) |
Set the dictionary to be written into the file header.
| dict | Dictionary containing schema definitions |
Definition at line 123 of file writer.cpp.
| void hipo::writer::addEvent | ( | hipo::event & | hevent | ) |
Add an event to the current record buffer.
| hevent | Event to add |
Definition at line 130 of file writer.cpp.
| void hipo::writer::addEvent | ( | std::vector< char > & | vec, |
| int | size = -1 |
||
| ) |
Add raw event data from a byte vector.
| vec | Raw event buffer |
| size | Number of bytes to use (-1 for entire vector) |
Definition at line 148 of file writer.cpp.
|
inline |
|
inline |
| void hipo::writer::close | ( | ) |
Close the file, flushing remaining events and writing the trailer.
Definition at line 216 of file writer.cpp.
| void hipo::writer::flush | ( | ) |
Flush the current record buffer to disk.
Definition at line 246 of file writer.cpp.
|
inline |
| void hipo::writer::open | ( | const char * | filename | ) |
Open a file for writing.
| filename | Path to the output file |
Open a File for writing, it includes the dictionary in the file.
Definition at line 45 of file writer.cpp.
| void hipo::writer::setUserIntegerOne | ( | long | userIntOne | ) |
Set the first user-defined integer in the file header.
Definition at line 232 of file writer.cpp.
| void hipo::writer::setUserIntegerTwo | ( | long | userIntTwo | ) |
Set the second user-defined integer in the file header.
Definition at line 239 of file writer.cpp.
|
inline |
| void hipo::writer::showSummary | ( | ) |
Print a summary of records written to stdout.
Definition at line 178 of file writer.cpp.
| void hipo::writer::writeRecord | ( | recordbuilder & | builder | ) |
Write a completed record to the output file.
| builder | Record builder containing the record data |
Definition at line 158 of file writer.cpp.