runtimepy.primitives.field package#
Subpackages#
- runtimepy.primitives.field.manager package
- Submodules
- runtimepy.primitives.field.manager.base module
BitFieldsManagerBase
BitFieldsManagerBase.add()
BitFieldsManagerBase.add_field()
BitFieldsManagerBase.asdict()
BitFieldsManagerBase.encode()
BitFieldsManagerBase.get()
BitFieldsManagerBase.get_field()
BitFieldsManagerBase.get_fields()
BitFieldsManagerBase.get_flag()
BitFieldsManagerBase.has_field()
BitFieldsManagerBase.set()
BitFieldsManagerBase.values()
fields_to_dict()
fields_to_file()
- Module contents
Submodules#
runtimepy.primitives.field.fields module#
A module implementing a data structure for managing multiple bit fields.
- class runtimepy.primitives.field.fields.BitFields(data: dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]] = None, schemas: SchemaMap = None, dest_attr: str = 'data', verify: bool = True)[source]#
Bases:
RuntimepyDictCodec
A class for managing bit fields and flags from dictionary data.
- asdict() dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]] [source]#
Get these bit fields as a dictionary.
- curr_index: int#
- field(name: str, width: int, index: int = None, enum: str | int = None, description: str = None, **kwargs) BitField [source]#
Create a new bit field.
- flag(name: str, index: int = None, enum: str | int = None, description: str = None, **kwargs) BitFlag [source]#
Create a new bit flag.
- init(data: dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]]) None [source]#
Perform implementation-specific initialization.
- property names: Iterator[str]#
Iterate over names mapping to individual fields.
- classmethod new(value: type[Int8Primitive | Int16Primitive | Int32Primitive | Int64Primitive | Uint8Primitive | Uint16Primitive | Uint32Primitive | Uint64Primitive | HalfPrimitive | FloatPrimitive | DoublePrimitive | BooleanPrimitive] | str | Int8Primitive | Int16Primitive | Int32Primitive | Int64Primitive | Uint8Primitive | Uint16Primitive | Uint32Primitive | Uint64Primitive | HalfPrimitive | FloatPrimitive | DoublePrimitive | BooleanPrimitive = 'uint8') T [source]#
Create a new bit-field storage entity.
Module contents#
A module implementing bit flags and fields.
- class runtimepy.primitives.field.BitField(name: str, raw: Uint8Primitive | Uint16Primitive | Uint32Primitive | Uint64Primitive, index: int, width: int, enum: str | int = None, commandable: bool = False, description: str = None)[source]#
Bases:
BitFieldBase
,RegexMixin
,EnumMixin
A class managing a portion of an unsigned-integer primitive.
- asdict() dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]] [source]#
Get this field as a dictionary.
- name_regex: _Pattern | None = re.compile('^[a-zA-Z0-9_.-]+$')#
- class runtimepy.primitives.field.BitFieldBase(raw: Uint8Primitive | Uint16Primitive | Uint32Primitive | Uint64Primitive, index: int, width: int, commandable: bool = False, description: str = None)[source]#
Bases:
object
A simple bit-field implementation.
- class runtimepy.primitives.field.BitFlag(name: str, raw: Uint8Primitive | Uint16Primitive | Uint32Primitive | Uint64Primitive, index: int, enum: str | int = None, commandable: bool = False, description: str = None)[source]#
Bases:
BitField
A bit field that is always a single bit.