Thread-safe reader for parallel event processing.
More...
#include <reader.h>
Thread-safe reader for parallel event processing.
Wraps a hipo::reader with a mutex to allow multiple threads to pull events concurrently. Events are distributed in batches via the pull() method.
Definition at line 403 of file reader.h.
◆ readerstream()
| hipo::readerstream::readerstream |
( |
| ) |
|
|
inline |
◆ ~readerstream()
| virtual hipo::readerstream::~readerstream |
( |
| ) |
|
|
inlinevirtual |
◆ dictionary()
- Returns
- Reference to the dictionary read from the file.
Definition at line 450 of file reader.h.
◆ open()
| void hipo::readerstream::open |
( |
const char * |
input | ) |
|
|
inline |
Open a HIPO file for multi-threaded reading.
- Parameters
-
| input | Path to the HIPO file |
Definition at line 421 of file reader.h.
◆ pull() [1/2]
| void hipo::readerstream::pull |
( |
hipo::record & |
record, |
|
|
int |
index |
|
) |
| |
|
inline |
Thread-safe loading of a record by index.
- Parameters
-
| record | Output record object |
| index | Record index |
Definition at line 455 of file reader.h.
◆ pull() [2/2]
| void hipo::readerstream::pull |
( |
std::vector< hipo::event > & |
events | ) |
|
|
inline |
Thread-safe batch pull: resets each event in the vector, reads next events, and refills.
- Parameters
-
| events | Vector of events to refill from the file |
Definition at line 462 of file reader.h.
◆ reader()
- Returns
- Reference to the underlying reader.
Definition at line 448 of file reader.h.
◆ run()
| void hipo::readerstream::run |
( |
std::function< int(int)> && |
function, |
|
|
int |
nthreads |
|
) |
| |
|
inline |
Launch worker threads that execute the given function.
- Parameters
-
| function | Worker function taking a thread ID and returning an int |
| nthreads | Number of threads to create |
Definition at line 437 of file reader.h.
◆ setLimit()
| void hipo::readerstream::setLimit |
( |
long |
limit | ) |
|
|
inline |
Set a limit on the number of events to process.
- Parameters
-
| limit | Maximum events (-1 for unlimited) |
Definition at line 430 of file reader.h.
The documentation for this class was generated from the following file: