libvisiontransfer
10.8.0
|
Thread-safe ring buffer for timestamped generic sensor data. RecordType needs to implement getTimestamp() in order to perform comparisons in popBetweenTimes() (= obtain data series in interval).
Maximum capacity of the buffer is RINGBUFFER_SIZE-1. lostSamples() tallies the number of samples silently lost due to buffer overruns, and is reset by any of the pop...() methods.
Definition at line 42 of file sensorringbuffer.h.
#include <visiontransfer/internal/sensorringbuffer.h>
Public Member Functions | |
constexpr unsigned int | ringbufferSize () const |
constexpr int | capacity () const |
int | size () const |
int | samplesLost () const |
bool | isFull () const |
bool | isEmpty () const |
bool | advanceWritePosition () |
bool | pushData (const std::vector< RecordType > &data) |
bool | pushData (const RecordType &data) |
bool | pushData (RecordType &&data) |
std::vector< RecordType > | popAllData () |
std::vector< RecordType > | popBetweenTimes (int fromSec=0, int fromUSec=0, int untilSec=0x7fffFFFFl, int untilUSec=0x7fffFFFFl) |
Pop and return the data between timestamps (or the whole ring buffer contents if not provided) More... | |
|
inline |
Pop and return the data between timestamps (or the whole ring buffer contents if not provided)
Definition at line 107 of file sensorringbuffer.h.