PdQmlWidgets  2.0.0
Public Types | Public Member Functions | List of all members
PdQmlWidgets::ValueRing< T > Class Template Reference

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
 
TimeValuePairoperator[] (unsigned int index)
 Index operator. More...
 
const TimeValuePairoperator[] (unsigned int index) const
 Constant index operator. More...
 
TimeValuePairoperator[] (int index)
 Index operator with int argument. More...
 
const TimeValuePairoperator[] (int index) const
 Constant index operator with int argument. More...
 

Detailed Description

template<class T>
class PdQmlWidgets::ValueRing< T >

Time/Value ring buffer.

Member Typedef Documentation

◆ TimeValuePair

template<class T>
typedef QPair<std::chrono::nanoseconds, T> PdQmlWidgets::ValueRing< T >::TimeValuePair

Constructor & Destructor Documentation

◆ ValueRing()

template<class T >
PdQmlWidgets::ValueRing< T >::ValueRing ( )

Constructor.

◆ ~ValueRing()

template<class T >
PdQmlWidgets::ValueRing< T >::~ValueRing ( )

Destructor.

Member Function Documentation

◆ append()

template<class T >
void PdQmlWidgets::ValueRing< T >::append ( std::chrono::nanoseconds  time,
const T &  value 
)

Appends a value to the ring.

Referenced by PdQmlWidgets::ValueRing< T >::copyUntil().

◆ clear()

template<class T >
void PdQmlWidgets::ValueRing< T >::clear ( )

Clears the ring.

◆ copyUntil()

template<class T >
void PdQmlWidgets::ValueRing< T >::copyUntil ( const ValueRing< T > &  other,
std::chrono::nanoseconds  time 
)

Copies data from another ring, up to a specific time.

References PdQmlWidgets::ValueRing< T >::append().

◆ getLength()

template<class T >
unsigned int PdQmlWidgets::ValueRing< T >::getLength ( ) const
inline
Returns
The #length.

◆ getRange()

template<class T>
std::chrono::nanoseconds PdQmlWidgets::ValueRing< T >::getRange ( ) const
inline

◆ operator[]() [1/4]

template<class T >
ValueRing< T >::TimeValuePair & PdQmlWidgets::ValueRing< T >::operator[] ( unsigned int  index)
inline

Index operator.

◆ operator[]() [2/4]

template<class T >
const ValueRing< T >::TimeValuePair & PdQmlWidgets::ValueRing< T >::operator[] ( unsigned int  index) const
inline

Constant index operator.

◆ operator[]() [3/4]

template<class T >
ValueRing< T >::TimeValuePair & PdQmlWidgets::ValueRing< T >::operator[] ( int  index)
inline

Index operator with int argument.

Allows to specify negative indices (from the end).

◆ operator[]() [4/4]

template<class T >
const ValueRing< T >::TimeValuePair & PdQmlWidgets::ValueRing< T >::operator[] ( int  index) const
inline

Constant index operator with int argument.

Allows to specify negative indices (from the end).

◆ setRange()

template<class T >
void PdQmlWidgets::ValueRing< T >::setRange ( std::chrono::nanoseconds  r)

Sets the #range.


The documentation for this class was generated from the following file: