As with {@link BitStructure#addField|addField} for single-bit
fields with boolean
value representation.
initializer for {@link Layout#property|property}.
Register a new bitfield with a containing bit structure. The resulting bitfield is returned.
initializer for {@link BitField#bits|bits}.
initializer for {@link Layout#property|property}.
Implement {@link Layout#encode|encode} for BitStructure.
If src
is missing a property for a member with a defined {@link
Layout#property|property} the corresponding region of the packed
value is left unmodified. Unused bits are also left unmodified.
Get access to the bit field for a given property.
the bit field of interest.
property
, or
undefined if there is no such property.Create an object from layout properties and an array of values.
NOTE This function returns undefined
if invoked on a layout
that does not return its value as an Object. Objects are
returned for things that are a Structure, which includes
variant layouts if they are structures, and
excludes Unions. If you want this feature for a union
you must use getVariant to select the
desired layout.
an array of values that correspond to the default order for properties. As with {@link Layout#decode|decode} layout elements that have no property name are skipped when iterating over the array values. Only the top-level properties are assigned; arguments are not assigned to properties of contained layouts. Any unused values are ignored.
Calculate the span of a specific instance of a layout.
the buffer that contains an encoded instance.
Function to create an Object into which decoded properties will be written.
Used only for layouts that {@link Layout#decode|decode} to Object instances, which means:
If left undefined the JavaScript representation of these layouts will be Object instances.
Replicate the layout using a new property.
This function must be used to get a structurally-equivalent layout with a different name since all Layout instances are immutable.
NOTE This is a shallow copy. All fields except {@link Layout#property|property} are strictly equal to the origin layout.
the value for {@link Layout#property|property} in the replica.
property
.Generated using TypeDoc
Contain a sequence of bit fields as an unsigned integer.
Factory: {@link module:Layout.bits|bits}
This is a container element; within it there are BitField instances that provide the extracted properties. The container simply defines the aggregate representation and its bit ordering. The representation is an object containing properties with numeric or Boolean values.
BitFields are added with the {@link BitStructure#addField|addField} and {@link BitStructure#addBoolean|addBoolean} methods.
initializer for {@link BitStructure#word|word}. The parameter must be an instance of UInt (or UIntBE) that is no more than 4 bytes wide.
true
if the bit numbering starts at the most significant bit of the containing word;false
(default) if it starts at the least significant bit of the containing word. If the parameter at this position is a string andproperty
isundefined
the value of this argument will instead be used as the value ofproperty
.initializer for {@link Layout#property|property}.