Data interfaces for var objects
This module implements two primary means of data interface:
The
Converter
system, which uses the descriptor protocol to treat var data sections as their canonical types.Each data section of a var, while stored as raw bytes, can be interpreted as some other useful type. Each
Converter
class implements a conversion to such a type, such as bytes <-> str using latin-1. A data section is declared as either a baseSection
or aView
into another section and assigned a converter. The system allows a user to access data sections as regular variables without cumbersome getters or setters.See the
Converter
class and its children, and theSection
andView
classes for implementation details.The
Loader
system, which implements convenient object initialization using existing mutation methods.A
Dock
instance can declareLoader
methods which accept some sets of input types, such as load_string. Each loader is called by a generic load method should the input type be permissible for that loader. Var types call the generic loader during initialization should an initializer be passed.
Class |
|
Sliceable converter to extract and package a slice of bits within a byte |
Class |
|
Converter for data sections best interpreted as boolean flags |
Class |
|
No-op converter for data sections best interpreted as raw bytes |
Class |
|
Abstract base class for data section converters |
Class |
|
No-op converter for data sections with associated metadata |
Class |
|
Base class to inherit to implement the loader system |
Class |
|
Converter for data sections best interpreted as integers |
Class |
|
Function decorator to identify methods as data loaders for Dock instances |
Class |
|
Data section class which handles conversion between bytes and appropriate data types |
Class |
|
No-op converter for sized data sections with associated metadata |
Class |
|
Converter for data sections best interpreted as strings |
Class |
|
Data view class which handles conversion between portions of data sections and appropriate data types |
Type Variable | _T |
Undocumented |