Name
BitVector32
Synopsis
This structure defines a lightweight
bit vector that
can store booleans and 16-bit integers in a 32-bit structure.
Sections hold single 16-bit integer values and are
the building blocks of a BitVector32. Sections are created with
CreateSection( ). Each section is constructed with
a maximum value for the integer it can hold. Except for the initial
section, each subsequent section must provide a reference to the
previous section in addition to the maximum value.
The indexer takes two forms. When indexed by a section name, that
section’s value can be set or retrieved. When
indexed by an integer that specifies a bit in the vector, you can
determine whether that bit is set or not (true or
false).
public struct BitVector32 { // Public Conastructors public BitVector32(BitVector32value); public BitVector32(intdata); // Public Instance Properties public int Data{get; } public int this(Section section)){set; get; } public bool this[intbit]{set; get; } // Public Static Methods public static int CreateMask( ); public static int CreateMask(intprevious); public static Section CreateSection(shortmaxValue); public static Section CreateSection(shortmaxValue, Sectionprevious); public static string ToString(BitVector32value); // Public Instance Methods public override bool Equals(objecto); // overrides ValueType public override int GetHashCode( ); // overrides ValueType public override string ToString( ); // overrides ValueType }
Hierarchy
System.Object
→
System.ValueType ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access