RTC::BufferBase< DataType > Class Template Reference

BufferBase abstract class. More...

#include <BufferBase.h>

Inheritance diagram for RTC::BufferBase< DataType >:

RTC::NullBuffer< DataType > RTC::RingBuffer< DataType > RTC::SyncFIFO< DataType > RTC::SyncLIFO< DataType >

List of all members.

Public Member Functions

virtual ~BufferBase ()
 Virtual destructor.
virtual long int length () const =0
 Get the buffer length.
virtual bool write (const DataType &value)=0
 Write data into the buffer.
virtual bool read (DataType &value)=0
 Read data from the buffer.
virtual bool isFull () const =0
 Check on whether the buffer is full.
virtual bool isEmpty () const =0
 Check on whether the buffer is empty.

Protected Member Functions

virtual void put (const DataType &data)=0
 Store data into the buffer.
virtual const DataType & get ()=0
 Get data from the buffer.
virtual DataType & getRef ()=0
 Get the buffer's reference to be written the next.


Detailed Description

template<class DataType>
class RTC::BufferBase< DataType >

BufferBase abstract class.

This is the abstract interface class for various Buffer. Concrete buffer classes must implement the following pure virtual functions. The users specify data type to hold it in a buffer as <DataType>.

This class provides public interface as follows.

This class provides protected interface as follows.

Parameters:
DataType Data type to be stored to the buffer.
Since:
0.4.0

Constructor & Destructor Documentation

template<class DataType>
virtual RTC::BufferBase< DataType >::~BufferBase (  )  [inline, virtual]

Virtual destructor.


Member Function Documentation

template<class DataType>
virtual long int RTC::BufferBase< DataType >::length (  )  const [pure virtual]

Get the buffer length.

Pure virtual function to get the buffer length.

Returns:
buffer length

Implemented in RTC::NullBuffer< DataType >, RTC::RingBuffer< DataType >, RTC::SyncFIFO< DataType >, and RTC::SyncLIFO< DataType >.

template<class DataType>
virtual bool RTC::BufferBase< DataType >::write ( const DataType &  value  )  [pure virtual]

Write data into the buffer.

Pure virtual function to write data into the buffer.

Parameters:
value Target data to write.
Returns:
Result of having written in data (true:Successful, false:Failed)

Implemented in RTC::NullBuffer< DataType >, RTC::RingBuffer< DataType >, RTC::SyncFIFO< DataType >, and RTC::SyncLIFO< DataType >.

template<class DataType>
virtual bool RTC::BufferBase< DataType >::read ( DataType &  value  )  [pure virtual]

Read data from the buffer.

Pure virtual function to read data from the buffer.

Parameters:
value Read data.
Returns:
Result of having read (true:Successful, false:Failed)

Implemented in RTC::NullBuffer< DataType >, RTC::RingBuffer< DataType >, RTC::SyncFIFO< DataType >, and RTC::SyncLIFO< DataType >.

template<class DataType>
virtual bool RTC::BufferBase< DataType >::isFull (  )  const [pure virtual]

Check on whether the buffer is full.

Pure virtual function to check on whether the buffer is full.

Returns:
True if the buffer is full, else false.

Implemented in RTC::NullBuffer< DataType >, RTC::RingBuffer< DataType >, RTC::SyncFIFO< DataType >, and RTC::SyncLIFO< DataType >.

template<class DataType>
virtual bool RTC::BufferBase< DataType >::isEmpty (  )  const [pure virtual]

Check on whether the buffer is empty.

Pure virtual function to check on whether the buffer is empty.

Returns:
True if the buffer is empty, else false.

Implemented in RTC::NullBuffer< DataType >, RTC::RingBuffer< DataType >, RTC::SyncFIFO< DataType >, and RTC::SyncLIFO< DataType >.

template<class DataType>
virtual void RTC::BufferBase< DataType >::put ( const DataType &  data  )  [protected, pure virtual]

Store data into the buffer.

Pure virtual function to store data into the buffer.

Parameters:
data Target data

Implemented in RTC::NullBuffer< DataType >, RTC::RingBuffer< DataType >, RTC::SyncFIFO< DataType >, and RTC::SyncLIFO< DataType >.

template<class DataType>
virtual const DataType& RTC::BufferBase< DataType >::get (  )  [protected, pure virtual]

Get data from the buffer.

Pure virtual function to get data from the buffer.

Returns:
Data got from buffer.

Implemented in RTC::NullBuffer< DataType >, RTC::RingBuffer< DataType >, RTC::SyncFIFO< DataType >, and RTC::SyncLIFO< DataType >.

template<class DataType>
virtual DataType& RTC::BufferBase< DataType >::getRef (  )  [protected, pure virtual]

Get the buffer's reference to be written the next.

Pure virtual function to get the buffer's reference to be written the next.

Returns:
Reference to be written the next

Implemented in RTC::NullBuffer< DataType >, and RTC::RingBuffer< DataType >.


Generated on Thu May 29 15:03:33 2008 for OpenRTM by  doxygen 1.5.3