Simple implementation of a BitSet.
More...
#include <bitset.h>
- Author
- Joris Guisson
Simple implementation of a BitSet, can only turn on and off bits. BitSet's are used to indicate which chunks we have or not.
Definition at line 36 of file bitset.h.
◆ BitSet() [1/3]
bt::BitSet::BitSet |
( |
Uint32 |
num_bits = 8 | ) |
|
Constructor.
- Parameters
-
num_bits | The number of bits |
◆ BitSet() [2/3]
bt::BitSet::BitSet |
( |
const Uint8 * |
data, |
|
|
Uint32 |
num_bits |
|
) |
| |
Manually set data.
- Parameters
-
data | The data |
num_bits | The number of bits |
◆ BitSet() [3/3]
bt::BitSet::BitSet |
( |
const BitSet & |
bs | ) |
|
Copy constructor.
- Parameters
-
- Returns
◆ andBitSet()
void bt::BitSet::andBitSet |
( |
const BitSet & |
other | ) |
|
and this BitSet with another.
- Parameters
-
◆ clear()
void bt::BitSet::clear |
( |
| ) |
|
◆ get()
bool bt::BitSet::get |
( |
Uint32 |
i | ) |
const |
|
inline |
Get the value of a bit, false means 0, true 1.
- Parameters
-
Definition at line 162 of file bitset.h.
Referenced by set().
◆ includesBitSet()
bool bt::BitSet::includesBitSet |
( |
const BitSet & |
other | ) |
|
see if this BitSet includes another.
- Parameters
-
◆ invert()
void bt::BitSet::invert |
( |
| ) |
|
◆ operator!=()
bool bt::BitSet::operator!= |
( |
const BitSet & |
bs | ) |
const |
|
inline |
Opposite of operator ==
Definition at line 152 of file bitset.h.
◆ operator-()
Subtraction operator.
- Parameters
-
bs | BitSet to subtract from this one |
- Returns
- difference
◆ operator-=()
Subtraction assignment operator.
- Parameters
-
bs | BitSet to copy and subtract from this one |
- Returns
- *this
◆ operator=()
Assignment operator.
- Parameters
-
- Returns
- *this
◆ operator==()
bool bt::BitSet::operator== |
( |
const BitSet & |
bs | ) |
const |
Check for equality of bitsets
- Parameters
-
- Returns
- true if equal
◆ orBitSet()
void bt::BitSet::orBitSet |
( |
const BitSet & |
other | ) |
|
or this BitSet with another.
- Parameters
-
◆ set()
void bt::BitSet::set |
( |
Uint32 |
i, |
|
|
bool |
on |
|
) |
| |
|
inline |
Set the value of a bit, false means 0, true 1.
- Parameters
-
i | Index of Bit |
on | False means 0, true 1 |
Definition at line 173 of file bitset.h.
References get().
◆ updateNumOnBits()
void bt::BitSet::updateNumOnBits |
( |
| ) |
|
Update the number of on bits
The documentation for this class was generated from the following file: