Abstracts away the implementation of a circular buffer with two pointers
Head Advance Counter: How many positions has the head been advanced
Tail Advance Counter: How many positions has the tail been advanced Storage for these pointers shall be provided by the caller as pointers and will be considered volatile (this is useful for RDMA changes to the internal state of the circular buffer).
This function increases the circular buffer depth (e.g., when an element is pushed) by advancing a virtual head. The head cannot advance in such a way that the depth exceeds capacity.
Parameters
[in]
n
The number of positions to advance
[in]
useCachedDepth
A boolean signalling if we should read a cached, slightly outdated channel depth. This parameter can be used if in a combination of push from producer and pop from consumer the two might cross over and lead to a brief tail index > head index. This is normally illegal. In this scenario, getCached = true allows a crossover between push and pop to complete
This function advances buffer tail (e.g., when an element is popped). It goes back around if the capacity is exceeded The tail cannot advanced more than the current depth (that would mean that more elements were consumed than pushed).
Parameters
[in]
n
The number of positions to advance the head of the circular buffer
Forces the head advance counter into a specific absolute value
Parameters
[in]
headAdvanceCounter
the new value of the head advance counter. This value should never be smaller than the current tail advance counter, othewise this means the circular buffer has negative depth
Forces the tail advance counter into a specific absolute value
Parameters
[in]
tailAdvanceCounter
the new value of the head advance counter. This value should never be smaller than the current tail advance counter, othewise this means the circular buffer has negative depth
The documentation for this class was generated from the following file: