Bitset Class

A variable length container of bits implemented as a List of ulongs.

Setting, resetting and accessing a bit takes constant time.

Definition

Line 10 of System.Base/Bitset.cm

Constructors & Destructor

public nothrow Bitset()
public Bitset(const String<char>& bits_)
public Bitset(long numBits_)

Member Functions

public nothrow bool All() const
public nothrow bool Any() const
public inline nothrow List<ulong>& Bits() const
public void CheckPos(long pos)
public nothrow void Clear()
public inline nothrow long Count() const
public nothrow void Flip()
public inline nothrow void Flip(long pos)
public inline nothrow long LastBlockStartIndex() const
public nothrow bool None() const
public inline nothrow long NumBits() const
public inline nothrow long NumFullBlocks() const
public nothrow void Reset()
public inline void Reset(long pos)
public void Resize(long numBits_)
public nothrow void Set()
public inline void Set(long pos)
public nothrow void Set(long pos, bool bit)
public inline nothrow bool Test(long pos) const
public nothrow String<char> ToString() const
public inline nothrow bool operator[](long index) const

Constants

private const ulong allOne = cast
private const ulong blockMask = 63u
private const long blockSize = 64

Member Variables

private List<ulong> bits
private long numBits

Constructor& Destructor Details

Bitset Constructor

public nothrow Bitset()

Definition
Line 12 of System.Base/Bitset.cm


Bitset Constructor

public Bitset(const String<char>& bits_)

Definition
Line 27 of System.Base/Bitset.cm


Bitset Constructor

public Bitset(long numBits_)

Definition
Line 23 of System.Base/Bitset.cm


Member Function Details

All Member Function

public nothrow bool All()

Definition
Line 138 of System.Base/Bitset.cm


Any Member Function

public nothrow bool Any()

Definition
Line 157 of System.Base/Bitset.cm


Bits Member Function

public inline nothrow List<ulong>& Bits()

Definition
Line 216 of System.Base/Bitset.cm


CheckPos Member Function

public void CheckPos(long pos)

Definition
Line 84 of System.Base/Bitset.cm


Clear Member Function

public nothrow void Clear()

Definition
Line 43 of System.Base/Bitset.cm


Count Member Function

public inline nothrow long Count()

Definition
Line 48 of System.Base/Bitset.cm


Flip Member Function

public nothrow void Flip()

Definition
Line 114 of System.Base/Bitset.cm


Flip Member Function

public inline nothrow void Flip(long pos)

Definition
Line 122 of System.Base/Bitset.cm


LastBlockStartIndex Member Function

public inline nothrow long LastBlockStartIndex()

Definition
Line 228 of System.Base/Bitset.cm


None Member Function

public nothrow bool None()

Definition
Line 176 of System.Base/Bitset.cm


NumBits Member Function

public inline nothrow long NumBits()

Definition
Line 212 of System.Base/Bitset.cm


NumFullBlocks Member Function

public inline nothrow long NumFullBlocks()

Definition
Line 220 of System.Base/Bitset.cm


Reset Member Function

public nothrow void Reset()

Definition
Line 76 of System.Base/Bitset.cm


Reset Member Function

public inline void Reset(long pos)

Definition
Line 97 of System.Base/Bitset.cm


Resize Member Function

public void Resize(long numBits_)

Definition
Line 52 of System.Base/Bitset.cm


Set Member Function

public nothrow void Set()

Definition
Line 68 of System.Base/Bitset.cm


Set Member Function

public inline void Set(long pos)

Definition
Line 91 of System.Base/Bitset.cm


Set Member Function

public nothrow void Set(long pos, bool bit)

Definition
Line 103 of System.Base/Bitset.cm


Test Member Function

public inline nothrow bool Test(long pos)

Definition
Line 132 of System.Base/Bitset.cm


ToString Member Function

public nothrow String<char> ToString()

Definition
Line 195 of System.Base/Bitset.cm


operator[] Member Function

public inline nothrow bool operator[](long index)

Definition
Line 128 of System.Base/Bitset.cm