|
QtPdWidgets
2.3.4
|
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> Pd::ValueRing< T >::TimeValuePair |
| Pd::ValueRing< T >::ValueRing | ( | ) |
Constructor.
| Pd::ValueRing< T >::~ValueRing | ( | ) |
Destructor.
| void Pd::ValueRing< T >::append | ( | std::chrono::nanoseconds | time, |
| const T & | value | ||
| ) |
Appends a value to the ring.
Referenced by Pd::ValueRing< double >::copyUntil(), and Pd::ValueRing< double >::reshape().
| void Pd::ValueRing< T >::clear | ( | ) |
Clears the ring.
Referenced by Pd::ValueRing< double >::clear().
| void Pd::ValueRing< T >::copyUntil | ( | const ValueRing< T > & | other, |
| std::chrono::nanoseconds | time | ||
| ) |
Copies data from another ring, up to a specific time.
|
inline |
Referenced by Pd::Graph::Layer::fillExtrema().
|
inline |
|
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 Pd::ValueRing< T >::setRange | ( | std::chrono::nanoseconds | r | ) |
Sets the range.
|
private |
Number of valid elements at offset.
Referenced by Pd::ValueRing< double >::copyUntil().
|
private |
Ring offset.
|
private |
Time range covered by the ring.
Used to remove values from the end.
Referenced by Pd::ValueRing< double >::getRange().
|
private |
Time/Value ring.