| |
- runtimepy.schemas.RuntimepyDictCodec(vcorelib.dict.codec.DictCodec)
-
- BitFields
class BitFields(runtimepy.schemas.RuntimepyDictCodec) |
|
BitFields(data: Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]] = None, schemas: vcorelib.schemas.base.SchemaMap = None, dest_attr: str = 'data', verify: bool = True) -> None
A class for managing bit fields and flags from dictionary data. |
|
- Method resolution order:
- BitFields
- runtimepy.schemas.RuntimepyDictCodec
- vcorelib.dict.codec.DictCodec
- vcorelib.dict.codec.JsonCodec
- abc.ABC
- vcorelib.schemas.mixins.SchemaMixin
- builtins.object
Methods defined here:
- __getitem__(self, key: Union[str, int]) -> runtimepy.primitives.field.BitField
- Obtain a bit-field.
- asdict(self) -> Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]]
- Get these bit fields as a dictionary.
- claim_field(self, field: runtimepy.primitives.field.BitField) -> runtimepy.primitives.field.BitField
- Claim a bit field.
- field(self, name: str, width: int, index: int = None, enum: Union[str, int] = None, description: str = None, **kwargs) -> runtimepy.primitives.field.BitField
- Create a new bit field.
- finalize(self) -> None
- Finalize the fields so that new fields can't be added.
- flag(self, name: str, index: int = None, enum: Union[str, int] = None, description: str = None, **kwargs) -> runtimepy.primitives.field.BitFlag
- Create a new bit flag.
- get_field(self, key: Union[str, int]) -> Optional[runtimepy.primitives.field.BitField]
- Attempt to get a bit-field from this entity.
- init(self, data: Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]]) -> None
- Perform implementation-specific initialization.
- pad(self, width: int = 1, index: int = None, val: int = 0) -> int
- Pad bits in this primitive so they can't be allocated.
Class methods defined here:
- new(value: Union[type[Union[runtimepy.primitives.int.Int8Primitive, runtimepy.primitives.int.Int16Primitive, runtimepy.primitives.int.Int32Primitive, runtimepy.primitives.int.Int64Primitive, runtimepy.primitives.int.Uint8Primitive, runtimepy.primitives.int.Uint16Primitive, runtimepy.primitives.int.Uint32Primitive, runtimepy.primitives.int.Uint64Primitive, runtimepy.primitives.float.HalfPrimitive, runtimepy.primitives.float.FloatPrimitive, runtimepy.primitives.float.DoublePrimitive, runtimepy.primitives.bool.BooleanPrimitive]], str] = 'uint8') -> ~T from abc.ABCMeta
- Create a new bit-field storage entity.
Readonly properties defined here:
- names
- Iterate over names mapping to individual fields.
Data and other attributes defined here:
- __abstractmethods__ = frozenset()
- __annotations__ = {'_finalized': <class 'bool'>, 'curr_index': <class 'int'>}
Data and other attributes inherited from runtimepy.schemas.RuntimepyDictCodec:
- default_schemas = {'StructConfig': <vcorelib.schemas.json.JsonSche...chemas.json.JsonSchema object at 0x7fc2553047d0>}
Methods inherited from vcorelib.dict.codec.DictCodec:
- __init__(self, data: Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]] = None, schemas: vcorelib.schemas.base.SchemaMap = None, dest_attr: str = 'data', verify: bool = True) -> None
- Initialize this instance.
Class methods inherited from vcorelib.dict.codec.DictCodec:
- create(data: Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]] = None, schemas: vcorelib.schemas.base.SchemaMap = None, dest_attr: str = 'data', verify: bool = True) -> ~V from abc.ABCMeta
- A factory method to create an instance.
Methods inherited from vcorelib.dict.codec.JsonCodec:
- __copy__(self: ~T) -> ~T
- Create another instance based on this instance's data.
- __eq__(self, other) -> bool
- Determine if this instance is equal to another.
- __str__(self) -> str
- Use the dictionary representation of this instance for string
representation.
- encode(self, pathlike: Union[pathlib.Path, str, NoneType], arbiter: vcorelib.io.arbiter.DataArbiter = <vcorelib.io.arbiter.DataArbiter object at 0x7fc255eb0b30>, **kwargs) -> Tuple[bool, int]
- Encode this object instance to a file.
Class methods inherited from vcorelib.dict.codec.JsonCodec:
- decode(pathlike: Union[pathlib.Path, str, NoneType], arbiter: vcorelib.io.arbiter.DataArbiter = <vcorelib.io.arbiter.DataArbiter object at 0x7fc255eb0b30>, schemas: vcorelib.schemas.base.SchemaMap = None, dest_attr: str = 'data', verify: bool = True, require_success: bool = True, default_data: Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]] = None, **kwargs) -> ~T from abc.ABCMeta
- Decode an object instance from data loaded from a file.
- file_cache(pathlike: Union[pathlib.Path, str, NoneType], arbiter: vcorelib.io.arbiter.DataArbiter = <vcorelib.io.arbiter.DataArbiter object at 0x7fc255eb0b30>, encode_kwargs: Dict[str, Any] = None, require_success: bool = False, **kwargs) -> Iterator[~T] from abc.ABCMeta
- Manage an instance of this class as a disk-backed file.
- normalize(data: Union[Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]], ~T]) -> ~T from abc.ABCMeta
- Ensure that some object is an instance of this class.
Data descriptors inherited from vcorelib.dict.codec.JsonCodec:
- __dict__
- dictionary for instance variables
- __weakref__
- list of weak references to the object
Data and other attributes inherited from vcorelib.dict.codec.JsonCodec:
- __hash__ = None
Methods inherited from vcorelib.schemas.mixins.SchemaMixin:
- validate(self, valid_attr: str = 'data') -> None
- Validate an instance attribute based on this instance's schema.
Class methods inherited from vcorelib.schemas.mixins.SchemaMixin:
- schema_name() -> str from abc.ABCMeta
- A default name for this class's schema.
| |