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
-
- MapBase<
K, int> - StructBase<
T, K, int>
- MapBase<
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 StructData<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
otherto this map.inherited -
addEntries(
Iterable< MapEntry< newEntries) → voidK, int> > -
Adds all key/value pairs of
newEntriesto this map.inherited -
cast<
RK, RV> () → Map< RK, RV> -
Provides a view of this map as having
RKkeys andRVinstances, 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
immutableinstance withvalueas 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
actionto 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
convertfunction.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
keyand 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< entries) → TK, int> > -
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