[#BloombergLP-bdlcc-FixedQueueIndexManager-reservePopIndexForClear] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::xref:BloombergLP/bdlcc/FixedQueueIndexManager.adoc[FixedQueueIndexManager]::reservePopIndexForClear :relfileprefix: ../../../ :mrdocs: Reserve a pop index for clearing cells up to a push reservation. == Synopsis Declared in `<bdlcc_fixedqueueindexmanager.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int reservePopIndexForClear( unsigned int* disposedGeneration, unsigned int* disposedIndex, unsigned int endGeneration, unsigned int endIndex); ---- == Description If the next available index from which an element can be popped is before the specified `endGeneration` and `endIndex` then reserve that index for popping and load the specified `disposedGeneration` and `disposedIndex` with the generation and index of the reserved cell; otherwise this operation has no effect. Return 0 if an index was successfully reserved, and a non‐zero value if the current pop index is at `endIndex` and `endGeneration`. The behavior is undefined unless `endGeneration` and `endIndex` refer to a cell that has been acquired for writing. Note that this operation is used to facilitate removing all the elements in a circular buffer if an exception is thrown between reserving an index for pushing, and committing that index ‐‐ the intended usage is to call `reservePopIndexForClear` and then `commitPopIndex`, emptying all the cells up to the index that was reserved for writing, and then call `abortPushIndexReservation` on the reserved index. == Return Value 0 if an index was reserved, non‐zero if at the end cell == Parameters [cols="1,4"] |=== | Name| Description | *disposedGeneration* | receives the generation of the reserved cell | *disposedIndex* | receives the index of the reserved cell | *endGeneration* | generation of the push‐reserved end cell | *endIndex* | index of the push‐reserved end cell |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#