kget
BitSet Class Reference
#include <bitset.h>
Detailed Description
Simple implementation of a BitSet
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 32 of file core/bitset.h.
Public Member Functions | |
| bool | allOn () const |
| BitSet (const BitSet &bs) | |
| BitSet (const quint8 *data, quint32 num_bits) | |
| BitSet (quint32 num_bits=8) | |
| void | clear () |
| bool | get (quint32 i) const |
| quint8 * | getData () |
| const quint8 * | getData () const |
| quint32 | getNumBits () const |
| quint32 | getNumBytes () const |
| bool | isNull () const |
| quint32 | numOnBits () const |
| bool | operator!= (const BitSet &bs) |
| BitSet & | operator= (const BitSet &bs) |
| bool | operator== (const BitSet &bs) |
| void | orBitSet (const BitSet &other) |
| void | set (quint32 i, bool on) |
| void | setAll (bool on) |
| virtual | ~BitSet () |
Static Public Attributes | |
| static BitSet | null |
Constructor & Destructor Documentation
| BitSet::BitSet | ( | quint32 | num_bits = 8 |
) |
| BitSet::BitSet | ( | const quint8 * | data, | |
| quint32 | num_bits | |||
| ) |
Manually set data.
- Parameters:
-
data The data num_bits The number of bits
Definition at line 34 of file core/bitset.cpp.
| BitSet::BitSet | ( | const BitSet & | bs | ) |
Copy constructor.
- Parameters:
-
bs BitSet to copy
- Returns:
Definition at line 49 of file core/bitset.cpp.
| BitSet::~BitSet | ( | ) | [virtual] |
Definition at line 55 of file core/bitset.cpp.
Member Function Documentation
| bool BitSet::allOn | ( | ) | const |
| void BitSet::clear | ( | ) |
| bool BitSet::get | ( | quint32 | i | ) | const [inline] |
Get the value of a bit, false means 0, true 1.
- Parameters:
-
i Index of Bit
Definition at line 122 of file core/bitset.h.
| quint8* BitSet::getData | ( | ) | [inline] |
Definition at line 81 of file core/bitset.h.
| const quint8* BitSet::getData | ( | ) | const [inline] |
Definition at line 80 of file core/bitset.h.
| quint32 BitSet::getNumBits | ( | ) | const [inline] |
Definition at line 79 of file core/bitset.h.
| quint32 BitSet::getNumBytes | ( | ) | const [inline] |
Definition at line 78 of file core/bitset.h.
| bool BitSet::isNull | ( | ) | const [inline] |
| quint32 BitSet::numOnBits | ( | ) | const [inline] |
| bool BitSet::operator!= | ( | const BitSet & | bs | ) | [inline] |
Assignment operator.
- Parameters:
-
bs BitSet to copy
- Returns:
- *this
Definition at line 62 of file core/bitset.cpp.
| bool BitSet::operator== | ( | const BitSet & | bs | ) |
Check for equality of bitsets.
- Parameters:
-
bs BitSet to compare
- Returns:
- true if equal
Definition at line 101 of file core/bitset.cpp.
| void BitSet::orBitSet | ( | const BitSet & | other | ) |
or this BitSet with another.
- Parameters:
-
other The other BitSet
Definition at line 85 of file core/bitset.cpp.
| void BitSet::set | ( | quint32 | 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 133 of file core/bitset.h.
| void BitSet::setAll | ( | bool | on | ) |
Member Data Documentation
BitSet BitSet::null [static] |
Definition at line 119 of file core/bitset.h.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference