Skip to main content

BitSet

BitSet is a set of bits that can be set, cleared and queried.

Methods


Set()

@classmethod
def Set(
i: uint
)

Sets the bit at the specified index. Call this method to mark a particular bit as active or true.

Parameters

NameTypeDescription
iuintThe unsigned integer index of the bit to set.

Clear()

@classmethod
def Clear(
i: uint
)

Clears the bit at the specified index. Use this method to mark a particular bit as inactive or false.

Parameters

NameTypeDescription
iuintThe unsigned integer index of the bit to clear.

IsSet()

@classmethod
def IsSet(
i: uint
) - > bool

Checks if the bit at the specified index is set. Call this method to determine the state (true or false) of a specific bit.

Parameters

NameTypeDescription
iuintThe unsigned integer index of the bit to check.

Returns

TypeDescription
boolA boolean indicating whether the bit at the given index is set (true) or not (false).

BlockCount()

@classmethod
def BlockCount() - > int

Retrieves the number of blocks currently used by the BitSet. This indicates the memory footprint in terms of blocks.

Returns

TypeDescription
intThe integer count of blocks that comprise the BitSet.

Cap()

@classmethod
def Cap() - > uint

Returns the maximum number of bits that can be stored in the BitSet without reallocating memory. This represents the current capacity.

Returns

TypeDescription
uintThe unsigned integer representing the total capacity of the BitSet in bits.

DeepCopyInto()

@classmethod
def DeepCopyInto(
out: *BitSet
)

Performs a deep copy of the current BitSet's contents into another provided BitSet instance. Use this to efficiently transfer the state of one BitSet to another.

Parameters

NameTypeDescription
out*BitSetA pointer to the destination BitSet into which the current BitSet's data will be copied.

DeepCopy()

@classmethod
def DeepCopy() - > [BitSet](bitset.md?sid=flytestdlib_bitarray_bitset)

Creates and returns a new BitSet that is a deep copy of the current BitSet. This is useful when an independent, identical copy of the BitSet is needed.

Returns

TypeDescription
[BitSet](bitset.md?sid=flytestdlib_bitarray_bitset)A new BitSet instance containing an exact, independent copy of the original BitSet's data.