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