BloombergLP::bdlcc::MultipriorityQueue

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

NameDescription
MultipriorityQueue [constructor]Constructors
~MultipriorityQueue [destructor]Destroy this container. The behavior is undefined unless all access or modification of the container has completed prior to this call.
disable Disable pushes to this multipriority queue. This method has no effect unless the queue was enabled.
enable Enable pushes to this multipriority queue. This method has no effect unless the queue was disabled.
isEmpty Return true if there are no items in this multi-priority queue, and false otherwise.
isEnabled Return true if this multipriority queue is enable and false otherwise.
length Return the total number of items in this multi-priority queue.
numPriorities Return the number of distinct priorities (indicated at construction) that are supported by this multi-priority queue.
popFront Remove the most urgent item from this queue, blocking if empty.
pushBack pushBack overloads
pushBackMultipleRaw Insert copies of the specified item at the back of its priority.
pushFrontMultipleRaw Insert copies of the specified item at the front of its priority.
removeAll Remove and destroy all items from this multi-priority queue.
tryPopFront Attempt to remove the most urgent item from this queue immediately.
operator BloombergLP::bslmf::NestedTraitDeclaration<MultipriorityQueue, UsesBslmaAllocator> Declare that this type uses a bslma allocator.