This class implements a thread‐enabled multipriority queue whose priorities are restricted to a (small) set of contiguous N integer values, [ 0 .. N ‐ 1 ], with 0 being the most urgent.
Synopsis
Declared in <bdlcc_multipriorityqueue.h>
template<class TYPE>
class MultipriorityQueue;
Description
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 least‐recently added item having the most urgent priority (lowest value) from this multi‐priority queue and load its value into the specified |
|
|
|
Insert the value of the specified |
|
Insert the value of the specified |
|
Remove and destroy all items from this multi‐priority queue. |
|
Attempt to remove (immediately) the least‐recently added item having the most urgent priority (lowest value) from this multi‐priority queue. On success, load the value of the popped item into the specified |
|
|
Created with MrDocs