#include <AtomicMWSRQueue.hpp>
Classes | |
union | SIndexes |
Public Types | |
typedef AtomicQueue< T >::size_type | size_type |
Public Types inherited from RTT::internal::AtomicQueue< T > | |
typedef unsigned int | size_type |
Public Member Functions | |
AtomicMWSRQueue (unsigned int size) | |
size_type | capacity () const |
void | clear () |
bool | dequeue (T &result) |
bool | enqueue (const T &value) |
const T | front () const |
bool | isEmpty () const |
bool | isFull () const |
size_type | size () const |
~AtomicMWSRQueue () | |
Public Member Functions inherited from RTT::internal::AtomicQueue< T > | |
virtual | ~AtomicQueue () |
Private Types | |
typedef T | C |
typedef C *volatile | CacheObjType |
typedef volatile C * | CachePtrType |
typedef C * | PtrType |
typedef C | ValueType |
Private Member Functions | |
bool | advance_r (T &result) |
CachePtrType | advance_w () |
AtomicMWSRQueue (const AtomicMWSRQueue< T > &) | |
Private Attributes | |
CachePtrType | _buf |
volatile SIndexes | _indxes |
const int | _size |
Create an atomic, non-blocking Multi-Writer Single-Reader FIFO for storing a pointer T by value. Any number of writer threads may access the queue concurrently, but only one thread may read it.
T | The pointer type to be stored in the Queue. Example : AtomicMWSRQueue< A* > is a queue of pointers to A. |
Definition at line 60 of file AtomicMWSRQueue.hpp.
|
private |
Definition at line 64 of file AtomicMWSRQueue.hpp.
|
private |
Definition at line 66 of file AtomicMWSRQueue.hpp.
|
private |
Definition at line 65 of file AtomicMWSRQueue.hpp.
|
private |
Definition at line 68 of file AtomicMWSRQueue.hpp.
typedef AtomicQueue<T>::size_type RTT::internal::AtomicMWSRQueue< T >::size_type |
Definition at line 163 of file AtomicMWSRQueue.hpp.
|
private |
Definition at line 67 of file AtomicMWSRQueue.hpp.
|
private |
|
inline |
Create an AtomicMWSRQueue with queue size size.
size | The size of the queue, should be 1 or greater. |
Definition at line 169 of file AtomicMWSRQueue.hpp.
|
inline |
Definition at line 176 of file AtomicMWSRQueue.hpp.
|
inlineprivate |
Advance and wrap of the Read pointer. Only one thread may call this.
Definition at line 129 of file AtomicMWSRQueue.hpp.
|
inlineprivate |
Atomic advance and wrap of the Write pointer. Return the old position or zero if queue is full.
Definition at line 99 of file AtomicMWSRQueue.hpp.
|
inlinevirtual |
Return the maximum number of items this queue can contain.
Implements RTT::internal::AtomicQueue< T >.
Definition at line 210 of file AtomicMWSRQueue.hpp.
|
inlinevirtual |
Clear all contents of the Queue and thus make it empty.
Implements RTT::internal::AtomicQueue< T >.
Definition at line 270 of file AtomicMWSRQueue.hpp.
|
inlinevirtual |
Dequeue an item.
value | Stores the dequeued value. It is unchanged when dequeue returns false and contains the dequeued value when it returns true. |
Implements RTT::internal::AtomicQueue< T >.
Definition at line 249 of file AtomicMWSRQueue.hpp.
|
inlinevirtual |
Enqueue an item.
value | The value to enqueue. |
Implements RTT::internal::AtomicQueue< T >.
Definition at line 231 of file AtomicMWSRQueue.hpp.
|
inlinevirtual |
Return the next to be read value.
Implements RTT::internal::AtomicQueue< T >.
Definition at line 262 of file AtomicMWSRQueue.hpp.
|
inlinevirtual |
Inspect if the Queue is empty.
Implements RTT::internal::AtomicQueue< T >.
Definition at line 199 of file AtomicMWSRQueue.hpp.
|
inlinevirtual |
Inspect if the Queue is full.
Implements RTT::internal::AtomicQueue< T >.
Definition at line 185 of file AtomicMWSRQueue.hpp.
|
inlinevirtual |
Return the number of elements in the queue.
Implements RTT::internal::AtomicQueue< T >.
Definition at line 218 of file AtomicMWSRQueue.hpp.
|
private |
The pointer to the buffer can be cached, the contents are volatile.
Definition at line 87 of file AtomicMWSRQueue.hpp.
|
private |
The indexes are packed into one double word. Therefore the read and write index can be read and written atomically.
Definition at line 93 of file AtomicMWSRQueue.hpp.
|
private |
Definition at line 63 of file AtomicMWSRQueue.hpp.