NVIDIA DeepStream SDK API Reference

9.2 Release
sdk::metrics::AdaptingIntegerArray Class Reference

Detailed Description

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...
 

Constructor & Destructor Documentation

◆ AdaptingIntegerArray() [1/6]

sdk::metrics::AdaptingIntegerArray::AdaptingIntegerArray ( size_t  size)
inlineexplicit

◆ AdaptingIntegerArray() [2/6]

sdk::metrics::AdaptingIntegerArray::AdaptingIntegerArray ( const AdaptingIntegerArray &  other)
default

◆ AdaptingIntegerArray() [3/6]

sdk::metrics::AdaptingIntegerArray::AdaptingIntegerArray ( AdaptingIntegerArray &&  other)
default

◆ AdaptingIntegerArray() [4/6]

sdk::metrics::AdaptingIntegerArray::AdaptingIntegerArray ( size_t  size)
inlineexplicit

◆ AdaptingIntegerArray() [5/6]

sdk::metrics::AdaptingIntegerArray::AdaptingIntegerArray ( const AdaptingIntegerArray &  other)
default

◆ AdaptingIntegerArray() [6/6]

sdk::metrics::AdaptingIntegerArray::AdaptingIntegerArray ( AdaptingIntegerArray &&  other)
default

Member Function Documentation

◆ Clear() [1/2]

void sdk::metrics::AdaptingIntegerArray::Clear ( )

Clears the array, resetting all values to zero.

◆ Clear() [2/2]

void sdk::metrics::AdaptingIntegerArray::Clear ( )

Clears the array, resetting all values to zero.

◆ Get() [1/2]

uint64_t sdk::metrics::AdaptingIntegerArray::Get ( size_t  index) const

Returns the value at the specified index from the array.

Parameters
indexThe index of the value to retrieve.
Returns
The value at the specified index.

◆ Get() [2/2]

uint64_t sdk::metrics::AdaptingIntegerArray::Get ( size_t  index) const

Returns the value at the specified index from the array.

Parameters
indexThe index of the value to retrieve.
Returns
The value at the specified index.

◆ Increment() [1/2]

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.

Parameters
indexThe index of the value to increment.
countThe count by which to increment the value.

◆ Increment() [2/2]

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.

Parameters
indexThe index of the value to increment.
countThe count by which to increment the value.

◆ operator=() [1/4]

AdaptingIntegerArray& sdk::metrics::AdaptingIntegerArray::operator= ( AdaptingIntegerArray &&  other)
default

◆ operator=() [2/4]

AdaptingIntegerArray& sdk::metrics::AdaptingIntegerArray::operator= ( AdaptingIntegerArray &&  other)
default

◆ operator=() [3/4]

AdaptingIntegerArray& sdk::metrics::AdaptingIntegerArray::operator= ( const AdaptingIntegerArray &  other)
default

◆ operator=() [4/4]

AdaptingIntegerArray& sdk::metrics::AdaptingIntegerArray::operator= ( const AdaptingIntegerArray &  other)
default

◆ Size() [1/2]

size_t sdk::metrics::AdaptingIntegerArray::Size ( ) const

Returns the size of the array.

Returns
The size of the array.

Referenced by sdk::metrics::AdaptingCircularBufferCounter::MaxSize().

◆ Size() [2/2]

size_t sdk::metrics::AdaptingIntegerArray::Size ( ) const

Returns the size of the array.

Returns
The size of the array.

The documentation for this class was generated from the following file: