A templated typed class for thread-safe queue of object pointers. More...
#include <thread.h>
Public Member Functions | |
T * | fifo (timeout_t timeout=0) |
Get and remove first typed object posted to the queue. | |
T * | lifo (timeout_t timeout=0) |
Get and remove last typed object posted to the queue. | |
bool | post (T *object, timeout_t timeout=0) |
Post a typed object into the queue by it's pointer. | |
queueof (mempager *memory, size_t size=0) | |
Create templated queue of typed objects. | |
bool | remove (T *object) |
Remove a specific typed object pointer for the queue. |
A templated typed class for thread-safe queue of object pointers.
This allows one to use the queue class in a typesafe manner for a specific object type derived from Object rather than generically for any derived object class.
Definition at line 2141 of file thread.h.
ucc::queueof< T >::queueof | ( | mempager * | memory, | |
size_t | size = 0 | |||
) | [inline] |
T* ucc::queueof< T >::fifo | ( | timeout_t | timeout = 0 |
) | [inline] |
Get and remove first typed object posted to the queue.
This can wait for a specified timeut of the queue is empty. The object is still retained and must be released or deleted by the receiving function.
timeout | to wait if empty in milliseconds. |
Reimplemented from ucc::queue.
T* ucc::queueof< T >::lifo | ( | timeout_t | timeout = 0 |
) | [inline] |
Get and remove last typed object posted to the queue.
This can wait for a specified timeout of the queue is empty. The object is still retained and must be released or deleted by the receiving function.
timeout | to wait if empty in milliseconds. |
Reimplemented from ucc::queue.
bool ucc::queueof< T >::post | ( | T * | object, | |
timeout_t | timeout = 0 | |||
) | [inline] |
Post a typed object into the queue by it's pointer.
This can wait for a specified timeout if the queue is full, for example, for another thread to remove an object pointer. This retains the object.
object | to post. | |
timeout | to wait if queue is full in milliseconds. |
bool ucc::queueof< T >::remove | ( | T * | object | ) | [inline] |
Remove a specific typed object pointer for the queue.
This can remove a member from any location in the queue, whether beginning, end, or somewhere in the middle. This releases the object.
object | to remove. |
Definition at line 2158 of file thread.h.