18{
19
20 using namespace pybind11::literals;
21
22 m.doc() = "C++ implementation of the application dal modules";
23
24 py::class_<OksFile>(m, "OksFile");
25
26 py::class_<OksClass, std::unique_ptr<OksClass, py::nodelete>>(m, "OksClass")
33 py::class_<OksObject, std::unique_ptr<OksObject, py::nodelete>>(m, "OksObject");
34
35 py::class_<OksKernel>(m, "OksKernel")
36 .def(py::init<bool, bool, bool, bool, const char*, std::string>(),
37 "silence_mode"_a = false,
38 "verbose_mode"_a = false,
39 "profiling_mode"_a = false,
40 "allow_repository"_a = true,
41 "version"_a = nullptr,
42 "branch_name"_a = "")
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
75
76
77
80
81
83
84
85
88
89
90
93
94
95
96 .def("get_test_duplicated_objects_via_inheritance_mode",
98 .def("set_test_duplicated_objects_via_inheritance_mode",
100
102
103
106
107
108
109 .def("create_list_of_schema_classes",
111 py::return_value_policy::reference_internal)
112 .def("create_list_of_data_objects",
114 py::return_value_policy::reference_internal)
115
116
118
119
121
122
124
125
127
128
129
132
133
135
136
137
138 .def(
"load_file", &
OksKernel::load_file,
"name"_a,
"bind"_a =
true, py::return_value_policy::reference_internal)
139
140 .def("load_schema",
142 "name"_a,
143 "parent"_a = nullptr,
144 py::return_value_policy::reference_internal)
145
147
148
149
150
152
154
156
158
160
162
164
166
169
170
171 .def(
"load_data", &
OksKernel::load_data,
"name"_a,
"bind"_a =
true, py::return_value_policy::reference_internal)
172
174
175
176 .def("new_data",
178 "name"_a,
179 "logical_name"_a = "",
180 "type"_a = "",
181 py::return_value_policy::reference_internal)
182
183
184
185
186
188
189
191
192
194
196
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
215
217
219
221
223
225
226 .def("find_class",
228 "class_name"_a)
229
230
232
233
234
235
236
237
238
239
240
241
243
245
247
249
250
251
252
253
254
255
256
257
258
259 ;
260}
bool get_is_abstract() const noexcept
const FList * all_sub_classes() const noexcept
const std::string & get_name() const noexcept
const FList * all_super_classes() const noexcept
const std::string & get_description() const noexcept
const std::list< std::string * > * direct_super_classes() const noexcept
Provides interface to the OKS kernel.
OksFile * get_active_schema() const
Get active OKS schema file.
OksFile * get_active_data() const
Get active OKS data file.
const std::string & get_user_repository_root() const
Get user OKS repository root.
OksFile * load_file(const std::string &name, bool bind=true)
Load OKS database file.
static std::string & get_host_name()
Get hostname of given process.
static std::string & get_user_name()
Get username of given process.
OksFile * load_data(const std::string &name, bool bind=true)
Load OKS data file.
void remove_repository_dir(const std::string &dir)
Remove repository search directory.
const OksFile::Map & data_files() const
Get all data files.
OksFile * new_data(const std::string &name, const std::string &logical_name="", const std::string &type="")
Create OKS data file.
std::list< OksObject * > * create_list_of_data_objects(OksFile *) const
Creates list of objects which belong to given file.
void set_active_schema(OksFile *file_h)
Set active OKS schema file.
OksFile * find_data_file(const std::string &s) const
Finds OKS data file.
bool is_user_repository_created() const
void registrate_all_classes(bool skip_registered=false)
The method rebuilds all classes taking into account inheritance.
void set_user_repository_root(const std::string &path, const std::string &version="")
Set user OKS repository root.
const std::string & get_bind_classes_status() const noexcept
Return status of oks classes binding.
const OksObject::Set & objects() const
Get objects.
OksFile * create_file_info(const std::string &short_file_name, const std::string &file_name)
Creates OKS file descriptor.
bool get_verbose_mode() const
Get status of verbose mode. The method returns true, if the verbose mode is switched 'On'.
bool get_test_duplicated_objects_via_inheritance_mode() const
Get status of test inherited duplicated objects mode. The method returns true, if the mode is switche...
void backup_schema(OksFile *pf, const char *suffix=".bak")
Backup OKS schema file.
std::string get_file_path(const std::string &path, const OksFile *parent_file=0, bool strict_paths=true) const
Calculates full path to file.
void reload_data(std::set< OksFile * > &files, bool allow_schema_extension=true)
Reload OKS data files.
bool get_allow_duplicated_objects_mode() const
Get status of duplicated objects mode. The method returns true, if the duplicated objects mode is swi...
const OksClass::Map & classes() const
Get classes.
OksFile * find_schema_file(const std::string &s) const
Finds OKS schema file.
void set_allow_duplicated_objects_mode(const bool b)
Set status of duplicated objects mode. To switch 'On'/'Off' use the method's parameter:
void set_silence_mode(const bool b)
Set status of silence mode. To switch 'On'/'Off' use the method's parameter:
void unset_repository_created()
Set repository created flag to false to avoid created repository removal in destructor;.
void set_profiling_mode(const bool b)
Set status of profiling mode. To switch 'On'/'Off' use the method's parameter:
bool get_allow_duplicated_classes_mode() const
Get status of duplicated classes mode. The method returns true, if the duplicated classes mode is swi...
size_t number_of_classes() const
Get number of classes.
void close_all_data()
Close all OKS data files.
void set_test_duplicated_objects_via_inheritance_mode(const bool b)
Set status of test inherited duplicated objects mode. To switch 'On'/'Off' use the method's parameter...
void bind_objects()
Bind oks objects.
size_t number_of_objects() const
Get number of objects.
const std::string & get_repository_version()
void save_as_schema(const std::string &name, OksFile *file_h)
Save OKS schema file under new name.
const std::string & get_bind_objects_status() const noexcept
Return status of oks objects binding.
OksFile * new_schema(const std::string &name)
Create OKS schema file.
void set_allow_duplicated_classes_mode(const bool b)
Set status of duplicated classes mode. To switch 'On'/'Off' use the method's parameter:
void save_all_schema()
Save all OKS schema files.
std::list< OksClass * > * create_list_of_schema_classes(OksFile *) const
Creates list of classes which belong to given file.
void save_all_data(bool force_defaults=false)
Save all OKS data files.
OksClass * find_class(const std::string &class_name) const
Find class by name (C++ string).
bool get_silence_mode() const
Get status of silence mode. The method returns true, if the silence mode is switched 'On'....
void close_schema(OksFile *file_h)
Close OKS schema file.
void set_verbose_mode(const bool b)
Set status of verbose mode. To switch 'On'/'Off' use the method's parameter:
void close_all_schema()
Close all OKS schema files.
static std::string & get_domain_name()
Get domain name of host.
void set_active_data(OksFile *file_h)
Set active OKS data file.
OksFile * load_schema(const std::string &name, const OksFile *parent=0)
Load OKS schema file.
std::string insert_repository_dir(const std::string &dir, bool push_back=true)
Insert repository search directory.
const OksFile::Map & schema_files() const
Get all schema files.
void get_includes(const std::string &file_name, std::set< std::string > &includes, bool use_repository_name=false)
Opens file and reads its shallow includes.