[#BloombergLP-bdlcc-TimeQueue-09c] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::TimeQueue :relfileprefix: ../../ :mrdocs: Priority queue of `DATA` items ordered by associated time values. == Synopsis Declared in `<bdlcc_timequeue.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- 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 [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlcc/TimeQueue-09c/Key.adoc[`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 [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlcc/TimeQueue-09c/Handle.adoc[`Handle`] | Alias for uniquely identifying a valid node in the time queue. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlcc/TimeQueue-09c/2constructor-0a.adoc[`TimeQueue`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bdlcc/TimeQueue-09c/2destructor.adoc[`~TimeQueue`] [.small]#[destructor]# | Destroy this time queue. | xref:BloombergLP/bdlcc/TimeQueue-09c/add-0b3.adoc[`add`] | `add` overloads | xref:BloombergLP/bdlcc/TimeQueue-09c/countLE.adoc[`countLE`] | Return the number of items with a time less than or equal to `time`. | xref:BloombergLP/bdlcc/TimeQueue-09c/isRegisteredHandle-08.adoc[`isRegisteredHandle`] | `isRegisteredHandle` overloads | xref:BloombergLP/bdlcc/TimeQueue-09c/length.adoc[`length`] | Return number of items in this queue. Note that the value returned may be obsolete by the time it is received. | xref:BloombergLP/bdlcc/TimeQueue-09c/minTime.adoc[`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. | xref:BloombergLP/bdlcc/TimeQueue-09c/popFront.adoc[`popFront`] | Atomically remove the top item from this queue. | xref:BloombergLP/bdlcc/TimeQueue-09c/popLE-00.adoc[`popLE`] | `popLE` overloads | xref:BloombergLP/bdlcc/TimeQueue-09c/remove-08.adoc[`remove`] | `remove` overloads | xref:BloombergLP/bdlcc/TimeQueue-09c/removeAll.adoc[`removeAll`] | Remove all the items from this queue. | xref:BloombergLP/bdlcc/TimeQueue-09c/removeIf.adoc[`removeIf`] | Remove all items for which the specified `predicate` returns `true`. | xref:BloombergLP/bdlcc/TimeQueue-09c/update-00.adoc[`update`] | `update` overloads |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#