IDS peak ICV v1.3.0
Loading...
Searching...
No Matches
iserializable.py
Go to the documentation of this file.
1from abc import ABC, abstractmethod
2
3from ids_peak_common.serialization.iarchive import IArchive
4
5
6class ISerializable(ABC):
7 """!
8 @brief
9 Interface for objects that can be serialized to and deserialized from an archive.
10
11 Classes implementing this interface provide mechanisms to convert their internal state
12 into a portable form using an IArchive, and restore it later from the same archive.
13
14 @ingroup ids_peak_common_python_serialization
15
16 @since ids_peak_common 1.1
17 """
18
19 @abstractmethod
20 def serialize(self, archive: IArchive) -> None:
21 """!
22 @brief
23 Serializes the current object into the provided archive.
24
25 This method writes the internal state of the object into the given
26 IArchive so that it can later be reconstructed using
27 :meth:`deserialize`.
28
29 @param archive: The archive to which the object data will be written.
30
31 @since ids_peak_common 1.1
32 """
33 pass
34
35 @abstractmethod
36 def deserialize(self, archive: IArchive) -> None:
37 """!
38 @brief
39 Deserializes the object's state from the provided archive.
40
41 This method reads data from the given IArchive and reconstructs
42 the internal state of the object.
43
44 @param archive: The archive from which to read the object's data.
45
46 @since ids_peak_common 1.1
47 """
48 pass
Interface for objects that can be serialized to and deserialized from an archive.
None deserialize(self, IArchive archive)
Deserializes the object's state from the provided archive.
None serialize(self, IArchive archive)
Serializes the current object into the provided archive.