HAL  v4.5.0-83-g30c8f0afc
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
plugin_interfaces.cpp
Go to the documentation of this file.
2 
3 namespace hal
4 {
5 
7  {
8  public:
10 
11  std::string get_name() const override
12  {
13  PYBIND11_OVERRIDE_PURE(std::string, /* Return type */
14  BasePluginInterface, /* Parent class */
15  get_name); /* Name of function in C++ (must match Python name) */
16  }
17 
18  std::string get_version() const override
19  {
20  PYBIND11_OVERRIDE_PURE(std::string, /* Return type */
21  BasePluginInterface, /* Parent class */
22  get_version); /* Name of function in C++ (must match Python name) */
23  }
24 
25  std::string get_description() const override
26  {
27  PYBIND11_OVERRIDE(std::string, /* Return type */
28  BasePluginInterface, /* Parent class */
29  get_description); /* Name of function in C++ (must match Python name) */
30  }
31 
32  std::set<std::string> get_dependencies() const override
33  {
34  PYBIND11_OVERRIDE(std::set<std::string>, /* Return type */
35  BasePluginInterface, /* Parent class */
36  get_dependencies); /* Name of function in C++ (must match Python name) */
37  }
38  };
39 
41  {
42  py::class_<BasePluginInterface, RawPtrWrapper<BasePluginInterface>, PyBasePluginInterface> py_base_plugin_interface(m, "BasePluginInterface", R"(
43  The base class for all HAL plugins. Every plugin has to derive from this class and implement at least ``get_name`` and ``get_version``.
44  )");
45 
46  py_base_plugin_interface.def_property_readonly("name", &BasePluginInterface::get_name, R"(
47  The name of the plugin.
48 
49  :type: str
50  )");
51 
52  py_base_plugin_interface.def("get_name", &BasePluginInterface::get_name, R"(
53  Get the name of the plugin.
54 
55  :returns: The name of the plugin.
56  :rtype: str
57  )");
58 
59  py_base_plugin_interface.def_property_readonly("version", &BasePluginInterface::get_version, R"(
60  The version of the plugin.
61 
62  :type: str
63  )");
64 
65  py_base_plugin_interface.def("get_version", &BasePluginInterface::get_version, R"(
66  Get the version of the plugin.
67 
68  :returns: The version of the plugin.
69  :rtype: str
70  )");
71 
72  py_base_plugin_interface.def_property_readonly("description", &BasePluginInterface::get_description, R"(
73  The description of the plugin.
74 
75  :type: str
76  )");
77 
78  py_base_plugin_interface.def("get_description", &BasePluginInterface::get_description, R"(
79  Get the description of the plugin.
80 
81  :returns: The description of the plugin.
82  :rtype: str
83  )");
84 
85  py_base_plugin_interface.def_property_readonly("dependencies", &BasePluginInterface::get_dependencies, R"(
86  The plugins that this plugin depends on.
87 
88  :type: set[str]
89  )");
90 
91  py_base_plugin_interface.def("get_dependencies", &BasePluginInterface::get_dependencies, R"(
92  Get all dependencies of this plugin.
93 
94  :returns: The plugins that this plugin depends on.
95  :rtype: set[str]
96  )");
97  }
98 } // namespace hal
virtual std::set< std::string > get_dependencies() const
virtual std::string get_name() const =0
virtual std::string get_description() const
virtual std::string get_version() const =0
std::set< std::string > get_dependencies() const override
std::string get_name() const override
std::string get_description() const override
std::string get_version() const override
void plugin_interfaces_init(py::module &m)
const Module * module(const Gate *g, const NodeBoxes &boxes)
Definition: defines.h:45