[#BloombergLP-bdlcc-MultipriorityQueue] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::MultipriorityQueue :relfileprefix: ../../ :mrdocs: This class implements a thread‐enabled multipriority queue of `TYPE`. == Synopsis Declared in `<bdlcc_multipriorityqueue.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- 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 [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlcc/MultipriorityQueue/2constructor-0d.adoc[`MultipriorityQueue`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bdlcc/MultipriorityQueue/2destructor.adoc[`~MultipriorityQueue`] [.small]#[destructor]# | Destroy this container. The behavior is undefined unless all access or modification of the container has completed prior to this call. | xref:BloombergLP/bdlcc/MultipriorityQueue/disable.adoc[`disable`] | Disable pushes to this multipriority queue. This method has no effect unless the queue was enabled. | xref:BloombergLP/bdlcc/MultipriorityQueue/enable.adoc[`enable`] | Enable pushes to this multipriority queue. This method has no effect unless the queue was disabled. | xref:BloombergLP/bdlcc/MultipriorityQueue/isEmpty.adoc[`isEmpty`] | Return `true` if there are no items in this multi‐priority queue, and `false` otherwise. | xref:BloombergLP/bdlcc/MultipriorityQueue/isEnabled.adoc[`isEnabled`] | Return `true` if this multipriority queue is enable and `false` otherwise. | xref:BloombergLP/bdlcc/MultipriorityQueue/length.adoc[`length`] | Return the total number of items in this multi‐priority queue. | xref:BloombergLP/bdlcc/MultipriorityQueue/numPriorities.adoc[`numPriorities`] | Return the number of distinct priorities (indicated at construction) that are supported by this multi‐priority queue. | xref:BloombergLP/bdlcc/MultipriorityQueue/popFront.adoc[`popFront`] | Remove the most urgent item from this queue, blocking if empty. | xref:BloombergLP/bdlcc/MultipriorityQueue/pushBack-03.adoc[`pushBack`] | `pushBack` overloads | xref:BloombergLP/bdlcc/MultipriorityQueue/pushBackMultipleRaw.adoc[`pushBackMultipleRaw`] | Insert copies of the specified `item` at the back of its priority. | xref:BloombergLP/bdlcc/MultipriorityQueue/pushFrontMultipleRaw.adoc[`pushFrontMultipleRaw`] | Insert copies of the specified `item` at the front of its priority. | xref:BloombergLP/bdlcc/MultipriorityQueue/removeAll.adoc[`removeAll`] | Remove and destroy all items from this multi‐priority queue. | xref:BloombergLP/bdlcc/MultipriorityQueue/tryPopFront.adoc[`tryPopFront`] | Attempt to remove the most urgent item from this queue immediately. | xref:BloombergLP/bdlcc/MultipriorityQueue/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<MultipriorityQueue, UsesBslmaAllocator>`] | Declare that this type uses a `bslma` allocator. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#