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

Reserve the next available index at which to enqueue an element in 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, a negative value if the queue is disabled, and a positive value if the queue is full&period; If this method succeeds, other threads using this object may spin on the corresponding index state until `commitPushIndex` is called using the returned `index` and `generation` values&semi; clients should call `commitPushIndex` 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 `commitPushIndex` but should not otherwise be used by the caller&semi; the value reflects the number of times the `index` in the circular buffer has been used&period;

== Synopsis

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

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


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