19{
20
21 using namespace pybind11::literals;
22
23
24 m.doc() = "C++ implementation of the application dal modules";
25
26 py::class_<OksFile>(m, "OksFile");
27
28 py::class_<OksClass, std::unique_ptr<OksClass, py::nodelete>>(m, "OksClass")
35 ;
36 py::class_<OksObject, std::unique_ptr<OksObject, py::nodelete>>(m, "OksObject");
37
38
39 py::class_<OksKernel>(m, "OksKernel")
40 .def(py::init<bool, bool, bool, bool, const char *, std::string>(),
41 "silence_mode"_a = false, "verbose_mode"_a = false, "profiling_mode"_a = false, "allow_repository"_a = true, "version"_a = nullptr, "branch_name"_a = "")
45
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
98
100
101
104
105
106
109
110
112
113
115
116
118
119
121
122
123
126
127
129
130
131
132 .def(
"load_file",&
OksKernel::load_file,
"name"_a,
"bind"_a =
true, py::return_value_policy::reference_internal)
133
134 .def(
"load_schema",&
OksKernel::load_schema,
"name"_a,
"parent"_a =
nullptr, py::return_value_policy::reference_internal)
135
137
138
139
140
142
144
146
148
150
152
154
156
159
160
161 .def(
"load_data",&
OksKernel::load_data,
"name"_a,
"bind"_a =
true, py::return_value_policy::reference_internal)
162
164
165
166 .def(
"new_data",&
OksKernel::new_data,
"name"_a,
"logical_name"_a =
"",
"type"_a =
"", py::return_value_policy::reference_internal)
167
168
169
170
171
173
174
176
177
179
181
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
200
202
204
206
208
210
212
213
215
216
217
218
219
220
221
222
223
224
226
228
230
232
233
234
235
236
237
238
239
240
241
242
243 ;
244
245
246}
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.