#include <BufferUnSync.hpp>
Public Types | |
typedef BufferBase::Options | Options |
typedef BufferInterface< T >::param_t | param_t |
typedef BufferInterface< T >::reference_t | reference_t |
typedef BufferInterface< T >::size_type | size_type |
typedef T | value_t |
Public Types inherited from RTT::base::BufferInterface< T > | |
typedef boost::call_traits< T >::param_type | param_t |
typedef boost::call_traits< T >::reference | reference_t |
typedef boost::shared_ptr< BufferInterface< T > > | shared_ptr |
typedef BufferBase::size_type | size_type |
typedef T | value_t |
Public Types inherited from RTT::base::BufferBase | |
typedef boost::shared_ptr< BufferBase > | shared_ptr |
typedef int | size_type |
Public Member Functions | |
BufferUnSync (size_type size, const Options &options=Options()) | |
BufferUnSync (size_type size, param_t initial_value, const Options &options=Options()) | |
size_type | capacity () const |
void | clear () |
virtual bool | data_sample (param_t sample, bool reset=true) |
virtual value_t | data_sample () const |
virtual size_type | dropped () const |
bool | empty () const |
bool | full () const |
FlowStatus | Pop (reference_t item) |
size_type | Pop (std::vector< value_t > &items) |
value_t * | PopWithoutRelease () |
bool | Push (param_t item) |
size_type | Push (const std::vector< value_t > &items) |
void | Release (value_t *item) |
size_type | size () const |
~BufferUnSync () | |
Public Member Functions inherited from RTT::base::BufferInterface< T > | |
virtual | ~BufferInterface () |
Public Member Functions inherited from RTT::base::BufferBase | |
virtual | ~BufferBase () |
Private Attributes | |
std::deque< value_t > | buf |
size_type | cap |
size_type | droppedSamples |
bool | initialized |
value_t | lastSample |
const bool | mcircular |
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 BufferBase::Options RTT::base::BufferUnSync< T >::Options |
Definition at line 62 of file BufferUnSync.hpp.
typedef BufferInterface<T>::param_t RTT::base::BufferUnSync< T >::param_t |
Definition at line 64 of file BufferUnSync.hpp.
typedef BufferInterface<T>::reference_t RTT::base::BufferUnSync< T >::reference_t |
Definition at line 63 of file BufferUnSync.hpp.
typedef BufferInterface<T>::size_type RTT::base::BufferUnSync< T >::size_type |
Definition at line 65 of file BufferUnSync.hpp.
typedef T RTT::base::BufferUnSync< T >::value_t |
Definition at line 66 of file BufferUnSync.hpp.
|
inline |
Create an uninitialized buffer of size size.
Definition at line 71 of file BufferUnSync.hpp.
|
inline |
Create a buffer of size size.
Definition at line 79 of file BufferUnSync.hpp.
|
inline |
Destructor
Definition at line 104 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 197 of file BufferUnSync.hpp.
|
inlinevirtual |
Clears all contents of this buffer.
Implements RTT::base::BufferBase.
Definition at line 205 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.
sample | the data sample |
reset | enforce reinitialization even if this operation clears all data. |
Implements RTT::base::BufferInterface< T >.
Definition at line 85 of file BufferUnSync.hpp.
|
inlinevirtual |
Reads back a data sample.
Implements RTT::base::BufferInterface< T >.
Definition at line 96 of file BufferUnSync.hpp.
|
inlinevirtual |
Returns the number of dropped samples, because the buffer was full
Implements RTT::base::BufferBase.
Definition at line 217 of file BufferUnSync.hpp.
|
inlinevirtual |
Check if this buffer is empty.
Implements RTT::base::BufferBase.
Definition at line 209 of file BufferUnSync.hpp.
|
inlinevirtual |
Check if this buffer is full.
Implements RTT::base::BufferBase.
Definition at line 213 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 155 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 165 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 177 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 106 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 124 of file BufferUnSync.hpp.
|
inlinevirtual |
Releases the pointer
item | pointer aquired using PopWithoutRelease() |
Implements RTT::base::BufferInterface< T >.
Definition at line 190 of file BufferUnSync.hpp.
|
inlinevirtual |
Returns the actual number of items that are stored in the buffer.
Implements RTT::base::BufferBase.
Definition at line 201 of file BufferUnSync.hpp.
|
private |
Definition at line 223 of file BufferUnSync.hpp.
|
private |
Definition at line 222 of file BufferUnSync.hpp.
|
private |
Definition at line 227 of file BufferUnSync.hpp.
|
private |
Definition at line 226 of file BufferUnSync.hpp.
|
private |
Definition at line 224 of file BufferUnSync.hpp.
|
private |
Definition at line 225 of file BufferUnSync.hpp.