IDS peak ICV v1.2.0
Loading...
Searching...
No Matches
imodule.py
Go to the documentation of this file.
1from __future__ import annotations
2
3from abc import abstractmethod
4from typing import Any
5
6from ids_peak_common.serialization import ISerializable
7
8
10 """!
11 @brief
12 Interface for a module used within a pipeline.
13
14 Modules must support enabling/disabling, processing input, and serialization.
15
16 @since ids_peak_common 1.1
17 @ingroup ids_peak_common_python_pipeline_modules
18 """
19
20 @property
21 @abstractmethod
22 def enabled(self) -> bool:
23 """!
24 @brief
25 Gets whether the module is currently enabled.
26
27 @return True if the module is enabled, False otherwise.
28
29 @since ids_peak_common 1.1
30 """
31 pass
32
33 @enabled.setter
34 @abstractmethod
35 def enabled(self, value: bool) -> None:
36 """!
37 @brief
38 Sets the enabled state of the module.
39
40 @param value: True to enable the module, False to disable it.
41
42 @since ids_peak_common 1.1
43 """
44 pass
45
46 @property
47 @abstractmethod
48 def type(self) -> str:
49 """!
50 @brief
51 Returns the type identifier of the module.
52
53 This should be a unique string identifying the specific implementation
54 of the module.
55
56 @return A string identifying the module type.
57
58 @since ids_peak_common 1.1
59 """
60 pass
61
62 @abstractmethod
63 def process(self, data: Any) -> Any:
64 """!
65 @brief
66 Processes input data and returns the result.
67
68 This function is called by the pipeline to process a unit of data.
69
70 @param data: The input data to be processed.
71
72 @return The processed input.
73
74 @since ids_peak_common 1.1
75 """
76 pass
77
78 @abstractmethod
79 def reset_to_default(self) -> None:
80 """!
81 @brief
82 Resets the module to its default state. The enabled state is not reset.
83
84 @since ids_peak_common 1.1
85 """
86 pass
Interface for a module used within a pipeline.
Definition imodule.py:9
None reset_to_default(self)
Resets the module to its default state.
Definition imodule.py:79
str type(self)
Returns the type identifier of the module.
Definition imodule.py:48
Any process(self, Any data)
Processes input data and returns the result.
Definition imodule.py:63
bool enabled(self)
Gets whether the module is currently enabled.
Definition imodule.py:22
Interface for objects that can be serialized to and deserialized from an archive.