Table of Contents

Struct SpanBitSet

Namespace
Misaki.HighPerformance.LowLevel.Collections
Assembly
Misaki.HighPerformance.LowLevel.dll

The SpanBitSet struct represents a non resizable collection of bits. Used to set, check and clear bits on a allocated UnsafeBitSet or on the stack.

public readonly ref struct SpanBitSet : IEquatable<SpanBitSet>
Implements
Inherited Members

Constructors

SpanBitSet(Span<uint>)

Initializes a new instance of the UnsafeBitSet class.

public SpanBitSet(Span<uint> bits)

Parameters

bits Span<uint>

Methods

AsSpan()

Creates a Span<T> to access the Misaki.HighPerformance.LowLevel.Collections.SpanBitSet._bits.

public Span<uint> AsSpan()

Returns

Span<uint>

The hash.

AsSpan(Span<uint>, bool)

Copies the bits into a Span<T> and returns a slice containing the copied Misaki.HighPerformance.LowLevel.Collections.SpanBitSet._bits.

public Span<uint> AsSpan(Span<uint> span, bool zero = true)

Parameters

span Span<uint>
zero bool

Returns

Span<uint>

The hash.

ClearAll()

Clears all set bits.

public void ClearAll()

ClearBit(int)

Clears the bit at the given index.

public void ClearBit(int index)

Parameters

index int

The index.

Equals(SpanBitSet)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(SpanBitSet other)

Parameters

other SpanBitSet

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

GetIterator()

public SpanBitSet.Iterator GetIterator()

Returns

SpanBitSet.Iterator

IsSet(int)

Checks whether a bit is set at the index.

public bool IsSet(int index)

Parameters

index int

The index.

Returns

bool

True if it is, otherwise false

NextSetBit(int)

public int NextSetBit(int startIndex)

Parameters

startIndex int

Returns

int

SetAll()

Sets all bits.

public void SetAll()

SetBit(int)

Sets a bit at the given index. Resizes its internal array if necessary.

public void SetBit(int index)

Parameters

index int

The index.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.