A templated typed class for thread-safe stack of object pointers. More...
#include <thread.h>
Public Member Functions | |
stackof (size_t size=0) | |
Create templated stack of typed objects. | |
bool | remove (T *object) |
Remove a specific typed object pointer for the stack. | |
bool | push (T *object, timeout_t timeout=0) |
Push a typed object into the stack by it's pointer. | |
T * | pull (timeout_t timeout=0) |
Get and remove last typed object posted to the stack. |
A templated typed class for thread-safe stack of object pointers.
This allows one to use the stack class in a typesafe manner for a specific object type derived from Object rather than generically for any derived object class.
Definition at line 2173 of file thread.h.
ucc::stackof< T, P >::stackof | ( | size_t | size = 0 |
) | [inline] |
T* ucc::stackof< T, P >::pull | ( | timeout_t | timeout = 0 |
) | [inline] |
Get and remove last typed object posted to the stack.
This can wait for a specified timeout of the stack 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::stack.
Definition at line 2210 of file thread.h.
bool ucc::stackof< T, P >::push | ( | T * | object, | |
timeout_t | timeout = 0 | |||
) | [inline] |
Push a typed object into the stack 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 push. | |
timeout | to wait if queue is full in milliseconds. |
Definition at line 2200 of file thread.h.
bool ucc::stackof< T, P >::remove | ( | T * | object | ) | [inline] |
Remove a specific typed object pointer for the stack.
This can remove a member from any location in the stack, whether beginning, end, or somewhere in the middle. This releases the object.
object | to remove. |
Definition at line 2189 of file thread.h.