#include <RtcRingBuffer.h>
Public Member Functions | |
RingBuffer (int length) | |
RingBuffer constructor. | |
RingBuffer (int length, T inival) | |
RingBuffer constructor. | |
virtual void | put (const T value) |
Store given value into the RingBuffer. | |
virtual const T & | get_new () |
Get the newset value. | |
virtual T & | get_old () |
Get the oldest value. | |
virtual T & | get_back (int pos) |
Get pos-th older value from the newest value. | |
virtual T & | get_front (int pos) |
Get pos-th newer value from the oldest value. | |
virtual int | buff_length () |
Get buffer length. | |
Protected Attributes | |
ACE_Thread_Mutex | m_Mutex |
Mutex. | |
ACE_Condition< ACE_Thread_Mutex > | m_Cond |
Condition variable. | |
int | m_Length |
Buffer length. | |
vector< T > | m_Buffer |
Buffer sequence. | |
int | m_Newest |
Position of newset value stored in. | |
int | m_Oldest |
Position of oldest value stored in. |
RingBuffer template class which provides for any types variable. This ring buffer is able to have any length of buffer. You can get newest and oldest value, value in any position of buffer.
|
RingBuffer constructor. RingBuffer<T> class constructor. This constructor create the buffer with "length".
|
|
RingBuffer constructor. RingBuffer<T> class constructor. This constructor create the buffer with "length".
|
|
Get buffer length. Get buffer length |
|
Get pos-th older value from the newest value. Get pos-th older value from the newset value stored in the RingBuffer. |
|
Get pos-th newer value from the oldest value. Get pos-th newer value from the oldest value stored in the RingBuffer. |
|
Get the newset value. Get the newest value stored in the RingBuffer. |
|
Get the oldest value. Get the oldest value stored in the RingBuffer. |
|
Store given value into the RingBuffer. Store given argument value into the RingBuffer.
|
|
Buffer sequence.
|
|
Condition variable.
|
|
Buffer length.
|
|
Mutex.
|
|
Position of newset value stored in.
|
|
Position of oldest value stored in.
|