Constructor
new BitField(container, bits, propertyopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
container |
module:Layout~BitStructure | initializer for container. |
|
bits |
Number | initializer for bits. |
|
property |
string |
<optional> |
initializer for property. |
Members
bits
The span of this value in bits.
container
The BitStructure instance to which this bit field belongs.
property
The property name used when this bitfield is represented in an Object.
Intended to be functionally equivalent to Layout#property.
If left undefined the corresponding span of bits will be treated as padding: it will not be mutated by encode nor represented as a property in the decoded Object.
start
The offset of the value within the containing packed unsigned integer. The least significant bit of the packed value is at offset zero, regardless of bit ordering used.
valueMask
A mask of bits bits isolating value bits that fit within the field.
That is, it masks a value that has not yet been shifted into position within its containing packed integer.
wordMask
A mask of bits isolating the field value within the containing packed unsigned integer.
Methods
decode()
Store a value into the corresponding subsequence of the containing bit field.
encode()
Store a value into the corresponding subsequence of the containing bit field.
NOTE This is not a specialization of Layout.encode and there is no return value.