R-Type
|
A queue class that is thread safe. More...
#include <SafeQueue.hpp>
Public Member Functions | |
SafeQueue ()=default | |
~SafeQueue ()=default | |
Destructor. More... | |
void | push (T value) override |
Push in queue, lock a mutex while pushing the value. More... | |
bool | tryPop (T &value) override |
Try to pop a value from the queue, lock a mutex while trying to pop the value. More... | |
T | pop () override |
Pop a value from the queue, lock a mutex and wait if the queue is empty. More... | |
size_t | size () const |
Returns the current size of the queue. More... | |
![]() | |
virtual | ~ISafeQueue ()=default |
Destructor. More... | |
A queue class that is thread safe.
T | The type contained in the queue |
|
inlineoverridevirtual |
Pop a value from the queue, lock a mutex and wait if the queue is empty.
Implements ISafeQueue< T >.
|
inlineoverridevirtual |
Push in queue, lock a mutex while pushing the value.
value | Value to be pushed |
Implements ISafeQueue< T >.
|
inline |
Returns the current size of the queue.
|
inlineoverridevirtual |
Try to pop a value from the queue, lock a mutex while trying to pop the value.
value | Reference to be filled withthe popped value |
Implements ISafeQueue< T >.