An integer array that automatically expands its memory consumption (via copy/allocation) when reaching limits.
This assumes counts remain low, to lower memory overhead.
This class is NOT thread-safe. It is expected to be behind a synchronized incrementer.
Instances start by attempting to store one-byte per-cell in the integer array. As values grow, this will automatically instantiate the next-size integer array (uint8_t -> uint16_t -> uint32_t -> uint64_t) and copy over values into the larger array. This class expects most usage to remain within the uint8_t boundary (e.g. cell values < 256).
Definition at line 29 of file includes/opentelemetry/sdk/metrics/data/circular_buffer.h.
Public Member Functions | |
| AdaptingIntegerArray (size_t size) | |
| AdaptingIntegerArray (const AdaptingIntegerArray &other)=default | |
| AdaptingIntegerArray (AdaptingIntegerArray &&other)=default | |
| AdaptingIntegerArray & | operator= (const AdaptingIntegerArray &other)=default |
| AdaptingIntegerArray & | operator= (AdaptingIntegerArray &&other)=default |
| void | Increment (size_t index, uint64_t count) |
| Increments the value at the specified index by the given count in the array. More... | |
| uint64_t | Get (size_t index) const |
| Returns the value at the specified index from the array. More... | |
| size_t | Size () const |
| Returns the size of the array. More... | |
| void | Clear () |
| Clears the array, resetting all values to zero. More... | |
| AdaptingIntegerArray (size_t size) | |
| AdaptingIntegerArray (const AdaptingIntegerArray &other)=default | |
| AdaptingIntegerArray (AdaptingIntegerArray &&other)=default | |
| AdaptingIntegerArray & | operator= (const AdaptingIntegerArray &other)=default |
| AdaptingIntegerArray & | operator= (AdaptingIntegerArray &&other)=default |
| void | Increment (size_t index, uint64_t count) |
| Increments the value at the specified index by the given count in the array. More... | |
| uint64_t | Get (size_t index) const |
| Returns the value at the specified index from the array. More... | |
| size_t | Size () const |
| Returns the size of the array. More... | |
| void | Clear () |
| Clears the array, resetting all values to zero. More... | |
|
inlineexplicit |
Definition at line 33 of file includes/opentelemetry/sdk/metrics/data/circular_buffer.h.
|
default |
|
default |
|
inlineexplicit |
Definition at line 33 of file 9.2/includes/opentelemetry/sdk/metrics/data/circular_buffer.h.
|
default |
|
default |
| void sdk::metrics::AdaptingIntegerArray::Clear | ( | ) |
Clears the array, resetting all values to zero.
| void sdk::metrics::AdaptingIntegerArray::Clear | ( | ) |
Clears the array, resetting all values to zero.
| uint64_t sdk::metrics::AdaptingIntegerArray::Get | ( | size_t | index | ) | const |
Returns the value at the specified index from the array.
| index | The index of the value to retrieve. |
| uint64_t sdk::metrics::AdaptingIntegerArray::Get | ( | size_t | index | ) | const |
Returns the value at the specified index from the array.
| index | The index of the value to retrieve. |
| void sdk::metrics::AdaptingIntegerArray::Increment | ( | size_t | index, |
| uint64_t | count | ||
| ) |
Increments the value at the specified index by the given count in the array.
| index | The index of the value to increment. |
| count | The count by which to increment the value. |
| void sdk::metrics::AdaptingIntegerArray::Increment | ( | size_t | index, |
| uint64_t | count | ||
| ) |
Increments the value at the specified index by the given count in the array.
| index | The index of the value to increment. |
| count | The count by which to increment the value. |
|
default |
|
default |
|
default |
|
default |
| size_t sdk::metrics::AdaptingIntegerArray::Size | ( | ) | const |
Returns the size of the array.
Referenced by sdk::metrics::AdaptingCircularBufferCounter::MaxSize().
| size_t sdk::metrics::AdaptingIntegerArray::Size | ( | ) | const |
Returns the size of the array.