| |
- builtins.tuple(builtins.object)
-
- ArrayFragmentSpec
- runtimepy.primitives.serializable.base.Serializable(abc.ABC)
-
- PrimitiveArray
class ArrayFragmentSpec(builtins.tuple) |
|
ArrayFragmentSpec(index_start: int, index_end: int, byte_start: int, byte_end: int)
Information that can be used to construct an array fragment. |
|
- Method resolution order:
- ArrayFragmentSpec
- builtins.tuple
- builtins.object
Methods defined here:
- __getnewargs__(self)
- Return self as a plain tuple. Used by copy and pickle.
- __repr__(self)
- Return a nicely formatted representation string
- _asdict(self)
- Return a new dict which maps field names to their values.
- _replace(self, /, **kwds)
- Return a new ArrayFragmentSpec object replacing specified fields with new values
Class methods defined here:
- _make(iterable) from builtins.type
- Make a new ArrayFragmentSpec object from a sequence or iterable
Static methods defined here:
- __new__(_cls, index_start: int, index_end: int, byte_start: int, byte_end: int)
- Create new instance of ArrayFragmentSpec(index_start, index_end, byte_start, byte_end)
Data descriptors defined here:
- index_start
- Alias for field number 0
- index_end
- Alias for field number 1
- byte_start
- Alias for field number 2
- byte_end
- Alias for field number 3
Data and other attributes defined here:
- __annotations__ = {'byte_end': <class 'int'>, 'byte_start': <class 'int'>, 'index_end': <class 'int'>, 'index_start': <class 'int'>}
- __match_args__ = ('index_start', 'index_end', 'byte_start', 'byte_end')
- __orig_bases__ = (<function NamedTuple>,)
- _field_defaults = {}
- _fields = ('index_start', 'index_end', 'byte_start', 'byte_end')
Methods inherited from builtins.tuple:
- __add__(self, value, /)
- Return self+value.
- __contains__(self, key, /)
- Return bool(key in self).
- __eq__(self, value, /)
- Return self==value.
- __ge__(self, value, /)
- Return self>=value.
- __getattribute__(self, name, /)
- Return getattr(self, name).
- __getitem__(self, key, /)
- Return self[key].
- __gt__(self, value, /)
- Return self>value.
- __hash__(self, /)
- Return hash(self).
- __iter__(self, /)
- Implement iter(self).
- __le__(self, value, /)
- Return self<=value.
- __len__(self, /)
- Return len(self).
- __lt__(self, value, /)
- Return self<value.
- __mul__(self, value, /)
- Return self*value.
- __ne__(self, value, /)
- Return self!=value.
- __rmul__(self, value, /)
- Return value*self.
- count(self, value, /)
- Return number of occurrences of value.
- index(self, value, start=0, stop=9223372036854775807, /)
- Return first index of value.
Raises ValueError if the value is not present.
Class methods inherited from builtins.tuple:
- __class_getitem__(...) from builtins.type
- See PEP 585
|
class PrimitiveArray(runtimepy.primitives.serializable.base.Serializable) |
|
PrimitiveArray(*primitives: 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], byte_order: runtimepy.primitives.byte_order.ByteOrder = <ByteOrder.NETWORK: 4>, fragments: list[runtimepy.primitives.array.ArrayFragmentSpec] = None, chain: runtimepy.primitives.serializable.base.Serializable = None) -> None
A class for managing primitives as arrays. |
|
- Method resolution order:
- PrimitiveArray
- runtimepy.primitives.serializable.base.Serializable
- abc.ABC
- builtins.object
Methods defined here:
- __bytes__(self) -> bytes
- Get this primitive array as a bytes instance.
- __getitem__(self, index: int) -> 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]
- Access underlying primitives by index.
- __init__(self, *primitives: 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], byte_order: runtimepy.primitives.byte_order.ByteOrder = <ByteOrder.NETWORK: 4>, fragments: list[runtimepy.primitives.array.ArrayFragmentSpec] = None, chain: runtimepy.primitives.serializable.base.Serializable = None) -> None
- Initialize this primitive array.
- add(self, primitive: 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], array_length: int = None) -> int
- Add another primitive to manage.
- add_primitive(self, kind: 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], array_length: int = None) -> int
- Add to the array by specifying the type of element to add.
- byte_at_index(self, index: int) -> int
- Get the byte index that a primitive at the provided index starts at.
This can also be thought of as the size of the array leading up to
the element at this index.
- fragment(self, index: int) -> 'PrimitiveArray'
- A simple accessor for fragments.
- fragment_bytes(self, index: int) -> bytes
- Get bytes from a fragment.
- fragment_from_byte_indices(self, start: int, end: int = -1) -> int
- Create a new array fragment from byte indices and return the fragment
index.
- fragment_from_indices(self, start: int, end: int = -1) -> int
- Create a new array fragment from primitive-member indices and return
the fragment index.
- index_at_byte(self, count: int) -> int
- Determine the array index that a byte index lands on.
- reset(self) -> None
- Reset this array so it's empty.
- update(self, data: bytes) -> int
- Update primitive values from a bytes instance.
- update_fragment(self, index: int, data: bytes) -> None
- Update a fragment by index.
Readonly properties defined here:
- num_fragments
- Get the number of fragments belonging to this array.
Data and other attributes defined here:
- __abstractmethods__ = frozenset()
- __annotations__ = {}
Methods inherited from runtimepy.primitives.serializable.base.Serializable:
- __copy__(self: ~T) -> ~T
- Make a copy of this serializable.
- add_to_end(self, chain: ~T, array_length: int = None) -> int
- Add a new serializable to the end of this chain.
- assign(self, chain: ~T) -> int
- Assign a next serializable.
- copy(self: ~T) -> ~T
- Create a copy of a serializable instance.
- copy_without_chain(self: ~T) -> ~T
- A method for copying instances without chain references.
- from_stream(self, stream: <class 'BinaryIO'>) -> int
- Update this serializable from a stream.
- length(self) -> int
- Get the full length of this chain.
- length_trace(self) -> str
- Get a length-tracing string for this instance.
- to_stream(self, stream: <class 'BinaryIO'>) -> int
- Write this serializable to a stream.
- update_str(self, data: str) -> int
- Update this serializable from string data.
Readonly properties inherited from runtimepy.primitives.serializable.base.Serializable:
- end
- Get the end of this chain.
Data descriptors inherited from runtimepy.primitives.serializable.base.Serializable:
- __dict__
- dictionary for instance variables
- __weakref__
- list of weak references to the object
| |