#include <basebitset.h>
BaseBitSet documentation.
Public Types | |
using | IntType = UInt |
Static Public Member Functions | |
static Result< void > | DescribeIO (const DataSerializeInterface &stream) |
static Bool | IsSet (const Block< const IntType > &raw, Int index) |
Private Member Functions | |
MAXON_DISALLOW_COPY_AND_ASSIGN (BaseBitSet) | |
void | RemoveTrailingZeroes () |
Int | CountBitsInWord (IntType word) const |
Private Attributes | |
BaseArray< IntType, BASEARRAY_DEFAULT_CHUNK_SIZE, BASEARRAYFLAGS::MOVEANDCOPYOBJECTS, ALLOCATOR > | _bits |
Static Private Attributes | |
static const UInt | INT_WIDTH_EXPONENT |
static const IntType | INT_MASK |
static const IntType | INT_WIDTH |
|
default |
Default constructor.
BaseBitSet | ( | BaseBitSet< ALLOCATOR > && | rhs | ) |
Move constructor
[in] | rhs | The bitset which is moved. |
|
private |
BaseBitSet& operator= | ( | BaseBitSet< ALLOCATOR > && | rhs | ) |
Move assignment operator
[in] | rhs | The bitset which is moved. |
Checks if a bit is set in the bitset.
[in] | index | Input index of the bit which should be set. |
index
is set, otherwise false. MAXON_ATTRIBUTE_FORCE_INLINE Bool IsSetUnchecked | ( | UInt | index | ) | const |
Checks if a bit is set in the bitset. It does not check if the underlying array is big enough to contain a bit at this index.
[in] | index | Input index of the bit which should be set. |
MAXON_ATTRIBUTE_FORCE_INLINE void ClearUnchecked | ( | UInt | index | ) |
Clears a bit in the bitset. It does not check if the underlying array is big enough to contain a bit at this index.
[in] | index | Input index of the bit which should be set. |
Sets the bit at a given index and returns if it was actually set.
[in] | index | Input index of the bit which should be set. |
[out] | isSet | This will be set to true if the bit is actually set, otherwise to false. |
Bool IsEmpty | ( | ) | const |
Check if the bitset is empty.
Bool IsPopulated | ( | ) | const |
Check if the bitset contains at least one element.
Sets the bit at a given index.
[in] | index | Input index of the bit which should be set. |
void SetUnchecked | ( | UInt | index | ) |
Sets the bit at a given index. It does not check if the underlying array is big enough to contain a bit at this index.
[in] | index | Input index of the bit which should be set. |
Sets the bit at a given index. It does not check if the underlying array is big enough to contain a bit at this index.
[in] | index | Input index of the bit which should be set. |
Sets all bits in the given range. first must be smaller or equal to last.
[in] | first | First element to set. |
[in] | last | Last element to set. |
Sets all bits in the given range. first must be smaller or equal to last.
[in] | first | First element to set. |
[in] | last | Last element to set. |
Clears the bit at a given index and returns if it was actually cleared.
[in] | index | Input index of the bit which should be cleared. |
[out] | cleared | This will be set to true if the bit is actually cleared, otherwise to false. |
void Clear | ( | UInt | index | ) |
Clears the bit at a given index.
[in] | index | Input index of the bit which should be cleared. |
void Reset | ( | ) |
Resets the bitset.
HashInt GetHashCode | ( | ) | const |
Gets the hash code for the bitset, using GetHashCode() of the underlying BaseArray
.
Bool operator== | ( | const BaseBitSet< ALLOCATOR > & | rhs | ) | const |
Compares two bitsets, using the compare operator of the underlying BaseArray
.
[in] | rhs | Input bitset rhs. |
this == rhs
. BaseBitSet<ALLOCATOR>& operator|= | ( | const BaseBitSet< ALLOCATOR > & | rhs | ) |
Calculates the bitwise OR of this bitset and another bitset.
[in] | rhs | Input bitset rhs. |
BaseBitSet<ALLOCATOR>& operator&= | ( | const BaseBitSet< ALLOCATOR > & | rhs | ) |
Calculates the bitwise AND of this bitset and another bitset.
[in] | rhs | Input bitset rhs. |
Result<void> CopyFrom | ( | const BaseBitSet< ALLOCATOR > & | src | ) |
Copies the data from another bitset, using CopyFrom()
of the underlying BaseArray
[in] | src | Source from which the data is taken |
Result<void> MergeOr | ( | const BaseBitSet< ALLOCATOR > & | src | ) |
Merges the data from another bitset with logical OR. If the other bitset is larger it will resize this one.
[in] | src | Source from which the data is merged. |
Result<void> MergeOrNot | ( | const BaseBitSet< ALLOCATOR > & | src | ) |
Merges the data from another bitset with logical OR NOT. If the other bitset is larger it will resize this one.
[in] | src | Source from which the data is merged. |
Result<void> MergeAnd | ( | const BaseBitSet< ALLOCATOR > & | src | ) |
Merges the data from another bitset with logical AND. If the other bitset is larger it will resize this one.
[in] | src | Source from which the data is merged. |
Result<void> MergeAndNot | ( | const BaseBitSet< ALLOCATOR > & | src | ) |
Merges the data from another bitset with logical AND NOT. If the other bitset is larger it will resize this one.
[in] | src | Source from which the data is merged. |
Result<void> MergeXOr | ( | const BaseBitSet< ALLOCATOR > & | src | ) |
Merges the data from another bitset with logical XOR. If the other bitset is larger it will resize this one.
[in] | src | Source from which the data is merged. |
void Invert | ( | ) |
Inverts all bits of the BaseBitSet.
Initializes the array to have at least as much space to contain a certain amount of bits.
[in] | count | Number of bits. |
Counts the bits in the selection
[in] | first | Index from which conting starts. |
[in] | last | Index where counting ends. |
Int GetCapacity | ( | ) | const |
Get The maximum capacity of the BitSet
|
static |
Describe all elements of this class for I/O operations.
[in] | stream | The stream that is used to register the class members. |
|
private |
Removes trailing zero bits in the underlying BaseArray
Counts the bits of a word.
[in] | word | Word in which the bits have to be counted. |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |