|
HIPO
4.3.0
High Performance Output data format for experimental physics
|
Represents a single HIPO record containing multiple events. More...
#include <record.h>
Public Member Functions | |
| record () | |
| Construct an empty record. More... | |
| ~record () | |
| Destructor. More... | |
| void | read (hipo::bank &b, int event) |
| Read a specific bank from a given event in this record. More... | |
| void | readRecord (std::ifstream &stream, long position, int dataOffset) |
| Read a record from a file stream at the specified position. More... | |
| void | readRecord__ (std::ifstream &stream, long position, long recordLength) |
| Read a record using its total length (internal variant). More... | |
| bool | readRecord (std::ifstream &stream, long position, int dataOffset, long inputSize) |
| Read a record with an explicit input-size boundary check. More... | |
| int | getEventCount () |
| Return the number of events stored in this record. More... | |
| int | getRecordSizeCompressed () |
| Return the compressed size of this record in bytes. More... | |
| void | getColumn (hipo::data &data, int column, hipo::bank &bank, int event) |
| Extract a single column from a bank for a given event. More... | |
| void | getColumn (hipo::data &data, const char *column, hipo::bank &bank, int event) |
| Extract a single column by name from a bank for a given event. More... | |
| void | readEvent (std::vector< char > &vec, int index) |
| Read raw event bytes into a vector. More... | |
| void | readHipoEvent (hipo::event &event, int index) |
| Read an event and populate a hipo::event object. More... | |
| void | getData (hipo::data &data, int index) |
| Get a lightweight data handle for a specific event. More... | |
| void | getEventsMap (std::vector< std::pair< int, int >> &emap) |
| Build a map of event positions (offset, length pairs). More... | |
| hipo::benchmark & | getReadBenchmark () |
| Return a reference to the read-operation benchmark. More... | |
| hipo::benchmark & | getUnzipBenchmark () |
| Return a reference to the decompression benchmark. More... | |
| hipo::benchmark & | getIndexBenchmark () |
| Return a reference to the index-building benchmark. More... | |
Represents a single HIPO record containing multiple events.
Handles reading a record from a file stream, decompressing its payload, and providing access to individual events stored within it.
|
default |
Construct an empty record.
|
default |
Destructor.
| void hipo::record::getColumn | ( | hipo::data & | data, |
| const char * | column, | ||
| hipo::bank & | bank, | ||
| int | event | ||
| ) |
Extract a single column by name from a bank for a given event.
| data | Output data object to populate. |
| column | Column name. |
| bank | Bank from which to extract the column. |
| event | Zero-based event index. |
Definition at line 430 of file record.cpp.
| void hipo::record::getColumn | ( | hipo::data & | data, |
| int | column, | ||
| hipo::bank & | bank, | ||
| int | event | ||
| ) |
Extract a single column from a bank for a given event.
| data | Output data object to populate. |
| column | Zero-based column index. |
| bank | Bank from which to extract the column. |
| event | Zero-based event index. |
Definition at line 435 of file record.cpp.
| void hipo::record::getData | ( | hipo::data & | data, |
| int | index | ||
| ) |
Get a lightweight data handle for a specific event.
| data | Output data object pointing into the record buffer. |
| index | Zero-based event index within the record. |
returns a data object that points to the event inside of the record. For given index the data object will be filled with the pointer to the position in the buffer where the event starts and with the size indicating length of the event.
Definition at line 411 of file record.cpp.
| int hipo::record::getEventCount | ( | ) |
Return the number of events stored in this record.
returns number of events in the record.
Definition at line 393 of file record.cpp.
| void hipo::record::getEventsMap | ( | std::vector< std::pair< int, int >> & | emap | ) |
Build a map of event positions (offset, length pairs).
| emap | Output vector of (offset, length) pairs for each event. |
Definition at line 463 of file record.cpp.
|
inline |
|
inline |
| int hipo::record::getRecordSizeCompressed | ( | ) |
Return the compressed size of this record in bytes.
Definition at line 279 of file record.cpp.
|
inline |
| void hipo::record::read | ( | hipo::bank & | b, |
| int | event | ||
| ) |
Read a specific bank from a given event in this record.
| b | Bank to populate with the read data. |
| event | Zero-based event index within the record. |
Definition at line 424 of file record.cpp.
| void hipo::record::readEvent | ( | std::vector< char > & | vec, |
| int | index | ||
| ) |
Read raw event bytes into a vector.
| vec | Output vector to fill with event data. |
| index | Zero-based event index within the record. |
reads content of the event with given index into a vector vector will be resized to fit the data. The resulting size of the vector can be used to veryfy the successfull read.
Definition at line 401 of file record.cpp.
| void hipo::record::readHipoEvent | ( | hipo::event & | event, |
| int | index | ||
| ) |
Read an event and populate a hipo::event object.
| event | Output event to populate. |
| index | Zero-based event index within the record. |
Definition at line 485 of file record.cpp.
| void hipo::record::readRecord | ( | std::ifstream & | stream, |
| long | position, | ||
| int | dataOffset | ||
| ) |
Read a record from a file stream at the specified position.
| stream | Input file stream. |
| position | Byte offset in the file where the record starts. |
| dataOffset | Offset to the data section within the record. |
Read
converting index array from lengths of each buffer in the record to relative positions in the record stream.
Definition at line 61 of file record.cpp.
| bool hipo::record::readRecord | ( | std::ifstream & | stream, |
| long | position, | ||
| int | dataOffset, | ||
| long | inputSize | ||
| ) |
Read a record with an explicit input-size boundary check.
| stream | Input file stream. |
| position | Byte offset in the file. |
| dataOffset | Offset to the data section within the record. |
| inputSize | Maximum number of bytes available for reading. |
converting index array from lengths of each buffer in the record to relative positions in the record stream.
Definition at line 164 of file record.cpp.
| void hipo::record::readRecord__ | ( | std::ifstream & | stream, |
| long | position, | ||
| long | recordLength | ||
| ) |
Read a record using its total length (internal variant).
| stream | Input file stream. |
| position | Byte offset in the file. |
| recordLength | Total length of the record in bytes. |
converting index array from lengths of each buffer in the record to relative positions in the record stream.
Definition at line 283 of file record.cpp.