nodedge.serializable¶
Serializable “interface” module. It is an abstract class.
- class nodedge.serializable.Serializable¶
Bases:
objectSerializableclassCreate data which are common to any serializable object.
It stores the id of the object used in the
SceneHistory, theSceneClipboard, and the file structure.- serialize() OrderedDict¶
Serialization method to serialize this class data into
OrderedDictwhich can be stored in memory or file easily.- Returns
data serialized in
OrderedDict- Return type
OrderedDict
- deserialize(data: dict, hashmap: Optional[dict] = None, restoreId: bool = True, *args, **kwargs) bool¶
Deserialization method which take data in python
dictformat with helping hashmap containing references to existing entities.- Parameters
data (
dict) – dictionary containing serialized datahashmap (
dict) – helper dictionary containing references (by id == key) to existing objectsrestoreId (
bool) –Trueif we are creating new sockets.Falseis useful when loading existing sockets which we want to keep the existing object’s id
- Returns
Trueif deserialization was successful,Falseotherwise- Return type
bool