#include <RtcRingBuffer.h>
Public Member Functions | |
RingBuffer (int length) | |
RingBuffer constructor. | |
RingBuffer (int length, T inival) | |
RingBuffer constructor. | |
void | put (const T &value) |
Store given value into the RingBuffer. | |
const T & | get_new () |
Get the newset value. | |
std::vector< T > | get_new_rlist () |
Get new data to be read. | |
std::vector< T > | get_new_list () |
Get new data to be read. | |
int | new_data_len () |
Get number of new data to be read. | |
T & | get_old () |
Get the oldest value. | |
virtual T & | get_back (int pos) |
Get pos-th older value from the newest value. | |
T & | get_front (int pos) |
Get pos-th newer value from the oldest value. | |
int | buff_length () |
Get buffer length. | |
bool | is_new () |
Check the newest data is new data to be read. | |
Protected Attributes | |
ACE_Thread_Mutex | m_Mutex |
Mutex. | |
int | m_Length |
Buffer length. | |
std::vector< Data< T > > | m_Buffer |
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 new data to be read.
|
|
Get new data to be read.
|
|
Get the oldest value. Get the oldest value stored in the RingBuffer. |
|
Check the newest data is new data to be read.
|
|
Get number of new data to be read.
|
|
Store given value into the RingBuffer. Store given argument value into the RingBuffer.
|
|
|
|
Buffer length.
|
|
Mutex.
|
|
Position of newset value stored in.
|
|
Position of oldest value stored in.
|