![]() |
TrinityCore
|
#include <LockedQueue.h>
Public Member Functions | |
| LockedQueue () | |
| Create a LockedQueue. | |
| virtual | ~LockedQueue () |
| Destroy a LockedQueue. | |
| void | add (const T &item) |
| Adds an item to the queue. | |
| template<class Iterator > | |
| void | readd (Iterator begin, Iterator end) |
| Adds items back to front of the queue. | |
| 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 | cancel () |
| Cancels the queue. | |
| bool | cancelled () |
| Checks if the queue is cancelled. | |
| void | lock () |
| Locks the queue for access. | |
| void | unlock () |
| Unlocks the queue. | |
| void | pop_front () |
| ! Calls pop_front of the queue | |
| bool | empty () |
| ! Checks if we're empty or not with locks held | |
Private Attributes | |
| std::mutex | _lock |
| Lock access to the queue. | |
| StorageType | _queue |
| Storage backing the queue. | |
| volatile bool | _canceled |
| Cancellation flag. | |
Definition at line 25 of file LockedQueue.h.
|
inline |
Create a LockedQueue.
Definition at line 39 of file LockedQueue.h.
|
inlinevirtual |
Destroy a LockedQueue.
Definition at line 45 of file LockedQueue.h.
|
inline |
Adds an item to the queue.
Definition at line 50 of file LockedQueue.h.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Cancels the queue.
Definition at line 111 of file LockedQueue.h.
Here is the call graph for this function:
|
inline |
Checks if the queue is cancelled.
Definition at line 119 of file LockedQueue.h.
Here is the call graph for this function:
|
inline |
! Checks if we're empty or not with locks held
Definition at line 145 of file LockedQueue.h.
Here is the call graph for this function:
|
inline |
Locks the queue for access.
Definition at line 126 of file LockedQueue.h.
Here is the caller graph for this function:
|
inline |
Gets the next result in the queue, if any.
Definition at line 68 of file LockedQueue.h.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
|
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 98 of file LockedQueue.h.
Here is the call graph for this function:
|
inline |
! Calls pop_front of the queue
Definition at line 138 of file LockedQueue.h.
Here is the call graph for this function:
|
inline |
Adds items back to front of the queue.
Definition at line 61 of file LockedQueue.h.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Unlocks the queue.
Definition at line 132 of file LockedQueue.h.
Here is the caller graph for this function:
|
private |
Cancellation flag.
Definition at line 34 of file LockedQueue.h.
|
private |
Lock access to the queue.
Definition at line 28 of file LockedQueue.h.
|
private |
Storage backing the queue.
Definition at line 31 of file LockedQueue.h.