Orocos Real-Time Toolkit
2.8.3
|
Implements a not threadsafe buffer. More...
#include <rtt/base/BufferUnSync.hpp>
Public Types | |
typedef BufferInterface< T >::reference_t | reference_t |
typedef BufferInterface< T >::param_t | param_t |
typedef BufferInterface< T >::size_type | size_type |
typedef T | value_t |
typedef boost::shared_ptr< BufferInterface< T > > | shared_ptr |
Public Member Functions | |
BufferUnSync (size_type size, const T &initial_value=T(), bool circular=false) | |
Create a buffer of size size. More... | |
virtual void | data_sample (const T &sample) |
Initializes this buffer with a data sample, such that for dynamical allocated types T, the buffer can reserve place to hold these elements. More... | |
virtual T | data_sample () const |
Reads back a data sample. More... | |
~BufferUnSync () | |
Destructor. More... | |
bool | Push (param_t item) |
Write a single value to the buffer. More... | |
size_type | Push (const std::vector< T > &items) |
Write a sequence of values to the buffer. More... | |
bool | Pop (reference_t item) |
Read the oldest value from the buffer. More... | |
size_type | Pop (std::vector< T > &items) |
Read the whole buffer. More... | |
value_t * | PopWithoutRelease () |
Returns a pointer to the first element in the buffer. More... | |
void | Release (value_t *item) |
Releases the pointer. More... | |
size_type | capacity () const |
Returns the maximum number of items that can be stored in the buffer. More... | |
size_type | size () const |
Returns the actual number of items that are stored in the buffer. More... | |
void | clear () |
Clears all contents of this buffer. More... | |
bool | empty () const |
Check if this buffer is empty. More... | |
bool | full () const |
Check if this buffer is full. More... | |
virtual size_type | dropped () const |
Returns the number of dropped samples, because the buffer was full. More... | |
Implements a not threadsafe buffer.
Only use when no more than one thread accesses this buffer at a time.
Definition at line 58 of file BufferUnSync.hpp.
typedef BufferInterface<T>::param_t RTT::base::BufferUnSync< T >::param_t |
Definition at line 63 of file BufferUnSync.hpp.
typedef BufferInterface<T>::reference_t RTT::base::BufferUnSync< T >::reference_t |
Definition at line 62 of file BufferUnSync.hpp.
|
inherited |
Definition at line 62 of file BufferInterface.hpp.
typedef BufferInterface<T>::size_type RTT::base::BufferUnSync< T >::size_type |
Definition at line 64 of file BufferUnSync.hpp.
typedef T RTT::base::BufferUnSync< T >::value_t |
Definition at line 65 of file BufferUnSync.hpp.
|
inline |
Create a buffer of size size.
Definition at line 70 of file BufferUnSync.hpp.
References RTT::base::BufferUnSync< T >::data_sample().
|
inline |
Destructor.
Definition at line 90 of file BufferUnSync.hpp.
|
inlinevirtual |
Returns the maximum number of items that can be stored in the buffer.
Implements RTT::base::BufferBase.
Definition at line 185 of file BufferUnSync.hpp.
|
inlinevirtual |
Clears all contents of this buffer.
Implements RTT::base::BufferBase.
Definition at line 193 of file BufferUnSync.hpp.
|
inlinevirtual |
Initializes this buffer with a data sample, such that for dynamical allocated types T, the buffer can reserve place to hold these elements.
Implements RTT::base::BufferInterface< T >.
Definition at line 76 of file BufferUnSync.hpp.
|
inlinevirtual |
Reads back a data sample.
Implements RTT::base::BufferInterface< T >.
Definition at line 82 of file BufferUnSync.hpp.
Referenced by RTT::base::BufferUnSync< T >::BufferUnSync().
|
inlinevirtual |
Returns the number of dropped samples, because the buffer was full.
Implements RTT::base::BufferBase.
Definition at line 205 of file BufferUnSync.hpp.
|
inlinevirtual |
Check if this buffer is empty.
Implements RTT::base::BufferBase.
Definition at line 197 of file BufferUnSync.hpp.
|
inlinevirtual |
Check if this buffer is full.
Implements RTT::base::BufferBase.
Definition at line 201 of file BufferUnSync.hpp.
|
inlinevirtual |
Read the oldest value from the buffer.
item | is to be set with a value from the buffer. |
Implements RTT::base::BufferInterface< T >.
Definition at line 141 of file BufferUnSync.hpp.
|
inlinevirtual |
Read the whole buffer.
items | is to be filled with all values in the buffer, with items.begin() the oldest value. |
Implements RTT::base::BufferInterface< T >.
Definition at line 151 of file BufferUnSync.hpp.
|
inlinevirtual |
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.
Implements RTT::base::BufferInterface< T >.
Definition at line 163 of file BufferUnSync.hpp.
|
inlinevirtual |
Write a single value to the buffer.
item | the value to write |
Implements RTT::base::BufferInterface< T >.
Definition at line 92 of file BufferUnSync.hpp.
|
inlinevirtual |
Write a sequence of values to the buffer.
items | the values to write |
Implements RTT::base::BufferInterface< T >.
Definition at line 110 of file BufferUnSync.hpp.
|
inlinevirtual |
Releases the pointer.
item | pointer aquired using PopWithoutRelease() |
Implements RTT::base::BufferInterface< T >.
Definition at line 178 of file BufferUnSync.hpp.
|
inlinevirtual |
Returns the actual number of items that are stored in the buffer.
Implements RTT::base::BufferBase.
Definition at line 189 of file BufferUnSync.hpp.