This is an auxiliary class. This class cannot be instanced.
More...
#include <abstract-reader.hpp>
|
| | AbstractReader_ (const std::size_t buffer_size, const bool use_threading) |
| | Constructor for AbstractReader_.
|
| |
| bool | read (Event &e) |
| | Read the next event.
|
| |
| bool | read (Vector &vector, const int n) |
| | Read next n events.
|
| |
| bool | read (Queue &queue, const int n, const bool keep_size=false) |
| | Read next n events.
|
| |
| bool | read_t (Vector &vector, const double t) |
| | Read the next events until the specified duration is reached.
|
| |
| bool | read_t (Queue &queue, const double t, const bool keep_size=false) |
| | Get the next events until the specified duration is reached and store them in a queue.
|
| |
| bool | skip (int n) |
| | Skip the next n events.
|
| |
| bool | skip_t (const double t) |
| | Skip events for the specified duration.
|
| |
| void | reset () |
| | Start reading from the first event.
|
| |
| virtual std::size_t | count ()=0 |
| | Count the total number of events available.
|
| |
|
|
static constexpr std::size_t | NO_BUFFER = 0 |
| |
|
static constexpr std::size_t | INF_BUFFER = std::numeric_limits<std::size_t>::max() |
| |
|
|
virtual bool | read_ (Event &e)=0 |
| |
|
virtual void | reset_ ()=0 |
| |
|
|
const std::size_t | bufferSize_ |
| |
|
std::thread | thread_ |
| |
|
Queue | buffer_ |
| |
|
std::mutex | bufferMutex_ |
| |
|
std::atomic< bool > | threadRunning_ {} |
| |
This is an auxiliary class. This class cannot be instanced.
◆ AbstractReader_()
| ev::AbstractReader_::AbstractReader_ |
( |
const std::size_t | buffer_size, |
|
|
const bool | use_threading ) |
Constructor for AbstractReader_.
- Parameters
-
| buffer_size | The size of the buffer to be used by the reader. |
◆ count()
| virtual std::size_t ev::AbstractReader_::count |
( |
| ) |
|
|
nodiscardpure virtual |
Count the total number of events available.
- Returns
- The total number of events available.
Implemented in ev::PlainTextReader.
◆ read() [1/3]
| bool ev::AbstractReader_::read |
( |
ev::Event & | e | ) |
|
Read the next event.
- Parameters
-
| e | Reference to an Event object where the next event will be stored. |
- Returns
- True if the event was successfully read, false otherwise.
◆ read() [2/3]
| bool ev::AbstractReader_::read |
( |
ev::Queue & | queue, |
|
|
const int | n, |
|
|
const bool | keep_size = false ) |
Read next n events.
- Parameters
-
| n | Number of events to get |
| queue | Event queue |
| keep_size | If true, pop one event for each insertion to maintain queue size. |
- Returns
- True if queue populated with n new events
◆ read() [3/3]
| bool ev::AbstractReader_::read |
( |
ev::Vector & | vector, |
|
|
const int | n ) |
Read next n events.
- Parameters
-
| vector | Event vector |
| n | Number of events to get |
- Returns
- True if vector populated with n new events
◆ read_t() [1/2]
| bool ev::AbstractReader_::read_t |
( |
ev::Queue & | queue, |
|
|
const double | t, |
|
|
const bool | keep_size = false ) |
Get the next events until the specified duration is reached and store them in a queue.
- Parameters
-
| t | Duration to get events for. |
| queue | Event queue to store the events. |
| keep_size | If true, pop one event for each insertion to maintain queue size. |
- Returns
- True if the queue is populated with events for the specified duration.
◆ read_t() [2/2]
| bool ev::AbstractReader_::read_t |
( |
ev::Vector & | vector, |
|
|
const double | t ) |
Read the next events until the specified duration is reached.
- Parameters
-
| vector | Event vector to store the events. |
| t | Duration to get events for. |
- Returns
- True if the vector is populated with events for the specified duration.
◆ reset()
| void ev::AbstractReader_::reset |
( |
| ) |
|
Start reading from the first event.
- Note
- The behaviour of reset should be implemented in the derived classes.
◆ skip()
| bool ev::AbstractReader_::skip |
( |
int | n | ) |
|
Skip the next n events.
- Parameters
-
| n | Number of events to skip. |
- Returns
- True if the skip was successful.
◆ skip_t()
| bool ev::AbstractReader_::skip_t |
( |
const double | t | ) |
|
Skip events for the specified duration.
- Parameters
-
| t | Duration to skip events for. |
- Returns
- True if the skip was successful.
The documentation for this class was generated from the following files: