BitStruct<K extends BitField> extension type

BitStruct — zero-cost keyed view over a BitData object.

Bits + BitField keys, [] operators, returning int

Extension type analogue of StructData for the bit domain. Provides Structure<K, int> access via BitField keys over a BitData. The wrapped BitData's storage is unchanged; all dispatch goes through BitField.getIn / BitField.setIn.

Wrap around BitData instead of Bits to pass mutable and immutable variants to BitData layer extending BitData would need to handle mutable and immutable variants,

on
Implemented types

Constructors

BitStruct(BitData bitData)
const
BitStruct.from(int value)
BitStruct.fromMap(Map<K, int> map)

Properties

bitData BitData
final
bits Bits
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value int
no setterinherited
width int
no setter

Methods

field(K key) StructField<K, int>
inherited
fieldAs<R>(Field<R> key) StructField<Field<R>, R>
inherited
fieldOrNull(K key) int?
inherited
fieldsAs(StructForm<K, int> type) Iterable<StructField<K, int>>
inherited
getBits(Bitmask mask) int
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset([bool fill = false]) → void
inherited
setBitAt(int index, int value) → void
inherited
setBits(Bitmask mask, int value) → void
inherited
setBitsAt(int offset, int width, int value) → void
inherited
setBoolAt(int index, bool value) → void
inherited
setByteAt(int index, int value) → void
inherited
setBytesAt(int index, int size, int value) → void
inherited
setEach(Iterable<(Bitmask, int)> entries) → void
inherited
toMapWith(StructForm<K, int> type) Map<K, int>
inherited
toString() String
A string representation of this object.
inherited
toStringAsBinary() String
inherited
toStringAsBits() String
inherited
trySetField(K key, int value) bool
inherited
valuesAs(StructForm<K, int> type) Iterable<int>
inherited
withBits(Bitmask mask, int value) BitData
inherited
withEach(Iterable<(Bitmask, int)> entries) BitData
inherited
withField(K key, int value) BitStruct<K>
withFields(Iterable<StructField<K, int>> fields) BitStruct<K>
withMap(Map<K, int> map) BitStruct<K>

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](K key) int
inherited
operator []=(K key, int value) → void
inherited