[#BloombergLP-bdlcc-TimeQueue-091]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::xref:BloombergLP/bdlcc/TimeQueue-09c.adoc[TimeQueue]&lt;xref:bsl/function-0a.adoc[function&lt;void()&gt;]&gt;
:relfileprefix: ../../
:mrdocs:

This parameterized class provides a public interface which is similar in structure and intent to `Queue&lt;DATA&gt;`, with the exception that each item stored in the `TimeQueue` has an associated time value&period; Items are retrieved or exchanged by proxy of a `TimeQueueItem&lt;DATA&gt;`, and are referred to by an opaque data type `TimeQueue&colon;&colon;Handle` which serves to identify an individual element on the Time Queue&period; Idiomatic usage of `TimeQueue` includes the member function `popLE`, which finds all items on the queue whose `bsls&colon;&colon;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&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;&gt;
class xref:BloombergLP/bdlcc/TimeQueue-09c.adoc[TimeQueue]&lt;xref:bsl/function-0a.adoc[function&lt;void()&gt;]&gt;;
----

== 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&period;
|===


== 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&period; 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&period; When a node is removed, the handle value becomes invalid, though invalidated handle values are eventually reused&period; See the component&hyphen;level documentation for more details&period;
|===


== 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[`&#126;TimeQueue`] [.small]#[destructor]#
| Destroy this time queue&period;
| 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`&period; Note that the value returned may be obsolete by the time it is received&period;
| 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&period; Note that the value returned may be obsolete by the time it is received&period;
| xref:BloombergLP/bdlcc/TimeQueue-091/minTime.adoc[`minTime`] 
| Load into the specified `buffer`, the time value of the lowest time in this queue&period; Return 0 on success, and a non&hyphen;zero value if this queue is empty&period;
| 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&period; Optionally load into the optionally specified `newLength`, the number of items remaining in the queue&period; Optionally load into the optionally specified `newMinTime` the new lowest time in this queue&period; Return 0 on success, and a non&hyphen;zero value if there are no items in the queue&period; Note that if `DATA` follows the `bdema` allocator model, the allocator of the `buffer` is used to supply memory&period;
| 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&period; Optionally specify a `removedItems` vector in which to load the removed items&period; The resultant items in the `buffer` are ordered by increasing time interval&semi; items of equivalent time interval have arbitrary ordering&period; Note that the allocator of the `removedItems` vector is used to supply memory&period;
| xref:BloombergLP/bdlcc/TimeQueue-091/removeIf.adoc[`removeIf`] 
| Remove all the items from this queue for which `predicate` returns `true`&period; Optionally specify `newLength`, in which to load the number of items remaining in this queue&period; Optionally specify `newMinTime`, in which to load the lowest remaining time value in this queue&period; Optionally specify a vector of `removedItems` in which to load the removed items&period;
| xref:BloombergLP/bdlcc/TimeQueue-091/update-01.adoc[`update`] 
| `update` overloads
|===



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