[#BloombergLP-bdlcc-MultipriorityQueue]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::MultipriorityQueue
:relfileprefix: ../../
:mrdocs:

This class implements a thread&hyphen;enabled multipriority queue of `TYPE`&period;

== Synopsis

Declared in `&lt;bdlcc&lowbar;multipriorityqueue&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
class MultipriorityQueue;
----

== Description

Priorities are restricted to a (small) set of contiguous `N` integer values, `&lsqb; 0 &period;&period; N &hyphen; 1 &rsqb;`, with 0 being the most urgent&period;

This class does have a notion of value, namely the sequence of priority&sol;element pairs, constrained to be in decreasing order of urgency (i&period;e&period;, monotonically increasing priority values)&period; However, no value&hyphen;semantic operations are implemented&period; Note that elements having the same priority are maintained in First&hyphen;In&hyphen;First&hyphen;Out (FIFO) order&period; Note that the current implementation supports up to a maximum of `sizeof(int) &ast; CHAR&lowbar;BIT` priorities&period;

This class is implemented as a set of linked lists, one for each priority&period; Two vectors are used to maintain head and tail pointers for the lists&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlcc/MultipriorityQueue/2constructor-0d.adoc[`MultipriorityQueue`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bdlcc/MultipriorityQueue/2destructor.adoc[`&#126;MultipriorityQueue`] [.small]#[destructor]#
| Destroy this container&period; The behavior is undefined unless all access or modification of the container has completed prior to this call&period;
| xref:BloombergLP/bdlcc/MultipriorityQueue/disable.adoc[`disable`] 
| Disable pushes to this multipriority queue&period; This method has no effect unless the queue was enabled&period;
| xref:BloombergLP/bdlcc/MultipriorityQueue/enable.adoc[`enable`] 
| Enable pushes to this multipriority queue&period; This method has no effect unless the queue was disabled&period;
| xref:BloombergLP/bdlcc/MultipriorityQueue/isEmpty.adoc[`isEmpty`] 
| Return `true` if there are no items in this multi&hyphen;priority queue, and `false` otherwise&period;
| xref:BloombergLP/bdlcc/MultipriorityQueue/isEnabled.adoc[`isEnabled`] 
| Return `true` if this multipriority queue is enable and `false` otherwise&period;
| xref:BloombergLP/bdlcc/MultipriorityQueue/length.adoc[`length`] 
| Return the total number of items in this multi&hyphen;priority queue&period;
| xref:BloombergLP/bdlcc/MultipriorityQueue/numPriorities.adoc[`numPriorities`] 
| Return the number of distinct priorities (indicated at construction) that are supported by this multi&hyphen;priority queue&period;
| xref:BloombergLP/bdlcc/MultipriorityQueue/popFront.adoc[`popFront`] 
| Remove the most urgent item from this queue, blocking if empty&period;
| 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&period;
| xref:BloombergLP/bdlcc/MultipriorityQueue/pushFrontMultipleRaw.adoc[`pushFrontMultipleRaw`] 
| Insert copies of the specified `item` at the front of its priority&period;
| xref:BloombergLP/bdlcc/MultipriorityQueue/removeAll.adoc[`removeAll`] 
| Remove and destroy all items from this multi&hyphen;priority queue&period;
| xref:BloombergLP/bdlcc/MultipriorityQueue/tryPopFront.adoc[`tryPopFront`] 
| Attempt to remove the most urgent item from this queue immediately&period;
| xref:BloombergLP/bdlcc/MultipriorityQueue/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;MultipriorityQueue, UsesBslmaAllocator&gt;`] 
| Declare that this type uses a `bslma` allocator&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
