#include <BufferBase.h>
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. |
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.
DataType | Data type to be stored to the buffer. |
virtual RTC::BufferBase< DataType >::~BufferBase | ( | ) | [inline, virtual] |
Virtual destructor.
virtual long int RTC::BufferBase< DataType >::length | ( | ) | const [pure virtual] |
Get the buffer length.
Pure virtual function to get the buffer length.
Implemented in RTC::NullBuffer< DataType >, RTC::RingBuffer< DataType >, RTC::SyncFIFO< DataType >, and RTC::SyncLIFO< 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.
value | Target data to write. |
Implemented in RTC::NullBuffer< DataType >, RTC::RingBuffer< DataType >, RTC::SyncFIFO< DataType >, and RTC::SyncLIFO< 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.
value | Read data. |
Implemented in RTC::NullBuffer< DataType >, RTC::RingBuffer< DataType >, RTC::SyncFIFO< DataType >, and RTC::SyncLIFO< 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.
Implemented in RTC::NullBuffer< DataType >, RTC::RingBuffer< DataType >, RTC::SyncFIFO< DataType >, and RTC::SyncLIFO< 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.
Implemented in RTC::NullBuffer< DataType >, RTC::RingBuffer< DataType >, RTC::SyncFIFO< DataType >, and RTC::SyncLIFO< 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.
data | Target data |
Implemented in RTC::NullBuffer< DataType >, RTC::RingBuffer< DataType >, RTC::SyncFIFO< DataType >, and RTC::SyncLIFO< 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.
Implemented in RTC::NullBuffer< DataType >, RTC::RingBuffer< DataType >, RTC::SyncFIFO< DataType >, and RTC::SyncLIFO< 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.
Implemented in RTC::NullBuffer< DataType >, and RTC::RingBuffer< DataType >.