[#BloombergLP-bdlcc-TimeQueue-091] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::xref:BloombergLP/bdlcc/TimeQueue-09c.adoc[TimeQueue]<xref:bsl/function-0a.adoc[function<void()>]> :relfileprefix: ../../ :mrdocs: 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. == Synopsis Declared in `<bdlcc_timequeue.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<> class xref:BloombergLP/bdlcc/TimeQueue-09c.adoc[TimeQueue]<xref:bsl/function-0a.adoc[function<void()>]>; ---- == Types [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlcc/TimeQueue-091/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-091/Handle.adoc[`Handle`] | `Handle` defines an alias for uniquely identifying a valid node in the time queue. Handles are returned when nodes are added to the time queue, and must be supplied to the `update` and `remove` methods to identify existing nodes. When a node is removed, the handle value becomes invalid, though invalidated handle values are eventually reused. See the component‐level documentation for more details. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlcc/TimeQueue-091/2constructor-0bc.adoc[`TimeQueue`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bdlcc/TimeQueue-091/2destructor.adoc[`~TimeQueue`] [.small]#[destructor]# | Destroy this time queue. | xref:BloombergLP/bdlcc/TimeQueue-091/add-0c.adoc[`add`] | `add` overloads | xref:BloombergLP/bdlcc/TimeQueue-091/countLE.adoc[`countLE`] | Return the number of items in this queue that have a time value less than or equal to the specified `time`. Note that the value returned may be obsolete by the time it is received. | xref:BloombergLP/bdlcc/TimeQueue-091/isRegisteredHandle-00.adoc[`isRegisteredHandle`] | `isRegisteredHandle` overloads | xref:BloombergLP/bdlcc/TimeQueue-091/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-091/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-091/popFront.adoc[`popFront`] | Atomically remove the top item from this queue, and optionally load into the optionally specified `buffer` the time and associated data of the item removed. Optionally load into the optionally specified `newLength`, the number of items remaining in the queue. Optionally load into the optionally specified `newMinTime` the new lowest time in this queue. Return 0 on success, and a non‐zero value if there are no items in the queue. Note that if `DATA` follows the `bdema` allocator model, the allocator of the `buffer` is used to supply memory. | xref:BloombergLP/bdlcc/TimeQueue-091/popLE-055.adoc[`popLE`] | `popLE` overloads | xref:BloombergLP/bdlcc/TimeQueue-091/remove-06.adoc[`remove`] | `remove` overloads | xref:BloombergLP/bdlcc/TimeQueue-091/removeAll.adoc[`removeAll`] | Remove all the items from this queue. Optionally specify a `removedItems` vector in which to load the removed items. The resultant items in the `buffer` are ordered by increasing time interval; items of equivalent time interval have arbitrary ordering. Note that the allocator of the `removedItems` vector is used to supply memory. | xref:BloombergLP/bdlcc/TimeQueue-091/removeIf.adoc[`removeIf`] | Remove all the items from this queue for which `predicate` returns `true`. Optionally specify `newLength`, in which to load the number of items remaining in this queue. Optionally specify `newMinTime`, in which to load the lowest remaining time value in this queue. Optionally specify a vector of `removedItems` in which to load the removed items. | xref:BloombergLP/bdlcc/TimeQueue-091/update-01.adoc[`update`] | `update` overloads |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#