kget
bt::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 36 of file transfer-plugins/bittorrent/libbtcore/util/bitset.h.
Public Member Functions | |
| bool | allOn () const |
| BitSet (const BitSet &bs) | |
| BitSet (const Uint8 *data, Uint32 num_bits) | |
| BitSet (Uint32 num_bits=8) | |
| void | clear () |
| bool | get (Uint32 i) const |
| Uint8 * | getData () |
| const Uint8 * | getData () const |
| Uint32 | getNumBits () const |
| Uint32 | getNumBytes () const |
| bool | isNull () const |
| Uint32 | numOnBits () const |
| bool | operator!= (const BitSet &bs) |
| BitSet & | operator= (const BitSet &bs) |
| bool | operator== (const BitSet &bs) |
| void | orBitSet (const BitSet &other) |
| void | set (Uint32 i, bool on) |
| void | setAll (bool on) |
| virtual | ~BitSet () |
Static Public Attributes | |
| static BitSet | null |
Constructor & Destructor Documentation
| BitSet::BitSet | ( | Uint32 | num_bits = 8 |
) |
Constructor.
- Parameters:
-
num_bits The number of bits
Definition at line 28 of file transfer-plugins/bittorrent/libbtcore/util/bitset.cpp.
Manually set data.
- Parameters:
-
data The data num_bits The number of bits
Definition at line 36 of file transfer-plugins/bittorrent/libbtcore/util/bitset.cpp.
| BitSet::BitSet | ( | const BitSet & | bs | ) |
Copy constructor.
- Parameters:
-
bs BitSet to copy
- Returns:
Definition at line 51 of file transfer-plugins/bittorrent/libbtcore/util/bitset.cpp.
| BitSet::~BitSet | ( | ) | [virtual] |
Definition at line 57 of file transfer-plugins/bittorrent/libbtcore/util/bitset.cpp.
Member Function Documentation
| bool BitSet::allOn | ( | ) | const |
Check if all bit are set to 1.
Definition at line 98 of file transfer-plugins/bittorrent/libbtcore/util/bitset.cpp.
| void BitSet::clear | ( | ) |
Set all bits to 0.
Definition at line 82 of file transfer-plugins/bittorrent/libbtcore/util/bitset.cpp.
| bool BitSet::get | ( | Uint32 | i | ) | const [inline] |
Get the value of a bit, false means 0, true 1.
- Parameters:
-
i Index of Bit
Definition at line 126 of file transfer-plugins/bittorrent/libbtcore/util/bitset.h.
| Uint8* bt::BitSet::getData | ( | ) | [inline] |
Definition at line 85 of file transfer-plugins/bittorrent/libbtcore/util/bitset.h.
| const Uint8* bt::BitSet::getData | ( | ) | const [inline] |
Definition at line 84 of file transfer-plugins/bittorrent/libbtcore/util/bitset.h.
| Uint32 bt::BitSet::getNumBits | ( | ) | const [inline] |
Definition at line 83 of file transfer-plugins/bittorrent/libbtcore/util/bitset.h.
| Uint32 bt::BitSet::getNumBytes | ( | ) | const [inline] |
Definition at line 82 of file transfer-plugins/bittorrent/libbtcore/util/bitset.h.
| bool bt::BitSet::isNull | ( | ) | const [inline] |
See if the BitSet is null.
Definition at line 64 of file transfer-plugins/bittorrent/libbtcore/util/bitset.h.
| Uint32 bt::BitSet::numOnBits | ( | ) | const [inline] |
Get the number of on bits.
Definition at line 88 of file transfer-plugins/bittorrent/libbtcore/util/bitset.h.
| bool bt::BitSet::operator!= | ( | const BitSet & | bs | ) | [inline] |
Opposite of operator ==.
Definition at line 121 of file transfer-plugins/bittorrent/libbtcore/util/bitset.h.
Assignment operator.
- Parameters:
-
bs BitSet to copy
- Returns:
- *this
Definition at line 64 of file transfer-plugins/bittorrent/libbtcore/util/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 103 of file transfer-plugins/bittorrent/libbtcore/util/bitset.cpp.
| void BitSet::orBitSet | ( | const BitSet & | other | ) |
or this BitSet with another.
- Parameters:
-
other The other BitSet
Definition at line 87 of file transfer-plugins/bittorrent/libbtcore/util/bitset.cpp.
| void 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 137 of file transfer-plugins/bittorrent/libbtcore/util/bitset.h.
| void BitSet::setAll | ( | bool | on | ) |
Set all bits on or off.
Definition at line 76 of file transfer-plugins/bittorrent/libbtcore/util/bitset.cpp.
Member Data Documentation
BitSet BitSet::null [static] |
Definition at line 123 of file transfer-plugins/bittorrent/libbtcore/util/bitset.h.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference