![]() |
OGRE-Next
2.3
Object-Oriented Graphics Rendering Engine
|
#include <OgreBitset.h>
Public Member Functions | |
cbitsetN () | |
size_t | capacity () const |
Return maximum number of bits this bitset can hold. More... | |
void | clear () |
Sets all bits to 0. More... | |
bool | empty () const |
Returns true if all bits are unset. More... | |
size_t | numBitsSet (const size_t positionEnd) const |
Returns the number of bits that are set between range [0; positionEnd). More... | |
void | set (const size_t position) |
Sets bit at 'position' to 1. More... | |
void | setAll () |
Sets all bits to 1. More... | |
void | setAllUntil (size_t position) |
Sets all bits in range [0; position) It's the same as calling: More... | |
void | setValue (const size_t position, const bool bValue) |
Sets bit at 'position'. More... | |
bool | test (const size_t position) const |
Returns true if bit at 'position' is 1. More... | |
void | unset (const size_t position) |
Sets bit at 'position' to 0. More... | |
_N | Number of bits this bitset will hold |
_bits | The exponent of the number of bits to hold per mValues. E.g. 32 bits per mValues needs _bits = 5, because 2^5 = 32 Note we never tested other combinations where 2^_bits * 8 != sizeof( _internalDataType ) |
_mask | The maximum number of bits - 1 to avoid overflow e.g. 32 bits per mValues needs a mask of 31 (0x1F) to wrap around so when we call this->set( 32 );
|
It actually performs:
|
inline |
|
inline |
Return maximum number of bits this bitset can hold.
|
inline |
Sets all bits to 0.
Referenced by Ogre::cbitsetN< _N, _internalDataType, _bits, _mask >::cbitsetN().
bool Ogre::cbitsetN< _N, _internalDataType, _bits, _mask >::empty | ( | ) | const |
Returns true if all bits are unset.
size_t Ogre::cbitsetN< _N, _internalDataType, _bits, _mask >::numBitsSet | ( | const size_t | positionEnd | ) | const |
Returns the number of bits that are set between range [0; positionEnd).
void Ogre::cbitsetN< _N, _internalDataType, _bits, _mask >::set | ( | const size_t | position | ) |
Sets bit at 'position' to 1.
position | Value in range [0; _N) |
void Ogre::cbitsetN< _N, _internalDataType, _bits, _mask >::setAll | ( | ) |
Sets all bits to 1.
void Ogre::cbitsetN< _N, _internalDataType, _bits, _mask >::setAllUntil | ( | size_t | position | ) |
Sets all bits in range [0; position) It's the same as calling:
for( size_t i = 0u; i < position; ++i ) this->set( i );
Values in range [position; _N) are left untouched
position |
void Ogre::cbitsetN< _N, _internalDataType, _bits, _mask >::setValue | ( | const size_t | position, |
const bool | bValue | ||
) |
Sets bit at 'position'.
position | Value in range [0; _N) |
bValue |
bool Ogre::cbitsetN< _N, _internalDataType, _bits, _mask >::test | ( | const size_t | position | ) | const |
Returns true if bit at 'position' is 1.
position | Value in range [0; _N) |
void Ogre::cbitsetN< _N, _internalDataType, _bits, _mask >::unset | ( | const size_t | position | ) |
Sets bit at 'position' to 0.
position | Value in range [0; _N) |