Isle
Loading...
Searching...
No Matches
MxBitset< N > Class Template Reference

Templated fixed-size bitset for bit manipulation. More...

#include <mxbitset.h>

Classes

class  Reference
 Proxy class to reference a single bit within the MxBitset. More...
 

Public Member Functions

 MxBitset ()
 Constructs an empty MxBitset with all bits cleared. More...
 
Reference operator[] (size_t p_bit)
 Provides a reference-like object for a specific bit. More...
 
MxBitset< N > & Flip (size_t p_bit)
 Flips (toggles) a single bit at the given position. More...
 
size_t Count ()
 Counts the number of set bits. More...
 
bool Test (MxU32 p_bit)
 Tests if the given bit is set (1) or not (0). More...
 
MxU32 Size () const
 Returns the number of bits (N) this bitset manages. More...
 

Detailed Description

template<size_t N>
class MxBitset< N >

Templated fixed-size bitset for bit manipulation.

[AI]

[AI] Provides a simple implementation similar to std::bitset, optimized for small fixed sizes with basic bit flipping and testing operations. The number of bits is set at compile time via the template argument N. [AI]

Template Parameters
NNumber of bits in the set. [AI]

Definition at line 18 of file mxbitset.h.

Constructor & Destructor Documentation

◆ MxBitset()

template<size_t N>
MxBitset< N >::MxBitset ( )
inline

Constructs an empty MxBitset with all bits cleared.

[AI]

[AI] Constructor initializes internal storage and ensures all bits are set to the value zero using the Tidy() function. [AI]

Definition at line 24 of file mxbitset.h.

Member Function Documentation

◆ Count()

template<size_t N>
size_t MxBitset< N >::Count ( )
inline

Counts the number of set bits.

[AI]

[AI] Not implemented in debug builds, always returns zero. [AI]

Returns
size_t Always 0; stub function. [AI]

Definition at line 95 of file mxbitset.h.

◆ Flip()

template<size_t N>
MxBitset< N > & MxBitset< N >::Flip ( size_t  p_bit)
inline

Flips (toggles) a single bit at the given position.

[AI]

[AI] If out of range, triggers an assertion failure (Xran). [AI]

Parameters
p_bitBit index to flip [AI]
Returns
MxBitset<N>& Reference to this bitset (enables chaining). [AI]

Definition at line 81 of file mxbitset.h.

◆ operator[]()

template<size_t N>
Reference MxBitset< N >::operator[] ( size_t  p_bit)
inline

Provides a reference-like object for a specific bit.

[AI]

Parameters
p_bitBit index to access [AI]
Returns
Reference Proxy to the requested bit, which can be flipped or tested. [AI]

Definition at line 73 of file mxbitset.h.

◆ Size()

template<size_t N>
MxU32 MxBitset< N >::Size ( ) const
inline

Returns the number of bits (N) this bitset manages.

[AI]

Returns
MxU32 Number of bits [AI]

Definition at line 120 of file mxbitset.h.

◆ Test()

template<size_t N>
bool MxBitset< N >::Test ( MxU32  p_bit)
inline

Tests if the given bit is set (1) or not (0).

[AI]

[AI] If out of range, triggers an assertion (Xran). [AI]

Parameters
p_bitBit index to test [AI]
Returns
bool TRUE if the bit is set, FALSE if not. [AI]

Definition at line 107 of file mxbitset.h.


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