Data view class which handles conversion between portions of data sections and appropriate data types
A data view is given by its target data section, type converter, and indices within the target. Indices must be contiguous and forward-facing.
Data views are effectively pointers to the data sections they view, converting data in and out as specified. Note that data views cannot target other data views; this is done for implementation simplicity.
Data views can be declared by decorating methods:
@View(section[slice], Converter) def data_view(self) -> _T: ...
An optional second parameter can be passed, wherein the method is used as a pre-converter before Converter.set
.
Method | __getitem__ |
Undocumented |
Method | __init__ |
Define a new data view given a data section to watch, a type converter, and the portion of the section to view |
Property | indices |
Undocumented |
Property | target |
Undocumented |
Method | __index__ |
Undocumented |
Method | __set__ |
Undocumented |
Method | _get |
Undocumented |
Instance Variable | _indices |
Undocumented |
Instance Variable | _length |
Undocumented |
Instance Variable | _target |
Undocumented |
Inherited from Section
:
Method | __copy__ |
Undocumented |
Property | length |
The length of this section |
Property | name |
The Raw class attribute name that this section stores to |
Method | __call__ |
Undocumented |
Method | __deepcopy__ |
Undocumented |
Method | __get__ |
Undocumented |
Method | __set |
Undocumented |
Method | _set |
Undocumented |
Instance Variable | _class |
Undocumented |
Instance Variable | _converter |
Undocumented |
Instance Variable | _get |
Undocumented |
Instance Variable | _name |
Undocumented |
Instance Variable | _set |
Undocumented |
Section
, converter: type[ Converter]
, indices: slice
= slice(tivars.data.Section.__init__
Define a new data view given a data section to watch, a type converter, and the portion of the section to view
Parameters | |
target:Section | The data section to view |
converter:type[ | The type converter for the view (defaults to Bytes ) |
indices:slice | The slice of the data section to view (defaults to the entire section) |