pygridgain.binary module¶
GenericObjectMeta is a metaclass used to create
classes, which objects serve as a native Python values for GridGain Complex
object data type. You can use this metaclass with your existing classes
to save and restore their selected attributes and properties to/from
GridGain caches. It is also used internally by pygridgain to create simple
data classes “on the fly” when retrieving arbitrary Complex objects.
You can get the examples of using Complex objects in the Complex objects section of pygridgain documentation.
- class pygridgain.binary.GenericObjectMeta(name: str, base_classes: tuple, namespace: dict, **kwargs)¶
Bases:
GenericObjectPropsMetaComplex (or Binary) Object metaclass. It is aimed to help user create classes, which objects could serve as a pythonic representation of the
BinaryObjectGridGain data type.- __init__(name: str, base_classes: tuple, namespace: dict, type_name: str = None, schema: OrderedDict = None, **kwargs)¶
Initializes binary object class.
- Parameters:
type_name – (optional) binary object name. Defaults to class name,
schema – (optional) a dict of field names: field types,
- Raise:
ParseError if one or more binary field types did not recognized.
- version = None¶
- class pygridgain.binary.GenericObjectProps(*args, **kwargs)¶
Bases:
GridGainDataTypePropsThis class is mixed both to metaclass and to resulting class to make class properties universally available. You should not subclass it directly.
- property schema: OrderedDict¶
Binary object schema.
- property schema_id: int¶
Binary object schema ID.
- class pygridgain.binary.GenericObjectPropsMeta¶
Bases:
type,GenericObjectProps