DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::conffwk::python Namespace Reference

Classes

class  ConfigurationPointer
 

Functions

void register_conffwk (py::module &m)
 
void register_conffwkobject (py::module &m)
 
 PYBIND11_MODULE (_daq_conffwk_py, m)
 

Function Documentation

◆ PYBIND11_MODULE()

dunedaq::conffwk::python::PYBIND11_MODULE ( _daq_conffwk_py ,
m  )

Definition at line 22 of file module.cpp.

23{
24
25 m.doc() = "Python interface to the conffwk package"; // optional module docstring
26
29}
void register_conffwk(py::module &m)
Definition config.cpp:27
void register_conffwkobject(py::module &m)
Definition config.cpp:79

◆ register_conffwk()

void dunedaq::conffwk::python::register_conffwk ( py::module & m)

Definition at line 27 of file config.cpp.

28{
29
30 py::class_<Configuration>(m, "_Configuration")
31 .def(py::init<>())
32 .def(py::init<std::string>())
33 .def("add_include",
34 &Configuration::add_include, "Add include file to existing database.", py::arg("db_name"), py::arg("include"))
35 .def("attributes",
36 &Configuration::attributes_pybind, "Get the properties of each attribute in a given class", py::arg("class_name"), py::arg("all"))
37 .def("classes",
38 &Configuration::get_class_list, "Get the names of the superclasses for each class")
39 .def("commit",
40 &Configuration::commit, "Commit database changes.", py::arg("log_message") = "")
41 .def("create_db",
42 static_cast<void (Configuration::*)(const std::string&, const std::list<std::string>&)>(&Configuration::create), "Create a database from a list of files", py::arg("db_name"), py::arg("includes"))
43 .def("create_obj",
44 py::overload_cast<const std::string&, const std::string&, const std::string&>(&Configuration::create_and_return_obj_pybind), "Create new object by class name and object id.", py::arg("at"), py::arg("class_name"), py::arg("id"))
45 .def("create_obj",
46 py::overload_cast<const ConfigObject&, const std::string&, const std::string&>(&Configuration::create_and_return_obj_pybind), "Create new object by class name and object id.", py::arg("at"), py::arg("class_name"), py::arg("id"))
47 .def("destroy_obj",
48 &Configuration::destroy_obj, "The method tries to destroy given object.", py::arg("object"))
49 .def("get_impl_param",
50 &Configuration::get_impl_param, "Get implementation plug-in parameter used to build conffwk object")
51 .def("get_impl_spec",
52 &Configuration::get_impl_spec, "Get implementation plug-in and its parameter used to build conffwk object")
53 .def("get_includes",
54 &Configuration::return_includes_pybind, "Returns list of files included by given database.", py::arg("db_name"))
55 .def("get_obj",
56 &Configuration::get_obj_pybind, "Create a configuration object containing the desired entity from the database", py::arg("class_name"), py::arg("id"))
57 .def("get_objs",
58 &Configuration::get_objs_pybind, "Create a list of configuration objects of a given class from the database", py::arg("class_name"), py::arg("query") = "")
59 .def("load",
60 &Configuration::load, "Load database according to the name.", py::arg("db_name"))
61 .def("loaded",
62 &Configuration::loaded, "Check if database is correctly loaded.")
63 .def("remove_include",
64 &Configuration::remove_include, "Remove include file.", py::arg("db_name"), py::arg("include"))
65 .def("relations",
66 &Configuration::relations_pybind, "Get the properties of each relation in a given class", py::arg("class_name"), py::arg("all"))
67 .def("superclasses",
68 &Configuration::superclasses_pybind, "Get the superclasses of a single class", py::arg("class_name"), py::arg("all"))
69 .def("subclasses",
70 &Configuration::subclasses_pybind, "Get the superclasses of a single class", py::arg("class_name"), py::arg("all"))
71 .def("test_object",
72 &Configuration::test_object, "Test the existence of the object", py::arg("class_name"), py::arg("id"), py::arg("rlevel"), py::arg("rclasses"))
73 .def("unload",
74 &Configuration::unload, "Unload previously-loaded database")
75 ;
76}
Defines base class for cache of template objects.

◆ register_conffwkobject()

void dunedaq::conffwk::python::register_conffwkobject ( py::module & m)

Definition at line 79 of file config.cpp.

80{
81
82 py::class_<ConfigObject>(m, "_ConfigObject")
83 .def(py::init<>())
84 .def(py::init<const ConfigObject&>())
85 .def("class_name",
86 &ConfigObject::class_name, "Return object's class name")
87 .def("contained_in",
88 &ConfigObject::contained_in, "Return the name of the database file this object belongs to.")
89 .def("full_name",
90 &ConfigObject::full_name, "Return full object name")
91 .def("get_obj",
92 &ConfigObject::get_obj_pybind, "Get a copy of an object", py::arg("attrname"))
93 .def("get_objs",
94 &ConfigObject::get_list_pybind<ConfigObject>, "Getter function for a list", py::arg("attr"))
95 .def("get_string",
96 &ConfigObject::get_value_pybind<std::string>, "Simple getter function", py::arg("attr"))
97 .def("get_bool",
98 &ConfigObject::get_value_pybind<bool>, "Simple getter function", py::arg("attr"))
99 .def("get_s8",
100 &ConfigObject::get_value_pybind<int8_t>, "Simple getter function", py::arg("attr"))
101 .def("get_u8",
102 &ConfigObject::get_value_pybind<uint8_t>, "Simple getter function", py::arg("attr"))
103 .def("get_s16",
104 &ConfigObject::get_value_pybind<int16_t>, "Simple getter function", py::arg("attr"))
105 .def("get_u16",
106 &ConfigObject::get_value_pybind<uint16_t>, "Simple getter function", py::arg("attr"))
107 .def("get_s32",
108 &ConfigObject::get_value_pybind<int32_t>, "Simple getter function", py::arg("attr"))
109 .def("get_u32",
110 &ConfigObject::get_value_pybind<uint32_t>, "Simple getter function", py::arg("attr"))
111 .def("get_s64",
112 &ConfigObject::get_value_pybind<int64_t>, "Simple getter function", py::arg("attr"))
113 .def("get_u64",
114 &ConfigObject::get_value_pybind<uint64_t>, "Simple getter function", py::arg("attr"))
115 .def("get_float",
116 &ConfigObject::get_value_pybind<float>, "Simple getter function", py::arg("attr"))
117 .def("get_double",
118 &ConfigObject::get_value_pybind<double>, "Simple getter function", py::arg("attr"))
119 .def("get_string_vec",
120 &ConfigObject::get_list_pybind<std::string>, "Getter function for a list", py::arg("attr"))
121 .def("get_bool_vec",
122 &ConfigObject::get_list_pybind<bool>, "Getter function for a list", py::arg("attr"))
123 .def("get_s8_vec",
124 &ConfigObject::get_list_pybind<int8_t>, "Getter function for a list", py::arg("attr"))
125 .def("get_u8_vec",
126 &ConfigObject::get_list_pybind<uint8_t>, "Getter function for a list", py::arg("attr"))
127 .def("get_s16_vec",
128 &ConfigObject::get_list_pybind<int16_t>, "Getter function for a list", py::arg("attr"))
129 .def("get_u16_vec",
130 &ConfigObject::get_list_pybind<uint16_t>, "Getter function for a list", py::arg("attr"))
131 .def("get_s32_vec",
132 &ConfigObject::get_list_pybind<int32_t>, "Getter function for a list", py::arg("attr"))
133 .def("get_u32_vec",
134 &ConfigObject::get_list_pybind<uint32_t>, "Getter function for a list", py::arg("attr"))
135 .def("get_s64_vec",
136 &ConfigObject::get_list_pybind<int64_t>, "Getter function for a list", py::arg("attr"))
137 .def("get_u64_vec",
138 &ConfigObject::get_list_pybind<uint64_t>, "Getter function for a list", py::arg("attr"))
139 .def("get_float_vec",
140 &ConfigObject::get_list_pybind<float>, "Getter function for a list", py::arg("attr"))
141 .def("get_double_vec",
142 &ConfigObject::get_list_pybind<double>, "Getter function for a list", py::arg("attr"))
143 .def("rename",
144 &ConfigObject::rename, "Rename object", py::arg("new_id"))
145 .def("set_obj",
146 &ConfigObject::set_obj, "Set relationship single-value", py::arg("name"), py::arg("o"), py::arg("skip_non_null_check") = false)
147 .def("set_objs",
148 &ConfigObject::set_objs, "Set relationship multi-value.", py::arg("name"), py::arg("o"), py::arg("skip_non_null_check") = false)
149 .def("set_class",
150 py::overload_cast<const std::string&, const std::string&>(&ConfigObject::set_class), "Set the class name", py::arg("name"), py::arg("value"))
151 .def("set_date",
152 py::overload_cast<const std::string&, const std::string&>(&ConfigObject::set_date), "Set the date", py::arg("name"), py::arg("value"))
153 .def("set_enum",
154 py::overload_cast<const std::string&, const std::string&>(&ConfigObject::set_enum), "Set the enum", py::arg("name"), py::arg("value"))
155 .def("set_string",
156 &ConfigObject::set_by_val<std::string>, "Simple setter function", py::arg("name"), py::arg("value"))
157 .def("set_time",
158 py::overload_cast<const std::string&, const std::string&>(&ConfigObject::set_time), "Set the time", py::arg("name"), py::arg("value"))
159 .def("set_bool",
160 &ConfigObject::set_by_val<bool>, "Simple setter function", py::arg("name"), py::arg("value"))
161 .def("set_s8",
162 &ConfigObject::set_by_val<int8_t>, "Simple setter function", py::arg("name"), py::arg("value"))
163 .def("set_u8",
164 &ConfigObject::set_by_val<uint8_t>, "Simple setter function", py::arg("name"), py::arg("value"))
165 .def("set_s16",
166 &ConfigObject::set_by_val<int16_t>, "Simple setter function", py::arg("name"), py::arg("value"))
167 .def("set_u16",
168 &ConfigObject::set_by_val<uint16_t>, "Simple setter function", py::arg("name"), py::arg("value"))
169 .def("set_s32",
170 &ConfigObject::set_by_val<int32_t>, "Simple setter function", py::arg("name"), py::arg("value"))
171 .def("set_u32",
172 &ConfigObject::set_by_val<uint32_t>, "Simple setter function", py::arg("name"), py::arg("value"))
173 .def("set_s64",
174 &ConfigObject::set_by_val<int64_t>, "Simple setter function", py::arg("name"), py::arg("value"))
175 .def("set_u64",
176 &ConfigObject::set_by_val<uint64_t>, "Simple setter function", py::arg("name"), py::arg("value"))
177 .def("set_float",
178 &ConfigObject::set_by_val<float>, "Simple setter function", py::arg("name"), py::arg("value"))
179 .def("set_double",
180 &ConfigObject::set_by_val<double>, "Simple setter function", py::arg("name"), py::arg("value"))
181 .def("set_bool_vec",
182 &ConfigObject::set_list_pybind<bool>, "Setter function for list", py::arg("attrname"), py::arg("l"))
183 .def("set_s8_vec",
184 &ConfigObject::set_list_pybind<int8_t>, "Setter function for list", py::arg("attrname"), py::arg("l"))
185 .def("set_u8_vec",
186 &ConfigObject::set_list_pybind<uint8_t>, "Setter function for list", py::arg("attrname"), py::arg("l"))
187 .def("set_s16_vec",
188 &ConfigObject::set_list_pybind<int16_t>, "Setter function for list", py::arg("attrname"), py::arg("l"))
189 .def("set_u16_vec",
190 &ConfigObject::set_list_pybind<uint16_t>, "Setter function for list", py::arg("attrname"), py::arg("l"))
191 .def("set_s32_vec",
192 &ConfigObject::set_list_pybind<int32_t>, "Setter function for list", py::arg("attrname"), py::arg("l"))
193 .def("set_u32_vec",
194 &ConfigObject::set_list_pybind<uint32_t>, "Setter function for list", py::arg("attrname"), py::arg("l"))
195 .def("set_s64_vec",
196 &ConfigObject::set_list_pybind<int64_t>, "Setter function for list", py::arg("attrname"), py::arg("l"))
197 .def("set_u64_vec",
198 &ConfigObject::set_list_pybind<uint64_t>, "Setter function for list", py::arg("attrname"), py::arg("l"))
199 .def("set_float_vec",
200 &ConfigObject::set_list_pybind<float>, "Setter function for list", py::arg("attrname"), py::arg("l"))
201 .def("set_double_vec",
202 &ConfigObject::set_list_pybind<double>, "Setter function for list", py::arg("attrname"), py::arg("l"))
203 .def("set_class_vec",
204 &ConfigObject::set_list_pybind<std::string>, "Set list of classes", py::arg("attrname"), py::arg("l"))
205 .def("set_date_vec",
206 &ConfigObject::set_list_pybind<std::string>, "Set list of dates", py::arg("attrname"), py::arg("l"))
207 .def("set_enum_vec",
208 &ConfigObject::set_list_pybind<std::string>, "Set list of enums", py::arg("attrname"), py::arg("l"))
209 .def("set_string_vec",
210 &ConfigObject::set_list_pybind<std::string>, "Set list of strings", py::arg("attrname"), py::arg("l"))
211 .def("set_time_vec",
212 &ConfigObject::set_list_pybind<std::string>, "Set list of times", py::arg("attrname"), py::arg("l"))
213 .def("UID",
214 &ConfigObject::UID, "Return object identity")
215 ;
216
217}