|
Planeshift
|
A queue of smart pointers with locking facilties for multi-threading. More...
#include <genrefqueue.h>
Public Member Functions | |
| bool | Add (queuetype *msg) |
| This adds a message to the queue and waits if it is full. More... | |
| bool | AddWait (queuetype *msg, csTicks timeout=0) |
| like above, but waits to add the next message, if the queue is full be careful with this. More... | |
| unsigned int | Count () |
| Number of items in the queue. More... | |
| GenericRefQueue (unsigned int maxsize=500) | |
| csPtr< queuetype > | Get () |
| This gets the next message from the queue, it is then removed from the queue. More... | |
| csPtr< queuetype > | GetWait (csTicks timeout) |
| like above, but waits for the next message, if the queue is empty More... | |
| void | Interrupt () |
| This function interrupt the queue if it is waiting. More... | |
| bool | IsFull () |
| csPtr< queuetype > | Peek () |
| ~GenericRefQueue () | |
Protected Attributes | |
| CS::Threading::Condition | datacondition |
| CS::Threading::RecursiveMutex | mutex |
| refType< queuetype > * | qbuffer |
| unsigned int | qend |
| unsigned int | qsize |
| unsigned int | qstart |
A queue of smart pointers with locking facilties for multi-threading.
The objects in the queue must implement reference counting.
Definition at line 39 of file genrefqueue.h.
|
inline |
Definition at line 42 of file genrefqueue.h.
|
inline |
Definition at line 51 of file genrefqueue.h.
|
inline |
This adds a message to the queue and waits if it is full.
Definition at line 82 of file genrefqueue.h.
|
inline |
like above, but waits to add the next message, if the queue is full be careful with this.
It's easy to deadlock!
Definition at line 58 of file genrefqueue.h.
|
inline |
Number of items in the queue.
Definition at line 207 of file genrefqueue.h.
|
inline |
This gets the next message from the queue, it is then removed from the queue.
Note: It returns a pointer to the message, so a null pointer indicates an error
Definition at line 142 of file genrefqueue.h.
|
inline |
like above, but waits for the next message, if the queue is empty
Definition at line 172 of file genrefqueue.h.
|
inline |
This function interrupt the queue if it is waiting.
Definition at line 199 of file genrefqueue.h.
|
inline |
Definition at line 216 of file genrefqueue.h.
|
inline |
Definition at line 111 of file genrefqueue.h.
|
protected |
Definition at line 226 of file genrefqueue.h.
|
protected |
Definition at line 225 of file genrefqueue.h.
|
protected |
Definition at line 223 of file genrefqueue.h.
|
protected |
Definition at line 224 of file genrefqueue.h.
|
protected |
Definition at line 224 of file genrefqueue.h.
|
protected |
Definition at line 224 of file genrefqueue.h.