Orocos Real-Time Toolkit
2.5.0
|
A Buffer is an object which is used to store (Push) and retrieve (Pop) values from. More...
#include <rtt/base/BufferInterface.hpp>
Public Types | |
typedef T | value_t |
typedef BufferBase::size_type | size_type |
typedef boost::shared_ptr < BufferInterface< T > > | shared_ptr |
typedef boost::call_traits< T > ::param_type | param_t |
typedef boost::call_traits< T > ::reference | reference_t |
Public Member Functions | |
virtual bool | Pop (reference_t item)=0 |
Read the oldest value from the buffer. | |
virtual size_type | Pop (std::vector< value_t > &items)=0 |
Read the whole buffer. | |
virtual value_t * | PopWithoutRelease ()=0 |
Returns a pointer to the first element in the buffer. | |
virtual void | Release (value_t *item)=0 |
Releases the pointer. | |
virtual bool | Push (param_t item)=0 |
Write a single value to the buffer. | |
virtual size_type | Push (const std::vector< value_t > &items)=0 |
Write a sequence of values to the buffer. | |
virtual void | data_sample (const T &sample)=0 |
Initializes this buffer with a data sample, such that for dynamical allocated types T, the buffer can reserve place to hold these elements. | |
virtual size_type | capacity () const =0 |
Returns the maximum number of items that can be stored in the buffer. | |
virtual size_type | size () const =0 |
Returns the actual number of items that are stored in the buffer. | |
virtual bool | empty () const =0 |
Check if this buffer is empty. | |
virtual bool | full () const =0 |
Check if this buffer is full. | |
virtual void | clear ()=0 |
Clears all contents of this buffer. |
A Buffer is an object which is used to store (Push) and retrieve (Pop) values from.
T | The value type stored in this buffer. |
Definition at line 55 of file BufferInterface.hpp.
virtual size_type RTT::base::BufferBase::capacity | ( | ) | const [pure virtual, inherited] |
Returns the maximum number of items that can be stored in the buffer.
Implemented in RTT::base::BufferLocked< T >, RTT::base::BufferUnSync< T >, and RTT::base::BufferLockFree< T >.
virtual void RTT::base::BufferBase::clear | ( | ) | [pure virtual, inherited] |
Clears all contents of this buffer.
Implemented in RTT::base::BufferLocked< T >, RTT::base::BufferUnSync< T >, and RTT::base::BufferLockFree< T >.
Referenced by RTT::internal::ChannelBufferElement< T >::clear().
virtual void RTT::base::BufferInterface< T >::data_sample | ( | const T & | sample | ) | [pure virtual] |
Initializes this buffer with a data sample, such that for dynamical allocated types T, the buffer can reserve place to hold these elements.
Implemented in RTT::base::BufferLockFree< T >, RTT::base::BufferLocked< T >, and RTT::base::BufferUnSync< T >.
Referenced by RTT::internal::ChannelBufferElement< T >::data_sample().
virtual bool RTT::base::BufferBase::empty | ( | ) | const [pure virtual, inherited] |
Check if this buffer is empty.
Implemented in RTT::base::BufferLocked< T >, RTT::base::BufferUnSync< T >, and RTT::base::BufferLockFree< T >.
virtual bool RTT::base::BufferBase::full | ( | ) | const [pure virtual, inherited] |
Check if this buffer is full.
Implemented in RTT::base::BufferLocked< T >, RTT::base::BufferUnSync< T >, and RTT::base::BufferLockFree< T >.
virtual bool RTT::base::BufferInterface< T >::Pop | ( | reference_t | item | ) | [pure virtual] |
Read the oldest value from the buffer.
item | is to be set with a value from the buffer. |
Implemented in RTT::base::BufferLockFree< T >, RTT::base::BufferLocked< T >, and RTT::base::BufferUnSync< T >.
virtual size_type RTT::base::BufferInterface< T >::Pop | ( | std::vector< value_t > & | items | ) | [pure virtual] |
Read the whole buffer.
items | is to be filled with all values in the buffer, with items.begin() the oldest value. |
Implemented in RTT::base::BufferLockFree< T >, RTT::base::BufferLocked< T >, and RTT::base::BufferUnSync< T >.
virtual value_t* RTT::base::BufferInterface< T >::PopWithoutRelease | ( | ) | [pure virtual] |
Returns a pointer to the first element in the buffer.
The pointer is only garanteed to stay valid until the next pop operation.
Note the pointer needs the be released by calling Release on the buffer.
Implemented in RTT::base::BufferLockFree< T >, RTT::base::BufferLocked< T >, and RTT::base::BufferUnSync< T >.
Referenced by RTT::internal::ChannelBufferElement< T >::read().
virtual bool RTT::base::BufferInterface< T >::Push | ( | param_t | item | ) | [pure virtual] |
Write a single value to the buffer.
item | the value to write |
Implemented in RTT::base::BufferLockFree< T >, RTT::base::BufferLocked< T >, and RTT::base::BufferUnSync< T >.
Referenced by RTT::internal::ChannelBufferElement< T >::write().
virtual size_type RTT::base::BufferInterface< T >::Push | ( | const std::vector< value_t > & | items | ) | [pure virtual] |
Write a sequence of values to the buffer.
items | the values to write |
Implemented in RTT::base::BufferLockFree< T >, RTT::base::BufferLocked< T >, and RTT::base::BufferUnSync< T >.
virtual void RTT::base::BufferInterface< T >::Release | ( | value_t * | item | ) | [pure virtual] |
Releases the pointer.
item | pointer aquired using PopWithoutRelease() |
Implemented in RTT::base::BufferLockFree< T >, RTT::base::BufferLocked< T >, and RTT::base::BufferUnSync< T >.
Referenced by RTT::internal::ChannelBufferElement< T >::clear(), and RTT::internal::ChannelBufferElement< T >::read().
virtual size_type RTT::base::BufferBase::size | ( | ) | const [pure virtual, inherited] |
Returns the actual number of items that are stored in the buffer.
Implemented in RTT::base::BufferLocked< T >, RTT::base::BufferUnSync< T >, and RTT::base::BufferLockFree< T >.