[#BloombergLP-bdlcc-FixedQueueIndexManager-reservePopIndex]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::xref:BloombergLP/bdlcc/FixedQueueIndexManager.adoc[FixedQueueIndexManager]::reservePopIndex
:relfileprefix: ../../../
:mrdocs:

Reserve the next available index from which to dequeue an element&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
reservePopIndex(
    unsigned int* generation,
    unsigned int* index);
----

== Description

Reserve the next available index from which to dequeue an element from an (externally managed) circular buffer&semi; load the specified `index` with the reserved index and load the specified `generation` with the current generation of the circular buffer&period; Return 0 on success, and a non&hyphen;zero value if the queue is empty&period; If this method succeeds, other threads using this object may spin on the corresponding index state until `commitPopIndex` is called using the returned `index` and `generation` values&semi; clients should call `commitPopIndex` quickly after this method returns, without performing any blocking operations&period; If this method fails the `generation` and `index` will be unmodified&period; The behavior is undefined if the current thread is already holding a reservation on either a push or pop index&period; Note that `generation` is necessary for invoking `commitPopIndex` but should not otherwise be used by the caller&semi; the value reflects the of times the `index` in the circular buffer has been used&period;

== Return Value

0 on success, and a non&hyphen;zero value if the queue is empty

== Parameters

[cols="1,4"]
|===
| Name| Description
| *generation*
| receives the generation of the reserved index
| *index*
| receives the reserved buffer index
|===


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