Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

RTM::RingBuffer< T > Class Template Reference

RingBuffer template class. More...

#include <RtcRingBuffer.h>

List of all members.

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.


Detailed Description

template<class T>
class RTM::RingBuffer< T >

RingBuffer template class.

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.


Constructor & Destructor Documentation

template<class T>
RTM::RingBuffer< T >::RingBuffer int  length  )  [inline]
 

RingBuffer constructor.

RingBuffer<T> class constructor. This constructor create the buffer with "length".

Parameters:
length Buffer length

template<class T>
RTM::RingBuffer< T >::RingBuffer int  length,
inival
[inline]
 

RingBuffer constructor.

RingBuffer<T> class constructor. This constructor create the buffer with "length".

Parameters:
length Buffer length
inival Initial value


Member Function Documentation

template<class T>
int RTM::RingBuffer< T >::buff_length  )  [inline]
 

Get buffer length.

Get buffer length

template<class T>
virtual T& RTM::RingBuffer< T >::get_back int  pos  )  [inline, virtual]
 

Get pos-th older value from the newest value.

Get pos-th older value from the newset value stored in the RingBuffer.

template<class T>
T& RTM::RingBuffer< T >::get_front int  pos  )  [inline]
 

Get pos-th newer value from the oldest value.

Get pos-th newer value from the oldest value stored in the RingBuffer.

template<class T>
const T& RTM::RingBuffer< T >::get_new  )  [inline]
 

Get the newset value.

Get the newest value stored in the RingBuffer.

template<class T>
std::vector<T> RTM::RingBuffer< T >::get_new_list  )  [inline]
 

Get new data to be read.

template<class T>
std::vector<T> RTM::RingBuffer< T >::get_new_rlist  )  [inline]
 

Get new data to be read.

template<class T>
T& RTM::RingBuffer< T >::get_old  )  [inline]
 

Get the oldest value.

Get the oldest value stored in the RingBuffer.

template<class T>
bool RTM::RingBuffer< T >::is_new  )  [inline]
 

Check the newest data is new data to be read.

template<class T>
int RTM::RingBuffer< T >::new_data_len  )  [inline]
 

Get number of new data to be read.

template<class T>
void RTM::RingBuffer< T >::put const T &  value  )  [inline]
 

Store given value into the RingBuffer.

Store given argument value into the RingBuffer.

Parameters:
value Stored value


Member Data Documentation

template<class T>
std::vector<Data<T> > RTM::RingBuffer< T >::m_Buffer [protected]
 

template<class T>
int RTM::RingBuffer< T >::m_Length [protected]
 

Buffer length.

template<class T>
ACE_Thread_Mutex RTM::RingBuffer< T >::m_Mutex [protected]
 

Mutex.

template<class T>
int RTM::RingBuffer< T >::m_Newest [protected]
 

Position of newset value stored in.

template<class T>
int RTM::RingBuffer< T >::m_Oldest [protected]
 

Position of oldest value stored in.


The documentation for this class was generated from the following file:
Generated on Wed Apr 6 14:22:24 2005 for OpenRTM by doxygen 1.3.6