See cbitset64.
More...
#include <OgreBitset.h>
See cbitset64.
This is the same, but the maximum number of bits is not known at build time
◆ bitset64()
Ogre::bitset64::bitset64 |
( |
| ) |
|
|
inline |
◆ capacity()
size_t Ogre::bitset64::capacity |
( |
| ) |
const |
|
inline |
Return maximum number of bits this bitset can hold.
◆ clear()
void Ogre::bitset64::clear |
( |
| ) |
|
|
inline |
◆ empty()
bool Ogre::bitset64::empty |
( |
| ) |
const |
|
inline |
Returns true if all bits are unset.
◆ findFirstBitSet() [1/2]
size_t Ogre::bitset64::findFirstBitSet |
( |
| ) |
const |
|
inline |
Finds the first bit set.
- Returns
- The index to the first set bit returns this->capacity() if all bits are unset (i.e. all 0s)
◆ findFirstBitSet() [2/2]
size_t Ogre::bitset64::findFirstBitSet |
( |
size_t |
startFrom | ) |
const |
|
inline |
Finds the first bit set.
- Returns
- The index to the first set bit returns this->capacity() if all bits are unset (i.e. all 0s)
◆ findLastBitSetPlusOne() [1/2]
size_t Ogre::bitset64::findLastBitSetPlusOne |
( |
| ) |
const |
|
inline |
Finds the first bit unset after the last bit set.
- Returns
- If all bits are unset (i.e. all 0s): Returns 0 If at least one bit is set: The index to the last set bit, plus one. Return range is [1; capacity]
◆ findLastBitSetPlusOne() [2/2]
size_t Ogre::bitset64::findLastBitSetPlusOne |
( |
size_t |
startFrom | ) |
const |
|
inline |
Same as findLastBitSetPlusOne(); starting from startFrom (exclusive).
- Parameters
-
startFrom | Must be 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: findLastBitSetPlusOne( 6 ) = INVALID
findLastBitSetPlusOne( 5 ) = 4u
findLastBitSetPlusOne( 4 ) = 4u
findLastBitSetPlusOne( 3 ) = 1u
findLastBitSetPlusOne( 2 ) = 1u
findLastBitSetPlusOne( 1 ) = 1u
findLastBitSetPlusOne( 0 ) = INVALID
e.g. if capacity == 5 and we've set 10110b (1 is the 4th bit, 0 is the 0th bit) then: findLastBitSetPlusOne( 6 ) = INVALID
findLastBitSetPlusOne( 5 ) = 5u
findLastBitSetPlusOne( 4 ) = 3u
findLastBitSetPlusOne( 3 ) = 3u
findLastBitSetPlusOne( 2 ) = 2u
findLastBitSetPlusOne( 1 ) = 0u (not found)
findLastBitSetPlusOne( 0 ) = INVALID
|
- Returns
- If all bits are unset (i.e. all 0s): Returns 0 If at least one bit is set: The index to the last set bit, plus one. Return range is [1; startFrom]
◆ findLastBitUnset() [1/2]
size_t Ogre::bitset64::findLastBitUnset |
( |
| ) |
const |
|
inline |
Finds the last bit unset.
- Returns
- If all bits are set (i.e. all 1s): Returns this->capacity() If at least one bit is unset: The index to the last set unbit. Return range is [0; capacity)
◆ findLastBitUnset() [2/2]
size_t Ogre::bitset64::findLastBitUnset |
( |
size_t |
startFrom | ) |
const |
|
inline |
Finds the last bit unset; starting from startFrom (exclusive).
- Parameters
-
startFrom | Must be 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: findLastBitUnsetPlusOne( 6 ) = INVALID
findLastBitUnsetPlusOne( 5 ) = 4u
findLastBitUnsetPlusOne( 4 ) = 2u
findLastBitUnsetPlusOne( 3 ) = 2u
findLastBitUnsetPlusOne( 2 ) = 1u
findLastBitUnsetPlusOne( 1 ) = 5u (capacity, not found)
findLastBitUnsetPlusOne( 0 ) = INVALID
|
- Returns
- If all bits are set (i.e. all 1s): Returns this->capacity() If at least one bit is unset: The index to the last set unbit. Return range is [0; capacity)
◆ numBitsSet()
size_t Ogre::bitset64::numBitsSet |
( |
const size_t |
positionEnd | ) |
const |
|
inline |
Returns the number of bits that are set between range [0; positionEnd).
◆ reset()
void Ogre::bitset64::reset |
( |
size_t |
bitsCapacity | ) |
|
|
inline |
◆ set()
void Ogre::bitset64::set |
( |
const size_t |
position | ) |
|
|
inline |
Sets bit at 'position' to 1.
- Parameters
-
position | Value in range [0; _N) |
◆ setAll()
void Ogre::bitset64::setAll |
( |
| ) |
|
|
inline |
◆ setAllUntil()
void Ogre::bitset64::setAllUntil |
( |
size_t |
position | ) |
|
|
inline |
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
- Parameters
-
◆ setValue()
void Ogre::bitset64::setValue |
( |
const size_t |
position, |
|
|
const bool |
bValue |
|
) |
| |
|
inline |
Sets bit at 'position'.
- Parameters
-
position | Value in range [0; _N) |
bValue | |
◆ test()
bool Ogre::bitset64::test |
( |
const size_t |
position | ) |
const |
|
inline |
Returns true if bit at 'position' is 1.
- Parameters
-
position | Value in range [0; _N) |
◆ unset()
void Ogre::bitset64::unset |
( |
const size_t |
position | ) |
|
|
inline |
Sets bit at 'position' to 0.
- Parameters
-
position | Value in range [0; _N) |
The documentation for this class was generated from the following file: