API Documentation
Public Member Functions | List of all members
nkGraphics::InfiniteBitMask Class Reference

A utility class providing "infinite" masks, formed by bits, or booleans. More...

Public Member Functions

 InfiniteBitMask ()
 
 InfiniteBitMask (const InfiniteBitMask &other)
 
 InfiniteBitMask (InfiniteBitMask &&other)
 
 ~InfiniteBitMask ()
 
void setBit (unsigned int index, bool value)
 
void clear ()
 
bool getBit (unsigned int index) const
 
unsigned int getOrder () const
 
bool checkSubPartEquality (const InfiniteBitMask &other, unsigned int begin, unsigned int end) const
 
std::vector< bool >::reference operator[] (size_t index)
 
bool operator[] (size_t index) const
 
bool operator== (const InfiniteBitMask &other) const
 
bool operator!= (const InfiniteBitMask &other) const
 
bool operator< (const InfiniteBitMask &other) const
 
InfiniteBitMaskoperator= (const InfiniteBitMask &other)
 
InfiniteBitMaskoperator= (InfiniteBitMask &&other)
 

Detailed Description

A utility class providing "infinite" masks, formed by bits, or booleans.

Constructor & Destructor Documentation

◆ InfiniteBitMask() [1/3]

nkGraphics::InfiniteBitMask::InfiniteBitMask ( )

Default constructor.

◆ InfiniteBitMask() [2/3]

nkGraphics::InfiniteBitMask::InfiniteBitMask ( const InfiniteBitMask other)

Copy constructor.

◆ InfiniteBitMask() [3/3]

nkGraphics::InfiniteBitMask::InfiniteBitMask ( InfiniteBitMask &&  other)

Move constructor.

◆ ~InfiniteBitMask()

nkGraphics::InfiniteBitMask::~InfiniteBitMask ( )

Destructor.

Member Function Documentation

◆ setBit()

void nkGraphics::InfiniteBitMask::setBit ( unsigned int  index,
bool  value 
)

Sets a bit value, at given index.

Parameters
indexThe index of the bit to set.
valueThe value to attach.

◆ clear()

void nkGraphics::InfiniteBitMask::clear ( )

Clears the mask and make it empty again.

◆ getBit()

bool nkGraphics::InfiniteBitMask::getBit ( unsigned int  index) const
Parameters
indexThe index of the bit value to retrieve.
Returns
The value of requested bit.

◆ getOrder()

unsigned int nkGraphics::InfiniteBitMask::getOrder ( ) const
Returns
The order of the mask, aka the highest index of the bit set to true.

◆ checkSubPartEquality()

bool nkGraphics::InfiniteBitMask::checkSubPartEquality ( const InfiniteBitMask other,
unsigned int  begin,
unsigned int  end 
) const

Allows to check sub parts for equality between two masks.

Parameters
otherThe mask to check against.
beginThe first index to check within the masks.
endThe last index to check.
Returns
Whether the sub parts are equal (true) or not (false).

◆ operator[]() [1/2]

std::vector<bool>::reference nkGraphics::InfiniteBitMask::operator[] ( size_t  index)

Access operator.

Parameters
indexThe index of the bit to access.
Returns
A reference over the value wanted.

◆ operator[]() [2/2]

bool nkGraphics::InfiniteBitMask::operator[] ( size_t  index) const

Const access operator.

Parameters
indexThe index of the bit to access.
Returns
The value requested.

◆ operator==()

bool nkGraphics::InfiniteBitMask::operator== ( const InfiniteBitMask other) const

Comparison operator.

Parameters
otherThe mask to compare with.
Returns
If both masks are equal (true) or not (false).

◆ operator!=()

bool nkGraphics::InfiniteBitMask::operator!= ( const InfiniteBitMask other) const

Comparison operator.

Parameters
otherThe mask to compare with.
Returns
If both mask are difference (true) or not (false).

◆ operator<()

bool nkGraphics::InfiniteBitMask::operator< ( const InfiniteBitMask other) const

Comparison operator.

Parameters
otherThe mask to compare with.
Returns
If calling mask is smaller (true) or not (false).

◆ operator=() [1/2]

InfiniteBitMask& nkGraphics::InfiniteBitMask::operator= ( const InfiniteBitMask other)

Assignment operator.

Parameters
otherThe mask to assign.
Returns
The calling mask, updated.

◆ operator=() [2/2]

InfiniteBitMask& nkGraphics::InfiniteBitMask::operator= ( InfiniteBitMask &&  other)

Assignment operator.

Parameters
otherThe mask to assign.
Returns
The calling mask, updated.

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