BloombergLP::bdlcc::TimeQueue

Priority queue of DATA items ordered by associated time values.

Synopsis

Declared in <bdlcc_timequeue.h>

template<class DATA>
class TimeQueue;

Description

This parameterized class provides a public interface which is similar in structure and intent to Queue<DATA>, with the exception that each item stored in the TimeQueue has an associated time value. Items are retrieved or exchanged by proxy of a TimeQueueItem<DATA>, and are referred to by an opaque data type TimeQueue::Handle which serves to identify an individual element on the Time Queue. Idiomatic usage of TimeQueue includes the member function popLE, which finds all items on the queue whose bsls::TimeInterval are less than a specified value and transfers those items to a provided vector of items, and the member function update, which can update the time value for a specific TimeQueueItem without removing it from the queue.

Types

NameDescription
Key This type is a wrapper around a void pointer that will be supplied and used by clients to uniquely identify an item in the queue.

Type Aliases

NameDescription
Handle Alias for uniquely identifying a valid node in the time queue.

Member Functions

NameDescription
TimeQueue [constructor]Constructors
~TimeQueue [destructor]Destroy this time queue.
add add overloads
countLE Return the number of items with a time less than or equal to time.
isRegisteredHandle isRegisteredHandle overloads
length Return number of items in this queue. Note that the value returned may be obsolete by the time it is received.
minTime Load into the specified buffer, the time value of the lowest time in this queue. Return 0 on success, and a non-zero value if this queue is empty.
popFront Atomically remove the top item from this queue.
popLE popLE overloads
remove remove overloads
removeAll Remove all the items from this queue.
removeIf Remove all items for which the specified predicate returns true.
update update overloads