#include <BufferUnSync.hpp>
Public Types | |
typedef BufferInterface< T > ::param_t | param_t |
typedef BufferInterface< T > ::param_t | param_t |
typedef BufferInterface< T > ::reference_t | reference_t |
typedef BufferInterface< T > ::reference_t | reference_t |
typedef BufferInterface< T > ::size_type | size_type |
typedef BufferInterface< T > ::size_type | size_type |
typedef T | value_t |
typedef T | value_t |
Public Member Functions | |
BufferUnSync (size_type size, const T &initial_value=T()) | |
BufferUnSync (size_type size, const T &initial_value=T()) | |
size_type | capacity () const |
size_type | capacity () const |
void | clear () |
void | clear () |
virtual void | data_sample (const T &sample) |
virtual void | data_sample (const T &sample) |
bool | empty () const |
bool | empty () const |
bool | full () const |
bool | full () const |
size_type | Pop (std::vector< T > &items) |
bool | Pop (reference_t item) |
size_type | Pop (std::vector< T > &items) |
bool | Pop (reference_t item) |
value_t * | PopWithoutRelease () |
value_t * | PopWithoutRelease () |
size_type | Push (const std::vector< T > &items) |
bool | Push (param_t item) |
size_type | Push (const std::vector< T > &items) |
bool | Push (param_t item) |
void | Release (value_t *item) |
void | Release (value_t *item) |
size_type | size () const |
size_type | size () const |
~BufferUnSync () | |
~BufferUnSync () | |
Private Attributes | |
std::deque< T > | buf |
size_type | cap |
value_t | lastSample |
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 install/include/rtt/base/BufferUnSync.hpp.
typedef BufferInterface<T>::param_t RTT::base::BufferUnSync< T >::param_t |
Reimplemented from RTT::base::BufferInterface< T >.
Definition at line 63 of file rtt/base/BufferUnSync.hpp.
typedef BufferInterface<T>::param_t RTT::base::BufferUnSync< T >::param_t |
Reimplemented from RTT::base::BufferInterface< T >.
Definition at line 63 of file install/include/rtt/base/BufferUnSync.hpp.
typedef BufferInterface<T>::reference_t RTT::base::BufferUnSync< T >::reference_t |
Reimplemented from RTT::base::BufferInterface< T >.
Definition at line 62 of file rtt/base/BufferUnSync.hpp.
typedef BufferInterface<T>::reference_t RTT::base::BufferUnSync< T >::reference_t |
Reimplemented from RTT::base::BufferInterface< T >.
Definition at line 62 of file install/include/rtt/base/BufferUnSync.hpp.
typedef BufferInterface<T>::size_type RTT::base::BufferUnSync< T >::size_type |
Reimplemented from RTT::base::BufferInterface< T >.
Definition at line 64 of file rtt/base/BufferUnSync.hpp.
typedef BufferInterface<T>::size_type RTT::base::BufferUnSync< T >::size_type |
Reimplemented from RTT::base::BufferInterface< T >.
Definition at line 64 of file install/include/rtt/base/BufferUnSync.hpp.
typedef T RTT::base::BufferUnSync< T >::value_t |
Reimplemented from RTT::base::BufferInterface< T >.
Definition at line 65 of file rtt/base/BufferUnSync.hpp.
typedef T RTT::base::BufferUnSync< T >::value_t |
Reimplemented from RTT::base::BufferInterface< T >.
Definition at line 65 of file install/include/rtt/base/BufferUnSync.hpp.
RTT::base::BufferUnSync< T >::BufferUnSync | ( | size_type | size, | |
const T & | initial_value = T() | |||
) | [inline] |
Create a buffer of size size.
Definition at line 70 of file install/include/rtt/base/BufferUnSync.hpp.
RTT::base::BufferUnSync< T >::~BufferUnSync | ( | ) | [inline] |
Destructor
Definition at line 85 of file install/include/rtt/base/BufferUnSync.hpp.
RTT::base::BufferUnSync< T >::BufferUnSync | ( | size_type | size, | |
const T & | initial_value = T() | |||
) | [inline] |
Create a buffer of size size.
Definition at line 70 of file rtt/base/BufferUnSync.hpp.
RTT::base::BufferUnSync< T >::~BufferUnSync | ( | ) | [inline] |
Destructor
Definition at line 85 of file rtt/base/BufferUnSync.hpp.
size_type RTT::base::BufferUnSync< T >::capacity | ( | ) | const [inline, virtual] |
Returns the maximum number of items that can be stored in the buffer.
Implements RTT::base::BufferBase.
Definition at line 148 of file rtt/base/BufferUnSync.hpp.
size_type RTT::base::BufferUnSync< T >::capacity | ( | ) | const [inline, virtual] |
Returns the maximum number of items that can be stored in the buffer.
Implements RTT::base::BufferBase.
Definition at line 148 of file install/include/rtt/base/BufferUnSync.hpp.
void RTT::base::BufferUnSync< T >::clear | ( | ) | [inline, virtual] |
Clears all contents of this buffer.
Implements RTT::base::BufferBase.
Definition at line 156 of file rtt/base/BufferUnSync.hpp.
void RTT::base::BufferUnSync< T >::clear | ( | ) | [inline, virtual] |
Clears all contents of this buffer.
Implements RTT::base::BufferBase.
Definition at line 156 of file install/include/rtt/base/BufferUnSync.hpp.
virtual void RTT::base::BufferUnSync< T >::data_sample | ( | const T & | sample | ) | [inline, virtual] |
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 rtt/base/BufferUnSync.hpp.
virtual void RTT::base::BufferUnSync< T >::data_sample | ( | const T & | sample | ) | [inline, virtual] |
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 install/include/rtt/base/BufferUnSync.hpp.
bool RTT::base::BufferUnSync< T >::empty | ( | ) | const [inline, virtual] |
Check if this buffer is empty.
Implements RTT::base::BufferBase.
Definition at line 160 of file rtt/base/BufferUnSync.hpp.
bool RTT::base::BufferUnSync< T >::empty | ( | ) | const [inline, virtual] |
Check if this buffer is empty.
Implements RTT::base::BufferBase.
Definition at line 160 of file install/include/rtt/base/BufferUnSync.hpp.
bool RTT::base::BufferUnSync< T >::full | ( | ) | const [inline, virtual] |
Check if this buffer is full.
Implements RTT::base::BufferBase.
Definition at line 164 of file rtt/base/BufferUnSync.hpp.
bool RTT::base::BufferUnSync< T >::full | ( | ) | const [inline, virtual] |
Check if this buffer is full.
Implements RTT::base::BufferBase.
Definition at line 164 of file install/include/rtt/base/BufferUnSync.hpp.
size_type RTT::base::BufferUnSync< T >::Pop | ( | std::vector< T > & | items | ) | [inline, virtual] |
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 115 of file rtt/base/BufferUnSync.hpp.
bool RTT::base::BufferUnSync< T >::Pop | ( | reference_t | item | ) | [inline, virtual] |
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 105 of file rtt/base/BufferUnSync.hpp.
size_type RTT::base::BufferUnSync< T >::Pop | ( | std::vector< T > & | items | ) | [inline, virtual] |
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 115 of file install/include/rtt/base/BufferUnSync.hpp.
bool RTT::base::BufferUnSync< T >::Pop | ( | reference_t | item | ) | [inline, virtual] |
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 105 of file install/include/rtt/base/BufferUnSync.hpp.
value_t* RTT::base::BufferUnSync< T >::PopWithoutRelease | ( | ) | [inline, 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.
Implements RTT::base::BufferInterface< T >.
Definition at line 126 of file rtt/base/BufferUnSync.hpp.
value_t* RTT::base::BufferUnSync< T >::PopWithoutRelease | ( | ) | [inline, 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.
Implements RTT::base::BufferInterface< T >.
Definition at line 126 of file install/include/rtt/base/BufferUnSync.hpp.
size_type RTT::base::BufferUnSync< T >::Push | ( | const std::vector< T > & | items | ) | [inline, virtual] |
Write a sequence of values to the buffer.
items | the values to write |
Implements RTT::base::BufferInterface< T >.
Definition at line 96 of file rtt/base/BufferUnSync.hpp.
bool RTT::base::BufferUnSync< T >::Push | ( | param_t | item | ) | [inline, virtual] |
Write a single value to the buffer.
item | the value to write |
Implements RTT::base::BufferInterface< T >.
Definition at line 87 of file rtt/base/BufferUnSync.hpp.
size_type RTT::base::BufferUnSync< T >::Push | ( | const std::vector< T > & | items | ) | [inline, virtual] |
Write a sequence of values to the buffer.
items | the values to write |
Implements RTT::base::BufferInterface< T >.
Definition at line 96 of file install/include/rtt/base/BufferUnSync.hpp.
bool RTT::base::BufferUnSync< T >::Push | ( | param_t | item | ) | [inline, virtual] |
Write a single value to the buffer.
item | the value to write |
Implements RTT::base::BufferInterface< T >.
Definition at line 87 of file install/include/rtt/base/BufferUnSync.hpp.
void RTT::base::BufferUnSync< T >::Release | ( | value_t * | item | ) | [inline, virtual] |
Releases the pointer
item | pointer aquired using PopWithoutRelease() |
Implements RTT::base::BufferInterface< T >.
Definition at line 141 of file rtt/base/BufferUnSync.hpp.
void RTT::base::BufferUnSync< T >::Release | ( | value_t * | item | ) | [inline, virtual] |
Releases the pointer
item | pointer aquired using PopWithoutRelease() |
Implements RTT::base::BufferInterface< T >.
Definition at line 141 of file install/include/rtt/base/BufferUnSync.hpp.
size_type RTT::base::BufferUnSync< T >::size | ( | ) | const [inline, virtual] |
Returns the actual number of items that are stored in the buffer.
Implements RTT::base::BufferBase.
Definition at line 152 of file rtt/base/BufferUnSync.hpp.
size_type RTT::base::BufferUnSync< T >::size | ( | ) | const [inline, virtual] |
Returns the actual number of items that are stored in the buffer.
Implements RTT::base::BufferBase.
Definition at line 152 of file install/include/rtt/base/BufferUnSync.hpp.
std::deque< T > RTT::base::BufferUnSync< T >::buf [private] |
Definition at line 169 of file install/include/rtt/base/BufferUnSync.hpp.
size_type RTT::base::BufferUnSync< T >::cap [private] |
Definition at line 168 of file install/include/rtt/base/BufferUnSync.hpp.
value_t RTT::base::BufferUnSync< T >::lastSample [private] |
Definition at line 170 of file install/include/rtt/base/BufferUnSync.hpp.