Open 3D Engine AzNetworking API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzNetworking::RingbufferBitset< SIZE > Class Template Reference

Public Types

using RingbufferContainer = AZStd::array< BitsetChunk, RingbufferContainerSize >
 

Public Member Functions

void Reset ()
 Resets the bitset to all empty.
 
bool GetBit (uint32_t index) const
 
void SetBit (uint32_t index, bool value)
 
uint32_t GetValidBitCount () const
 
void PushBackBits (uint32_t numBits)
 
const BitsetChunk & GetBitsetElement (uint32_t elementIndex) const
 
uint32_t GetUnusedHeadBits () const
 

Static Public Attributes

static constexpr uint32_t NumBitsetChunkedBits = AZ::Log2(BitsetChunk(~0))
 
static constexpr uint32_t RingbufferContainerSize = SIZE / NumBitsetChunkedBits
 

Member Function Documentation

◆ GetBit()

template<uint32_t SIZE>
bool AzNetworking::RingbufferBitset< SIZE >::GetBit ( uint32_t  index) const
inline

Gets the current value of the specified bit.

Parameters
indexindex of the bit to retrieve the value of
Returns
boolean true if the bit is set, false otherwise

◆ GetBitsetElement()

template<uint32_t SIZE>
const BitsetChunk & AzNetworking::RingbufferBitset< SIZE >::GetBitsetElement ( uint32_t  elementIndex) const
inline

Retrieves a single element from the ringbuffer bitset.

Parameters
elementIndexthe index of the ringbuffer element to retrieve
Returns
the requested bitset element

◆ GetUnusedHeadBits()

template<uint32_t SIZE>
uint32_t AzNetworking::RingbufferBitset< SIZE >::GetUnusedHeadBits
inline

Returns the number of bits that are unused in the head element.

Returns
the number of bits that are unused in the head element

◆ GetValidBitCount()

template<uint32_t SIZE>
uint32_t AzNetworking::RingbufferBitset< SIZE >::GetValidBitCount
inline

Returns the number of accessible bits in this ringbuffer bitset.

Returns
the number of accessible bits in this ringbuffer bitset

◆ PushBackBits()

template<uint32_t SIZE>
void AzNetworking::RingbufferBitset< SIZE >::PushBackBits ( uint32_t  numBits)
inline

Pushes back the specified number of bits padding with zero bits.

Parameters
numBitsthe number of bits to push into the bitset

◆ SetBit()

template<uint32_t SIZE>
void AzNetworking::RingbufferBitset< SIZE >::SetBit ( uint32_t  index,
bool  value 
)
inline

Sets the specified bit to the provided value.

Parameters
indexindex of the bit to set
valuevalue to set the bit to

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