|
Project SkyFire Core
SkyFire 5.4.8 server core API documentation
|
#include <LockedQueue.h>
Public Member Functions | |
| std::size_t | add (const T &item) |
| Adds an item to the queue. | |
| void | cancel () |
| Cancels the queue. | |
| bool | cancelled () |
| Checks if the queue is cancelled. | |
| bool | empty () |
| ! Checks if we're empty or not with locks held | |
| void | lock () |
| Locks the queue for access. | |
| LockedQueue () | |
| Create a LockedQueue. | |
| bool | next (T &result) |
| Gets the next result in the queue, if any. | |
| template<class Checker> | |
| bool | next (T &result, Checker &check) |
| T & | peek (bool autoUnlock=false) |
| Peeks at the top of the queue. Check if the queue is empty before calling! Remember to unlock after use if autoUnlock == false. | |
| void | pop_front () |
| ! Calls pop_front of the queue | |
| std::size_t | size () |
| ! Returns current queue depth with locks held | |
| void | unlock () |
| Unlocks the queue. | |
| virtual | ~LockedQueue () |
| Destroy a LockedQueue. | |
Private Attributes | |
| volatile bool | _canceled |
| Cancellation flag. | |
| LockType | _lock |
| Lock access to the queue. | |
| StorageType | _queue |
| Storage backing the queue. | |
Definition at line 19 of file LockedQueue.h.
|
inline |
|
inlinevirtual |
Destroy a LockedQueue.
Definition at line 35 of file LockedQueue.h.
|
inline |
|
inline |
Cancels the queue.
Definition at line 96 of file LockedQueue.h.
|
inline |
Checks if the queue is cancelled.
Definition at line 106 of file LockedQueue.h.
References _canceled.
|
inline |
! Checks if we're empty or not with locks held
Definition at line 132 of file LockedQueue.h.
References _queue.
|
inline |
Locks the queue for access.
Definition at line 113 of file LockedQueue.h.
|
inline |
Gets the next result in the queue, if any.
Definition at line 51 of file LockedQueue.h.
References _queue.
|
inline |
Definition at line 67 of file LockedQueue.h.
References _queue.
|
inline |
Peeks at the top of the queue. Check if the queue is empty before calling! Remember to unlock after use if autoUnlock == false.
Definition at line 83 of file LockedQueue.h.
|
inline |
|
inline |
! Returns current queue depth with locks held
Definition at line 139 of file LockedQueue.h.
References _queue.
|
inline |
Unlocks the queue.
Definition at line 119 of file LockedQueue.h.
|
private |
Cancellation flag.
Definition at line 28 of file LockedQueue.h.
Referenced by cancel(), cancelled(), and LockedQueue().
|
private |
Lock access to the queue.
Definition at line 22 of file LockedQueue.h.
|
private |
Storage backing the queue.
Definition at line 25 of file LockedQueue.h.
Referenced by add(), empty(), next(), next(), peek(), pop_front(), and size().