Class: BitField

Layout~BitField(container, bits, propertyopt)

Represent a sequence of bits within a BitStructure.

All bit field values are represented as unsigned integers.

NOTE User code should not invoke this constructor directly. Use the container addField helper method.

NOTE BitField instances are not instances of Layout since span measures 8-bit units.

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.

Source:

Members

bits

The span of this value in bits.

Source:

container

The BitStructure instance to which this bit field belongs.

Source:

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.

Source:

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.

Source:

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.

Source:

wordMask

A mask of bits isolating the field value within the containing packed unsigned integer.

Source:

Methods

decode()

Store a value into the corresponding subsequence of the containing bit field.

Source:

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.

Source: