28{
29
30 py::class_<Configuration>(m, "_Configuration")
31 .def(py::init<>())
32 .def(py::init<std::string>())
33 .def("add_include",
35 "Add include file to existing database.",
36 py::arg("db_name"),
37 py::arg("include"))
38 .def("attributes",
40 "Get the properties of each attribute in a given class",
41 py::arg("class_name"),
42 py::arg("all"))
45 .def(
46 "create_db",
48 "Create a database from a list of files",
49 py::arg("db_name"),
50 py::arg("includes"))
51 .def("create_obj",
52 py::overload_cast<const std::string&, const std::string&, const std::string&>(
54 "Create new object by class name and object id.",
55 py::arg("at"),
56 py::arg("class_name"),
57 py::arg("id"))
58 .def("create_obj",
59 py::overload_cast<const ConfigObject&, const std::string&, const std::string&>(
61 "Create new object by class name and object id.",
62 py::arg("at"),
63 py::arg("class_name"),
64 py::arg("id"))
66 .def("get_impl_param",
68 "Get implementation plug-in parameter used to build conffwk object")
69 .def("get_impl_spec",
71 "Get implementation plug-in and its parameter used to build conffwk object")
72 .def("get_includes",
74 "Returns list of files included by given database.",
75 py::arg("db_name"))
76 .def("get_schema_path",
78 "Get path to schema file with definition of the given class",
79 py::arg("class_name"))
80 .def("get_obj",
82 "Create a configuration object containing the desired entity from the database",
83 py::arg("class_name"),
84 py::arg("id"))
85 .def("get_objs",
87 "Create a list of configuration objects of a given class from the database",
88 py::arg("class_name"),
89 py::arg("query") = "")
90 .def(
"load", &
Configuration::load,
"Load database according to the name.", py::arg(
"db_name"))
92 .def(
94 .def("relations",
96 "Get the properties of each relation in a given class",
97 py::arg("class_name"),
98 py::arg("all"))
99 .def("superclasses",
101 "Get the superclasses of a single class",
102 py::arg("class_name"),
103 py::arg("all"))
104 .def("subclasses",
106 "Get the subclasses of a single class",
107 py::arg("class_name"),
108 py::arg("all"))
109 .def("test_object",
111 "Test the existence of the object",
112 py::arg("class_name"),
113 py::arg("id"),
114 py::arg("rlevel"),
115 py::arg("rclasses"))
117}
Defines base class for cache of template objects.
std::vector< ConfigObject > * get_objs_pybind(const std::string &class_name, const std::string &query="")
std::unordered_map< std::string, std::unordered_map< std::string, std::string > > attributes_pybind(const std::string &class_name, bool all)
void destroy_obj(ConfigObject &object)
Destroy object.
std::unordered_map< std::string, std::unordered_map< std::string, std::string > > relations_pybind(const std::string &class_name, bool all)
void remove_include(const std::string &db_name, const std::string &include)
Remove include file.
void load(const std::string &db_name)
Load database according to the name. If name is empty, take it from TDAQ_DB_NAME and TDAQ_DB_DATA env...
const std::string & get_impl_param() const noexcept
std::vector< std::string > superclasses_pybind(const std::string &class_name, bool all)
void create(const std::string &at, const std::string &class_name, const std::string &id, ConfigObject &object)
Create new object by class name and object id.
std::vector< std::string > subclasses_pybind(const std::string &class_name, bool all)
std::list< std::string > * return_includes_pybind(const std::string &db_name)
bool loaded() const noexcept
Check if database is correctly loaded.
std::vector< std::string > get_class_list() const
const std::string & get_schema_path_pybind(const std::string &class_name)
const std::string & get_impl_spec() const noexcept
void commit(const std::string &log_message="")
Commit database changes.
ConfigObject * get_obj_pybind(const std::string &class_name, const std::string &id)
void unload()
Unload database.
bool test_object(const std::string &class_name, const std::string &id, unsigned long rlevel=0, const std::vector< std::string > *rclasses=0)
Test the object existence.
void add_include(const std::string &db_name, const std::string &include)
Add include file to existing database.
ConfigObject * create_and_return_obj_pybind(const std::string &at, const std::string &class_name, const std::string &id)