template<class PRITYPE, class TYPE>
class Threading::SafePriorityQueue< PRITYPE, TYPE >
A thread-safe priority-sorted queue which protects itself with critical sections.
Offers a method to wait for new elements to be added. Useful for inter-thread communications.
- Copyright
- (C) 2006 Radon Labs GmbH (C) 2013-2020 Individual contributors, see AUTHORS file
|
| SafePriorityQueue () |
| constructor
|
|
| SafePriorityQueue (const SafePriorityQueue< PRITYPE, TYPE > &rhs) |
| copy constructor
|
|
void | operator= (const SafePriorityQueue< PRITYPE, TYPE > &rhs) |
| assignment operator
|
|
SizeT | Size () const |
| returns number of elements in the queue
|
|
bool | IsEmpty () const |
| return true if queue is empty
|
|
void | Clear () |
| remove all elements from the queue
|
|
void | Insert (PRITYPE pri, const TYPE &e) |
| add element to the back of the queue
|
|
void | EraseMatchingElements (const TYPE &e) |
| erase all matching elements
|
|
TYPE | Dequeue () |
| remove the element from the front of the queue
|
|
TYPE | Peek () const |
| get copy of element at front of queue without removing it
|
|
void | Wait () |
| wait until queue contains at least one element
|
|
void | Signal () |
| signal the internal event, so that Wait() will return
|
|
|
__forceinline std::enable_if< std::is_trivially_destructible< X >::value==false >::type | DestroyElement (IndexT idx) |
|
__forceinline std::enable_if< std::is_trivially_destructible< X >::value==true >::type | DestroyElement (IndexT idx) |
|
__forceinline std::enable_if< std::is_trivially_destructible< X >::value==false >::type | ClearAll () |
|
__forceinline std::enable_if< std::is_trivially_destructible< X >::value==true >::type | ClearAll () |
|
IndexT | MapIndex (IndexT index) const |
| maps index to actual item position using wrapping
|
|
| Queue () |
| constructor
|
|
| Queue (const Queue< TYPE > &rhs) |
| copy constructor
|
|
| Queue (Queue< TYPE > &&rhs) |
| move constructor
|
|
| ~Queue () |
| destructor
|
|
void | operator= (const Queue< TYPE > &rhs) |
| assignment operator
|
|
void | operator= (Queue< TYPE > &&rhs) |
| move assignment operator
|
|
TYPE & | operator[] (IndexT index) const |
| access element by index, 0 is the frontmost element (next to be dequeued)
|
|
bool | operator== (const Queue< TYPE > &rhs) const |
| equality operator
|
|
bool | operator!= (const Queue< TYPE > &rhs) const |
| inequality operator
|
|
void | Reserve (SizeT num) |
| increase capacity to fit N more elements into the Dequeue (slow)
|
|
void | Grow () |
| grow Dequeue by internal growing rules (slow)
|
|
SizeT | Size () const |
| returns number of elements in the Dequeue
|
|
SizeT | Capacity () const |
| returns allocation of elements in the Dequeue
|
|
bool | IsEmpty () const |
| return true if Dequeue is empty
|
|
void | Clear () |
| remove all elements from the Dequeue
|
|
bool | Contains (const TYPE &e) const |
| return true if Dequeue contains element
|
|
void | EraseIndex (const IndexT i) |
| erase element at index (slow!!)
|
|
void | Enqueue (const TYPE &e) |
| add element to the back of the Dequeue, can trigger grow
|
|
void | Enqueue (TYPE &&e) |
|
TYPE | Dequeue () |
| remove the element from the front of the Dequeue
|
|
TYPE & | Peek () const |
| access to element at front of Dequeue without removing it
|
|
static const SizeT | MinGrowSize |
|
static const SizeT | MaxGrowSize |
|
template<class PRITYPE , class TYPE >
signal the internal event, so that Wait() will return
This signals the internal event object, on which Wait() may be waiting.
This method may be useful to wake up a thread waiting for events when it should stop.