QtPdCom
1.4.1
|
Time/Value ring buffer. More...
#include <ValueRing.h>
Public Types | |
typedef QPair< std::chrono::nanoseconds, T > | TimeValuePair |
Public Member Functions | |
ValueRing () | |
Constructor. More... | |
~ValueRing () | |
Destructor. More... | |
void | setRange (std::chrono::nanoseconds) |
Sets the range. More... | |
std::chrono::nanoseconds | getRange () const |
void | append (std::chrono::nanoseconds time, const T &value) |
Appends a value to the ring. More... | |
void | copyUntil (const ValueRing< T > &, std::chrono::nanoseconds) |
Copies data from another ring, up to a specific time. More... | |
void | clear () |
Clears the ring. More... | |
unsigned int | getLength () const |
TimeValuePair & | operator[] (unsigned int index) |
Index operator. More... | |
const TimeValuePair & | operator[] (unsigned int index) const |
Constant index operator. More... | |
TimeValuePair & | operator[] (int index) |
Index operator with int argument. More... | |
const TimeValuePair & | operator[] (int index) const |
Constant index operator with int argument. More... | |
Private Member Functions | |
void | removeDeprecated () |
Remove values that exceed the time range. More... | |
void | reshape () |
Reshape the ring to move the offset to zero. More... | |
Private Attributes | |
QList< TimeValuePair > | ring |
Time/Value ring. More... | |
unsigned int | offset |
Ring offset. More... | |
unsigned int | length |
Number of valid elements at offset. More... | |
std::chrono::nanoseconds | range |
Time range covered by the ring. More... | |
Time/Value ring buffer.
typedef QPair<std::chrono::nanoseconds, T> QtPdCom::ValueRing< T >::TimeValuePair |
QtPdCom::ValueRing< T >::ValueRing | ( | ) |
Constructor.
QtPdCom::ValueRing< T >::~ValueRing | ( | ) |
Destructor.
void QtPdCom::ValueRing< T >::append | ( | std::chrono::nanoseconds | time, |
const T & | value | ||
) |
Appends a value to the ring.
Referenced by QtPdCom::ValueRing< T >::copyUntil().
void QtPdCom::ValueRing< T >::clear | ( | ) |
Clears the ring.
void QtPdCom::ValueRing< T >::copyUntil | ( | const ValueRing< T > & | other, |
std::chrono::nanoseconds | time | ||
) |
Copies data from another ring, up to a specific time.
References QtPdCom::ValueRing< T >::append(), and QtPdCom::ValueRing< T >::length.
|
inline |
|
inline |
References QtPdCom::ValueRing< T >::range.
|
inline |
Index operator.
|
inline |
Constant index operator.
|
inline |
Index operator with int argument.
Allows to specify negative indices (from the end).
|
inline |
Constant index operator with int argument.
Allows to specify negative indices (from the end).
|
private |
Remove values that exceed the time range.
|
private |
Reshape the ring to move the offset to zero.
void QtPdCom::ValueRing< T >::setRange | ( | std::chrono::nanoseconds | r | ) |
Sets the range.
|
private |
Number of valid elements at offset.
Referenced by QtPdCom::ValueRing< T >::copyUntil().
|
private |
Ring offset.
|
private |
Time range covered by the ring.
Used to remove values from the end.
Referenced by QtPdCom::ValueRing< T >::getRange().
|
private |
Time/Value ring.