A more generic version of the InfiniteBitMask. More...
Public Member Functions | |
InfiniteMask ()=default | |
InfiniteMask (const InfiniteMask< T > &other) | |
InfiniteMask (InfiniteMask< T > &&other) | |
~InfiniteMask ()=default | |
void | resize (unsigned int size) |
void | setVal (unsigned int index, T value) |
void | clear () |
T | getVal (unsigned int index) const |
unsigned int | getOrder () const |
bool | checkSubPartEquality (const InfiniteMask< T > &other, unsigned int begin, unsigned int end) const |
bool | checkSubPartFill (const InfiniteMask< T > &other, unsigned int begin, unsigned int end) const |
void | mergeWith (const InfiniteMask< T > &other, bool overrideValues=false) |
std::vector< T >::reference | operator[] (size_t index) |
T | operator[] (size_t index) const |
bool | operator== (const InfiniteMask< T > &other) const |
bool | operator!= (const InfiniteMask< T > &other) const |
bool | operator< (const InfiniteMask< T > &other) const |
InfiniteMask & | operator= (const InfiniteMask< T > &other) |
InfiniteMask & | operator= (InfiniteMask< T > &&other) |
A more generic version of the InfiniteBitMask.
Allows to create an infinite mask with entries symbolized by any type.
|
default |
Default constructor.
nkGraphics::InfiniteMask< T >::InfiniteMask | ( | const InfiniteMask< T > & | other | ) |
Copy constructor.
nkGraphics::InfiniteMask< T >::InfiniteMask | ( | InfiniteMask< T > && | other | ) |
Move constructor.
|
default |
Destructor.
void nkGraphics::InfiniteMask< T >::resize | ( | unsigned int | size | ) |
Resizes the mask, either filling with default values or scrapping existing ones.
size | The size to resize to. |
void nkGraphics::InfiniteMask< T >::setVal | ( | unsigned int | index, |
T | value | ||
) |
Sets a value at given index.
index | The index to manipulate. |
value | The value to assign to it. |
void nkGraphics::InfiniteMask< T >::clear | ( | ) |
Resets the mask and start fresh.
T nkGraphics::InfiniteMask< T >::getVal | ( | unsigned int | index | ) | const |
index | The index of the value to retrieve. |
unsigned int nkGraphics::InfiniteMask< T >::getOrder | ( | ) | const |
bool nkGraphics::InfiniteMask< T >::checkSubPartEquality | ( | const InfiniteMask< T > & | other, |
unsigned int | begin, | ||
unsigned int | end | ||
) | const |
Compares two sub parts of masks.
other | The mask to compare with. |
begin | The first index to start comparing from. |
end | The last index of the comparison sub part. |
bool nkGraphics::InfiniteMask< T >::checkSubPartFill | ( | const InfiniteMask< T > & | other, |
unsigned int | begin, | ||
unsigned int | end | ||
) | const |
Checks equality only for values that are set in another mask. Does not check for strict equality. If more values are set within calling mask, filling is still correct.
other | The mask whose values should be checked against the calling one. |
begin | The first index to start comparing from. |
end | The last index of the comparison sub part. |
void nkGraphics::InfiniteMask< T >::mergeWith | ( | const InfiniteMask< T > & | other, |
bool | overrideValues = false |
||
) |
Merges the mask with another one.
other | The mask to merge with. |
overrideValues | Whether the values should be overridden or not. Override happens if the source mask has negative values, and the other positive ones. |
std::vector<T>::reference nkGraphics::InfiniteMask< T >::operator[] | ( | size_t | index | ) |
Access operator.
index | The index to access. |
T nkGraphics::InfiniteMask< T >::operator[] | ( | size_t | index | ) | const |
Const access operator.
index | The index of the bit to access. |
bool nkGraphics::InfiniteMask< T >::operator== | ( | const InfiniteMask< T > & | other | ) | const |
Comparison operator.
other | The mask to compare with. |
bool nkGraphics::InfiniteMask< T >::operator!= | ( | const InfiniteMask< T > & | other | ) | const |
Comparison operator.
other | The mask to compare with. |
bool nkGraphics::InfiniteMask< T >::operator< | ( | const InfiniteMask< T > & | other | ) | const |
Comparison operator.
other | The mask to compare with. |
InfiniteMask& nkGraphics::InfiniteMask< T >::operator= | ( | const InfiniteMask< T > & | other | ) |
Assignment operator.
other | The mask to assign. |
InfiniteMask& nkGraphics::InfiniteMask< T >::operator= | ( | InfiniteMask< T > && | other | ) |
Assignment operator.
other | The mask to assign. |