BloombergLP::bdlcc::FixedQueue_PopGuard::FixedQueue_PopGuard

Create a guard that pops the indicated element on destruction.

Synopsis

Declared in <bdlcc_fixedqueue.h>

FixedQueue_PopGuard(
    FixedQueue<VALUE>* queue,
    unsigned int generation,
    unsigned int index);

Description

Create a guard that, upon its destruction, will update the state of the specified queue to remove (pop) the element at the specified index having the specified generation, and destroy that popped object. The behavior is undefined unless index and generation refer to a valid element in queue that the current thread has acquired a reservation to pop (using FixedQueueIndexManager::reservePopIndex).

Parameters

NameDescription
queuequeue from which to pop
generationgeneration count of the cell being popped
indexindex of the cell being popped