This class implements a thread‐enabled multipriority queue of TYPE.
Synopsis
Declared in <bdlcc_multipriorityqueue.h>
template<class TYPE>
class MultipriorityQueue;
Description
Priorities are restricted to a (small) set of contiguous N integer values, [ 0 .. N ‐ 1 ], with 0 being the most urgent.
This class does have a notion of value, namely the sequence of priority/element pairs, constrained to be in decreasing order of urgency (i.e., monotonically increasing priority values). However, no value‐semantic operations are implemented. Note that elements having the same priority are maintained in First‐In‐First‐Out (FIFO) order. Note that the current implementation supports up to a maximum of sizeof(int) * CHAR_BIT priorities.
This class is implemented as a set of linked lists, one for each priority. Two vectors are used to maintain head and tail pointers for the lists.
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this container. The behavior is undefined unless all access or modification of the container has completed prior to this call. |
Disable pushes to this multipriority queue. This method has no effect unless the queue was enabled. |
|
Enable pushes to this multipriority queue. This method has no effect unless the queue was disabled. |
|
Return |
|
Return |
|
Return the total number of items in this multi‐priority queue. |
|
Return the number of distinct priorities (indicated at construction) that are supported by this multi‐priority queue. |
|
Remove the most urgent item from this queue, blocking if empty. |
|
|
|
Insert copies of the specified |
|
Insert copies of the specified |
|
Remove and destroy all items from this multi‐priority queue. |
|
Attempt to remove the most urgent item from this queue immediately. |
|
|
Declare that this type uses a |
Created with MrDocs