OGRE-Next
4.0.0unstable
Object-Oriented Graphics Rendering Engine
|
This is similar to std::bitset, except waaay less bloat. More...
#include <OgreBitset.h>
Public Member Functions | |
size_t | findFirstBitSet () const |
Finds the first bit set. More... | |
size_t | findFirstBitSet (const size_t startFrom) const |
Same as findFirstBitSet(); starting from startFrom (inclusive). More... | |
size_t | findLastBitSetPlusOne () const |
Finds the first bit unset after the last bit set. More... | |
Public Member Functions inherited from Ogre::cbitsetN< _N, uint64, 6u, 0x3Fu > | |
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... | |
This is similar to std::bitset, except waaay less bloat.
cbitset64 stands for constant/compile-time bitset with an internal representation of 64-bits
2^6 = 64 0x3F = 64 - 1 = 6 bits set
_N | Number of bits this bitset will hold |
size_t Ogre::cbitset64< _N >::findFirstBitSet | ( | ) | const |
Finds the first bit set.
size_t Ogre::cbitset64< _N >::findFirstBitSet | ( | const size_t | startFrom | ) | const |
Same as findFirstBitSet(); starting from startFrom (inclusive).
startFrom | In range [0; capacity) |
e.g. if capacity == 5 and we've set 01001b (0 is the 4th bit, 1 is the 0th bit) then:
findFirstBitSet( 5 ) = INVALID findFirstBitSet( 4 ) = 5u (capacity, not found) findFirstBitSet( 3 ) = 3u findFirstBitSet( 2 ) = 3u findFirstBitSet( 1 ) = 3u findFirstBitSet( 0 ) = 0u
size_t Ogre::cbitset64< _N >::findLastBitSetPlusOne | ( | ) | const |
Finds the first bit unset after the last bit set.