#include <LockedQueue.hpp>
Public Types | |
typedef unsigned int | size_type |
typedef T | value_t |
Public Member Functions | |
value_t | back () const |
size_type | capacity () const |
void | clear () |
bool | dequeue (T &result) |
bool | enqueue (const T &value) |
value_t | front () const |
bool | isEmpty () const |
bool | isFull () const |
LockedQueue (unsigned int lsize) | |
size_type | size () const |
~LockedQueue () | |
Private Types | |
typedef std::deque< value_t > | BufferType |
typedef BufferType::const_iterator | CIterator |
typedef BufferType::iterator | Iterator |
Private Attributes | |
unsigned int | cap |
BufferType | data |
os::Mutex | lock |
A lock-based queue implementation to enqueue or dequeue a pointer of type T. No memory allocation is done during read or write.
T | The pointer type to be stored in the queue. Example : LockedQueue<A*> is a queue which holds values of type A. |
Definition at line 58 of file LockedQueue.hpp.
typedef std::deque<value_t> RTT::internal::LockedQueue< T >::BufferType [private] |
Definition at line 63 of file LockedQueue.hpp.
typedef BufferType::const_iterator RTT::internal::LockedQueue< T >::CIterator [private] |
Definition at line 65 of file LockedQueue.hpp.
typedef BufferType::iterator RTT::internal::LockedQueue< T >::Iterator [private] |
Definition at line 64 of file LockedQueue.hpp.
typedef unsigned int RTT::internal::LockedQueue< T >::size_type |
Definition at line 71 of file LockedQueue.hpp.
typedef T RTT::internal::LockedQueue< T >::value_t |
Definition at line 61 of file LockedQueue.hpp.
RTT::internal::LockedQueue< T >::LockedQueue | ( | unsigned int | lsize | ) | [inline] |
Create a lock-based queue wich can store lsize elements.
lsize | the capacity of the queue. ' |
Definition at line 77 of file LockedQueue.hpp.
RTT::internal::LockedQueue< T >::~LockedQueue | ( | ) | [inline] |
Definition at line 84 of file LockedQueue.hpp.
value_t RTT::internal::LockedQueue< T >::back | ( | ) | const [inline] |
Returns the last element of the queue.
Definition at line 172 of file LockedQueue.hpp.
size_type RTT::internal::LockedQueue< T >::capacity | ( | ) | const [inline] |
Definition at line 87 of file LockedQueue.hpp.
void RTT::internal::LockedQueue< T >::clear | ( | ) | [inline] |
Definition at line 118 of file LockedQueue.hpp.
bool RTT::internal::LockedQueue< T >::dequeue | ( | T & | result | ) | [inline] |
Dequeue an item.
result | The value dequeued. |
Definition at line 145 of file LockedQueue.hpp.
bool RTT::internal::LockedQueue< T >::enqueue | ( | const T & | value | ) | [inline] |
Enqueue an item.
value | The value to enqueue. |
Definition at line 129 of file LockedQueue.hpp.
value_t RTT::internal::LockedQueue< T >::front | ( | ) | const [inline] |
Returns the first element of the queue.
Definition at line 160 of file LockedQueue.hpp.
bool RTT::internal::LockedQueue< T >::isEmpty | ( | ) | const [inline] |
Inspect if the Queue is empty.
Definition at line 102 of file LockedQueue.hpp.
bool RTT::internal::LockedQueue< T >::isFull | ( | ) | const [inline] |
Inspect if the Queue is full.
Definition at line 112 of file LockedQueue.hpp.
size_type RTT::internal::LockedQueue< T >::size | ( | ) | const [inline] |
Definition at line 92 of file LockedQueue.hpp.
unsigned int RTT::internal::LockedQueue< T >::cap [private] |
Definition at line 69 of file LockedQueue.hpp.
BufferType RTT::internal::LockedQueue< T >::data [private] |
Definition at line 67 of file LockedQueue.hpp.
os::Mutex RTT::internal::LockedQueue< T >::lock [mutable, private] |
Definition at line 66 of file LockedQueue.hpp.