BitStructBase<T extends BitStructBase<T, K>, K extends BitField> class abstract

///////////////////////////////////////////////////////////////////////////// BitStructBase — abstract base for user-defined bit struct subtypes. Analogue of StructBase for the bit domain.

Unlike BitStruct (which wraps an external BitData), subclasses of BitStructBase hold data directly in their own fields. BitField.getIn / BitField.setIn receive bitData as the host object.

Mixes in MapBase<K, int>, BitFieldMap<K>, and StructureBase<T, K, int> providing: Map operators, serialization via toMap, value equality, and immutable copy helpers via withField / withEntries / withMap.

data returns BitStruct<K>(bitData) — a zero-cost wrapper around bitData — so keyed access delegates through the same Field-based dispatch as StructData. /////////////////////////////////////////////////////////////////////////////

Mixed-in types

Constructors

BitStructBase(BitData bitData)
caller compose for compile time const. const BitStructBase(ConstBits(11))
const
BitStructBase.from(int bits)
BitStructBase.withData(BitStruct<K> data)
const

Properties

bitData BitData
The underlying bit storage. enforced data implementation as direct field
final
bits Bits
getter/setter pair
data BitStruct<K>
Proxy to allow the same keys Object as Structure<K, V> data passed to Keys
no setteroverride
entries Iterable<MapEntry<K, int>>
The map entries of this Map.
no setterinherited
fields Iterable<StructField<K, int>>
no setterinherited
hashCode int
The hash code for this object.
no setteroverride
isEmpty bool
Whether there is no key/value pair in the map.
no setterinherited
isNotEmpty bool
Whether there is at least one key/value pair in the map.
no setterinherited
keys List<K>
The keys of this Map.
no setteroverride
length int
The number of key/value pairs in the map.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
values Iterable<int>
no setterinherited
width int
no setter

Methods

addAll(Map<K, int> other) → void
Adds all key/value pairs of other to this map.
inherited
addEntries(Iterable<MapEntry<K, int>> newEntries) → void
Adds all key/value pairs of newEntries to this map.
inherited
cast<RK, RV>() Map<RK, RV>
Provides a view of this map as having RK keys and RV instances, if necessary.
inherited
clear() → void
Removes all entries from the map.
override
containsKey(Object? key) bool
Whether this map contains the given key.
inherited
containsValue(Object? value) bool
Whether this map contains the given value.
inherited
copyWithData(covariant BitStruct<K> data) → T
Returns an immutable instance with value as bits. Override to return subtype.
field(K key) StructField<K, int>
inherited
fieldAs<R>(Field<R> key) StructField<Field<R>, R>
inherited
fieldOrNull(K key) int?
inherited
forEach(void action(K key, int value)) → void
Applies action to each key/value pair of the map.
inherited
map<K2, V2>(MapEntry<K2, V2> transform(K key, int value)) Map<K2, V2>
Returns a new map where all entries of this map are transformed by the given convert function.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
putIfAbsent(K key, int ifAbsent()) int
Look up the value of key, or add a new entry if it isn't there.
inherited
remove(covariant K key) int
Removes key and its associated value, if present, from the map.
override
removeWhere(bool test(K key, int value)) → void
Removes all entries of this map that satisfy the given test.
inherited
toMap() Map<K, int>
Snapshot as an IndexMap. If K extends Enum, call .toJson() on the result to serialise via EnumMapByName.
override
toString() String
A string representation of this object.
override
toStringAsBinary() String
toStringAsMap() String
toStringAsValues() String
toStringMapEntry([String? name]) MapEntry<String, int>
trySetField(K key, int value) bool
inherited
update(K key, int update(int value), {int ifAbsent()?}) int
Updates the value for the provided key.
inherited
updateAll(int update(K key, int value)) → void
Updates all values.
inherited
withField(K key, int value) → T
withFields(Iterable<StructField<K, int>> entries) → T
withMap(Map<K, int> map) → T

Operators

operator ==(Object other) bool
Bitfields compare by bits value only.
override
operator [](covariant K key) int
inherited
operator []=(covariant K key, int value) → void
inherited