DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
Provides interface to the OKS kernel. More...
#include <kernel.hpp>
Public Types | |
enum | RepositoryUpdateType { DiscardChanges , MergeChanges , NoChanges } |
Public Member Functions | |
OksKernel (bool silence_mode=false, bool verbose_mode=false, bool profiling_mode=false, bool allow_repository=true, const char *version=nullptr, std::string branch_name="") | |
Constructor to build OksKernel object. | |
OksKernel (const OksKernel &src, bool copy_repository=false) | |
Copy constructor. | |
~OksKernel () | |
OksProfiler * | GetOksProfiler () const |
bool | get_verbose_mode () const |
Get status of verbose mode. The method returns true, if the verbose mode is switched 'On'. | |
void | set_verbose_mode (const bool b) |
Set status of verbose mode. To switch 'On'/'Off' use the method's parameter: | |
bool | get_silence_mode () const |
Get status of silence mode. The method returns true, if the silence mode is switched 'On'. In such case the OKS will not print any info, warnings and error messages. | |
void | set_silence_mode (const bool b) |
Set status of silence mode. To switch 'On'/'Off' use the method's parameter: | |
bool | get_profiling_mode () const |
Get status of profiling mode. The method returns true, if the profiling mode is switched 'On'. In such case the OKS will report time spend to execute main methods and a summary table of their calls on the OKS kernel destroy. | |
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 switched 'On'. In such case the OKS will allow to load classes with equal names. Only first loaded class is taken into account, the next ones are ignored. | |
bool | get_allow_duplicated_objects_mode () const |
Get status of duplicated objects mode. The method returns true, if the duplicated objects mode is switched 'On'. In such case the OKS will allow to load objects of the same class with equal IDs. The ID for duplicated object will be generated automatically. | |
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: | |
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 switched 'On'. In such case the OKS will throw exception when there are objects with equal IDs within class inheritance hierarchy. | |
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 | set_allow_duplicated_objects_mode (const bool b) |
Set status of duplicated objects mode. To switch 'On'/'Off' use the method's parameter: | |
std::shared_mutex & | get_mutex () |
Return OKS kernel mutex. | |
OksFile * | find_schema_file (const std::string &s) const |
Finds OKS schema file. | |
OksFile * | find_data_file (const std::string &s) const |
Finds OKS data file. | |
std::list< OksClass * > * | create_list_of_schema_classes (OksFile *) const |
Creates list of classes which belong to given file. | |
std::list< OksObject * > * | create_list_of_data_objects (OksFile *) const |
Creates list of objects which belong to given file. | |
OksFile * | create_file_info (const std::string &short_file_name, const std::string &file_name) |
Creates OKS file descriptor. | |
std::string | get_file_path (const std::string &path, const OksFile *parent_file=0, bool strict_paths=true) const |
Calculates full path to file. | |
const std::string & | get_repository_version () |
bool | is_user_repository_created () const |
const std::string & | get_user_repository_root () const |
Get user OKS repository root. | |
void | set_user_repository_root (const std::string &path, const std::string &version="") |
Set user OKS repository root. | |
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. | |
void | k_close_dangling_includes () |
Close files which lost their parent. | |
OksFile * | load_file (const std::string &name, bool bind=true) |
Load OKS database file. | |
OksFile * | load_schema (const std::string &name, const OksFile *parent=0) |
Load OKS schema file. | |
OksFile * | new_schema (const std::string &name) |
Create OKS schema file. | |
void | save_schema (OksFile *file_h, bool force=false, OksFile *true_file_h=0) |
Save OKS schema file. | |
void | save_schema (OksFile *file_h, bool force, const OksClass::Map &classes) |
Save classes into given OKS schema file. | |
void | backup_schema (OksFile *pf, const char *suffix=".bak") |
Backup OKS schema file. | |
void | save_as_schema (const std::string &name, OksFile *file_h) |
Save OKS schema file under new name. | |
void | save_all_schema () |
Save all OKS schema files. | |
void | close_schema (OksFile *file_h) |
Close OKS schema file. | |
void | close_all_schema () |
Close all OKS schema files. | |
void | set_active_schema (OksFile *file_h) |
Set active OKS schema file. | |
void | k_set_active_schema (OksFile *file_h) |
Set active OKS schema file. Non thread-safe version of the set_active_schema() method;. | |
OksFile * | get_active_schema () const |
Get active OKS schema file. | |
const OksFile::Map & | schema_files () const |
Get all schema files. | |
void | create_lists_of_updated_schema_files (std::list< OksFile * > **updated, std::list< OksFile * > **removed) const |
Get modified schema files. | |
void | get_updated_repository_files (std::set< std::string > &updated, std::set< std::string > &added, std::set< std::string > &removed) |
Get repository modified schema files. | |
OksFile * | load_data (const std::string &name, bool bind=true) |
Load OKS data file. | |
void | reload_data (std::set< OksFile * > &files, bool allow_schema_extension=true) |
Reload OKS data files. | |
OksFile * | new_data (const std::string &name, const std::string &logical_name="", const std::string &type="") |
Create OKS data file. | |
void | save_data (OksFile *file_h, bool ignore_bad_objects=false, OksFile *true_file_h=nullptr, bool force_defaults=false) |
Save OKS data file. | |
void | save_data (OksFile *file_h, const OksObject::FSet &objects) |
Save objects into given OKS data file. | |
void | backup_data (OksFile *pf, const char *suffix=".bak") |
Backup OKS data file. | |
void | save_as_data (const std::string &new_name, OksFile *file_h) |
Save OKS data file under new name. | |
void | save_all_data (bool force_defaults=false) |
Save all OKS data files. | |
void | close_data (OksFile *file_h, bool unbind_objects=true) |
Close OKS data file. | |
void | close_all_data () |
Close all OKS data files. | |
void | set_active_data (OksFile *file_h) |
Set active OKS data file. | |
void | k_set_active_data (OksFile *) |
Set active OKS data file. | |
OksFile * | get_active_data () const |
Get active OKS data file. | |
const OksFile::Map & | data_files () const |
Get all data files. | |
void | create_lists_of_updated_data_files (std::list< OksFile * > **updated, std::list< OksFile * > **removed) const |
Get modified data files. | |
void | get_modified_files (std::set< OksFile * > &mfs, std::set< OksFile * > &rfs, const std::string &version) |
Get modified data files. | |
const std::list< std::string > & | get_repository_dirs () const |
Get repository search directories. | |
void | commit_repository (const std::string &comments, const std::string &credentials="") |
Commit user modifications into repository. | |
void | tag_repository (const std::string &tag) |
Tag current state of repository. | |
std::time_t | get_repository_checkout_ts () const |
Return repository checkout timestamp. | |
void | update_repository (const std::string &hash_val, RepositoryUpdateType update_type) |
Update user repository files from origin by hash. | |
void | update_repository (const std::string ¶m, const std::string &val, RepositoryUpdateType update_type) |
Update user repository files from origin. | |
std::list< std::string > | get_repository_versions_diff (const std::string &sha1, const std::string &sha2) |
std::list< std::string > | get_repository_unmerged_files () |
std::vector< OksRepositoryVersion > | get_repository_versions (bool skip_irrelevant, const std::string &command_line) |
Return repository versions. | |
std::vector< OksRepositoryVersion > | get_repository_versions_by_hash (bool skip_irrelevant=true, const std::string &sha1="", const std::string &sha2="") |
Return repository versions between hash keys. | |
std::vector< OksRepositoryVersion > | get_repository_versions_by_date (bool skip_irrelevant=true, const std::string &since="", const std::string &until="") |
Return repository versions between timestamps. | |
std::string | read_repository_version () |
Read and return current repository version. | |
std::string | insert_repository_dir (const std::string &dir, bool push_back=true) |
Insert repository search directory. | |
void | remove_repository_dir (const std::string &dir) |
Remove repository search directory. | |
const OksClass::Map & | classes () const |
Get classes. | |
size_t | number_of_classes () const |
Get number of classes. | |
const OksObject::Set & | objects () const |
Get objects. | |
size_t | number_of_objects () const |
Get number of objects. | |
OksClass * | find_class (const std::string &class_name) const |
Find class by name (C++ string). | |
OksClass * | find_class (const char *class_name) const |
Find class by name (C-string). | |
void | get_all_classes (const std::vector< std::string > &names_in, ClassSet &classes_out) const |
The method searches all classes including subclasses for given names. | |
void | registrate_all_classes (bool skip_registered=false) |
The method rebuilds all classes taking into account inheritance. | |
bool | is_dangling (OksClass *class_ptr) const |
Check pointer on oks class. | |
bool | is_dangling (OksObject *obj_ptr) const |
Check pointer on oks object. | |
void | subscribe_create_class (void(*f)(OksClass *)) |
Subscribe on class creation. | |
void | subscribe_change_class (void(*f)(OksClass *, OksClass::ChangeType, const void *)) |
Subscribe on class changing. | |
void | subscribe_delete_class (void(*f)(OksClass *)) |
Subscribe on class destroying. | |
void | subscribe_create_object (OksObject::notify_obj cb_f, void *parameter) |
Subscribe on object creation. | |
void | subscribe_change_object (OksObject::notify_obj, void *) |
Subscribe on object changing. | |
void | subscribe_delete_object (OksObject::notify_obj, void *) |
Subscribe on object deleting. | |
void | bind_objects () |
Bind oks objects. | |
const std::string & | get_bind_objects_status () const noexcept |
Return status of oks objects binding. | |
const std::string & | get_bind_classes_status () const noexcept |
Return status of oks classes binding. | |
void | unset_repository_created () |
Set repository created flag to false to avoid created repository removal in destructor;. | |
Static Public Member Functions | |
static const char * | GetVersion () |
Get OKS version. The method returns string containing CVS tag and date of OKS build. | |
static std::string & | get_host_name () |
Get hostname of given process. | |
static std::string & | get_domain_name () |
Get domain name of host. | |
static std::string & | get_user_name () |
Get username of given process. | |
static bool | get_skip_string_range () |
Get status of string range validator. | |
static void | set_skip_string_range (const bool b) |
Set status of string range validator. To switch 'On'/'Off' use the method's parameter: | |
static bool | check_read_only (OksFile *f) |
Check if the OKS file is read-only. | |
static const std::string & | get_repository_root () |
Get OKS repository root. | |
static const std::string & | get_repository_mapping_dir () |
Get OKS repository name. | |
static std::string | get_tmp_file (const std::string &file_name) |
Generates temporal file name. | |
static const char * | get_cwd () |
static void | reset_cwd () |
Reset current working dir in case of chdir() call. | |
static void | set_use_strict_repository_paths (bool flag) |
Set flag to use strict-repository-paths check. | |
Private Types | |
template<typename T > | |
using | map_str_t = std::map<std::string, T> |
Private Member Functions | |
std::string | create_user_repository_dir () |
void | remove_user_repository_dir () |
void | k_copy_repository (const std::string &source, const std::string &destination) |
void | k_checkout_repository (const std::string ¶m, const std::string &val, const std::string &branch) |
Check out repository files into local user directory. | |
OksFile * | find_file (const std::string &s, const OksFile::Map &files) const |
void | k_rename_repository_file (OksFile *file_h, const std::string &new_name) |
OksFile * | k_load_file (const std::string &name, bool bind, const OksFile *parent, OksPipeline *pipeline) |
void | k_load_includes (const OksFile &, OksPipeline *) |
bool | k_preload_includes (OksFile *file_h, std::set< OksFile * > &new_files, bool allow_schema_extension) |
void | clear_preload_file_info () |
void | restore_preload_file_info () |
OksFile * | k_load_schema (const std::string &, const OksFile *) |
void | k_load_schema (OksFile *fp, std::shared_ptr< OksXmlInputStream > xmls, const OksFile *parent_h) |
void | k_close_schema (OksFile *) |
void | k_save_schema (OksFile *, bool force=false, OksFile *=0, const OksClass::Map *=0) |
void | k_rename_schema (OksFile *, const std::string &short_name, const std::string &long_name) |
OksFile * | k_load_data (const std::string &, bool, const OksFile *, OksPipeline *) |
void | k_load_data (OksFile *fp, char format, std::shared_ptr< OksXmlInputStream > xmls, long file_length, bool bind, const OksFile *parent_h, OksPipeline *) |
void | k_close_data (OksFile *, bool) |
void | k_save_data (OksFile *, bool=false, OksFile *=nullptr, const OksObject::FSet *=nullptr, bool force_defaults=false) |
void | k_rename_data (OksFile *, const std::string &short_name, const std::string &long_name) |
void | k_bind_objects () |
void | k_check_bind_classes_status () const noexcept |
void | unbind_all_rels (const OksObject::FSet &rm_objs, OksObject::FSet &updated) const |
Unbind all references on given oks objects. The method unbinds all relationships referencing given objects. | |
void | k_add (OksClass *) |
void | k_remove (OksClass *) |
void | define (OksObject *o) |
void | undefine (OksObject *o) |
void | add_data_file (OksFile *) |
void | add_schema_file (OksFile *) |
void | remove_data_file (OksFile *) |
void | remove_schema_file (OksFile *) |
bool | test_parent (OksFile *file, OksFile::IMap::iterator &i) |
Static Private Attributes | |
static bool | p_skip_string_range = false |
static bool | p_use_strict_repository_paths = true |
static std::string | p_repository_root |
static std::string | p_repository_mapping_dir |
static std::mutex | p_parallel_out_mutex |
static char * | s_cwd = nullptr |
static unsigned long | p_count = 0 |
static int | p_threads_pool_size = 0 |
Friends | |
class | OksFile |
class | OksClass |
class | OksObject |
struct | OksLoadObjectsJob |
struct | OksData |
std::ostream & | operator<< (std::ostream &s, OksKernel &k) |
Provides interface to the OKS kernel.
It is responsible for loading OKS data and schema files and it provides access to loaded OKS classes and their objects.
To work with OKS schema the following base methods are available:
To work with OKS data the following base methods are available:
To work with OKS server the following methods can be used:
When schema or data are modified, the process can give callback using the following methods:
When objects are created in unordered manner or by efficiency reasons files are loaded with non-bind option, the objects can be bind (i.e. linked) using the following methods:
In case of problems most of above methods throw exceptions derived from oks::exception class.
Most of the OksKernel methods are thread-safe. Those which are not thread-safe, are started from prefix "k_".
Definition at line 576 of file kernel.hpp.
|
private |
Definition at line 586 of file kernel.hpp.
Enumerator | |
---|---|
DiscardChanges | |
MergeChanges | |
NoChanges |
Definition at line 1590 of file kernel.hpp.
dunedaq::oks::OksKernel::OksKernel | ( | bool | silence_mode = false, |
bool | verbose_mode = false, | ||
bool | profiling_mode = false, | ||
bool | allow_repository = true, | ||
const char * | version = nullptr, | ||
std::string | branch_name = "" ) |
Constructor to build OksKernel object.
All parameters of the constructor are optional.
silence_mode | - defines kernel silence mode |
verbose_mode | - defines kernel verbose mode |
profiling_mode | - switch kernel into profiling mode |
Definition at line 733 of file kernel.cpp.
dunedaq::oks::OksKernel::OksKernel | ( | const OksKernel & | src, |
bool | copy_repository = false ) |
Copy constructor.
It is used by RDB RW server to make fast copy.
src | - kernel to copy |
Definition at line 919 of file kernel.cpp.
dunedaq::oks::OksKernel::~OksKernel | ( | ) |
Definition at line 1459 of file kernel.cpp.
|
private |
Definition at line 3767 of file kernel.cpp.
|
private |
Definition at line 3773 of file kernel.cpp.
void dunedaq::oks::OksKernel::backup_data | ( | OksFile * | pf, |
const char * | suffix = ".bak" ) |
Backup OKS data file.
The method makes a backup of given OKS data file. The save operation is silent and ignores any consistency rules. The file is always saved in extended format.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
file_h | a pointer to the OKS data file descriptor |
suffix | a suffix to be added to the name of file |
Throw | oks::exception in case of problems. |
Definition at line 3808 of file kernel.cpp.
void dunedaq::oks::OksKernel::backup_schema | ( | OksFile * | pf, |
const char * | suffix = ".bak" ) |
Backup OKS schema file.
The method makes a backup of given OKS schema file. The save operation is silent and ignores any consistency rules.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
file_h | a pointer to the OKS data file descriptor |
suffix | a suffix to be added to the name of file |
Throw | oks::exception in case of problems. |
Definition at line 2554 of file kernel.cpp.
void dunedaq::oks::OksKernel::bind_objects | ( | ) |
Bind oks objects.
The method sets links between oks objects converting whenever it is possible values of relationships from the UID types to the OksObject pointer. It is used after sequential loading of several data files with bind_objects parameter set to false.
The status of the last bind objects call can be checked using get_bind_objects_status() method.
Throw | oks::exception in case of problems. |
Definition at line 4361 of file kernel.cpp.
|
static |
Check if the OKS file is read-only.
Method returns true if the file is read-only and false if it is not. The method also changes the read-only flag in the file descriptor.
The method is thread-safe.
Definition at line 1532 of file kernel.cpp.
|
inline |
Get classes.
In multi-threaded environment to iterate through the set it could be necessary to acquire at least read oks kernel lock before calling the method to be sure that another thread does not modify the set of classes (i.e. destroy or create classes, open or close oks schema files).
Definition at line 1767 of file kernel.hpp.
|
private |
Definition at line 3525 of file kernel.cpp.
void dunedaq::oks::OksKernel::close_all_data | ( | ) |
Close all OKS data files.
The method closes all OKS data files which were created or loaded by the OKS kernel.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
Definition at line 4243 of file kernel.cpp.
void dunedaq::oks::OksKernel::close_all_schema | ( | ) |
Close all OKS schema files.
The method closes all OKS schema files which were created or loaded by the OKS kernel.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
Definition at line 2883 of file kernel.cpp.
void dunedaq::oks::OksKernel::close_data | ( | OksFile * | file_h, |
bool | unbind_objects = true ) |
Close OKS data file.
The method closes given OKS data file. All objects belonging to this data file will be destroyed in-memory. The relationships values of objects from others data files loaded in-memory will be converted from OksObject pointer to UID for all objects of closing data file, if the unbind_objects parameter is true. If it is necessary to close all loaded data files, it is recommended to use close_all_data() method and do not use close_data(..., true) method sequentially by performance reasons.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
file_h | a pointer to the OKS schema file descriptor returned by a kernel method |
unbind_objects | convert values of relationships pointing to objects of closing data file from OksObject pointer to the UID |
Definition at line 4183 of file kernel.cpp.
void dunedaq::oks::OksKernel::close_schema | ( | OksFile * | file_h | ) |
Close OKS schema file.
The method closes given OKS schema file.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
file_h | a pointer to the OKS schema file descriptor returned by a kernel method |
Definition at line 2820 of file kernel.cpp.
void dunedaq::oks::OksKernel::commit_repository | ( | const std::string & | comments, |
const std::string & | credentials = "" ) |
Commit user modifications into repository.
The method commits changes made in user repository into origin GIT repository.
comments | user comments |
credentials | daq token to get real user name (ignore, if empty) |
Throw | oks::exception in case of problems. |
Definition at line 5057 of file kernel.cpp.
OksFile * dunedaq::oks::OksKernel::create_file_info | ( | const std::string & | short_file_name, |
const std::string & | file_name ) |
Creates OKS file descriptor.
Method returns pointer to the OKS file descriptor defined by the file_name parameter or 0 if such file does not exist. The user is responsible to destroy the descriptor after usage.
short_file_name | short name of the file (e.g. relative to OKS root) |
file_name | an absolute file name |
The method is thread-safe.
Definition at line 1568 of file kernel.cpp.
std::list< OksObject * > * dunedaq::oks::OksKernel::create_list_of_data_objects | ( | OksFile * | fp | ) | const |
Creates list of objects which belong to given file.
Method returns pointer to the list of OKS objects or 0 if the file contains no objects. The user is responsible to destroy the list after usage.
The user should acquire a lock on OKS kernel before calling such method in the multi-threaded environment.
Definition at line 4327 of file kernel.cpp.
std::list< OksClass * > * dunedaq::oks::OksKernel::create_list_of_schema_classes | ( | OksFile * | pf | ) | const |
Creates list of classes which belong to given file.
Method returns pointer to the list of OKS classes or 0 if the file contains no classes. The user is responsible to destroy the list after usage.
The user should acquire a lock on OKS kernel before calling such method in the multi-threaded environment.
Definition at line 2950 of file kernel.cpp.
void dunedaq::oks::OksKernel::create_lists_of_updated_data_files | ( | std::list< OksFile * > ** | updated, |
std::list< OksFile * > ** | removed ) const |
Get modified data files.
The method returns all data files which were modified or removed by an external process. The method checks file system status of all OKS data files loaded and created by the OKS kernel. The file is considered to be updated if it was modified after it was last time saved by the OKS kernel, or modified after it was loaded or created.
The method return parameters are:
updated | pointer to the list of modified data files |
removed | pointer to the list of removed data files |
The user is responsible to delete returned pointers after usage.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
Definition at line 3009 of file kernel.cpp.
void dunedaq::oks::OksKernel::create_lists_of_updated_schema_files | ( | std::list< OksFile * > ** | updated, |
std::list< OksFile * > ** | removed ) const |
Get modified schema files.
The method returns all schema files which were modified or removed by an external process. The method checks file system status of all OKS schema files loaded and created by the OKS kernel. The file is considered to be updated if it was modified after it was last time saved by the OKS kernel, or modified after it was loaded or created.
The method return parameters are:
updated | pointer to the list of modified schema files |
removed | pointer to the list of removed schema files |
The user is responsible to delete returned pointers after usage.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
Definition at line 3001 of file kernel.cpp.
|
private |
Definition at line 2225 of file kernel.cpp.
|
inline |
Get all data files.
Get all data files which were created or loaded by the OKS kernel. The method is thread-safe.
Definition at line 1493 of file kernel.hpp.
|
inlineprivate |
Definition at line 2148 of file kernel.hpp.
OksClass * dunedaq::oks::OksKernel::find_class | ( | const char * | class_name | ) | const |
Find class by name (C-string).
If the method is used in the multi-threaded environment, it could be necessary to set read kernel lock before calling the method, if other threads can to create or to destroy oks classes and to open or close oks schema files.
class_name | name of the class |
Definition at line 4451 of file kernel.cpp.
|
inline |
Find class by name (C++ string).
If the method is used in the multi-threaded environment, it could be necessary to set read kernel lock before calling the method, if other threads can to create or to destroy oks classes and to open or close oks schema files.
class_name | name of the class (std::string) |
Definition at line 1814 of file kernel.hpp.
OksFile * dunedaq::oks::OksKernel::find_data_file | ( | const std::string & | s | ) | const |
Finds OKS data file.
Method returns pointer to the OKS data file with name s or 0, if there is no such data file found.
The user should acquire a lock on OKS kernel before calling such method in the multi-threaded environment.
Definition at line 2287 of file kernel.cpp.
|
private |
Definition at line 2257 of file kernel.cpp.
OksFile * dunedaq::oks::OksKernel::find_schema_file | ( | const std::string & | s | ) | const |
Finds OKS schema file.
Method returns pointer to the OKS schema file with name s or 0, if there is no such schema file found.
The user should acquire a lock on OKS kernel before calling such method in the multi-threaded environment.
Definition at line 2281 of file kernel.cpp.
|
inline |
Get active OKS data file.
The method is thread-safe.
Definition at line 1481 of file kernel.hpp.
|
inline |
Get active OKS schema file.
The method returns active schema file.
The method is thread-safe.
Definition at line 1210 of file kernel.hpp.
void dunedaq::oks::OksKernel::get_all_classes | ( | const std::vector< std::string > & | names_in, |
ClassSet & | classes_out ) const |
The method searches all classes including subclasses for given names.
names_in | array of names of the classes to search in |
classes_out | the output containing pointers to all classes by above names and their subclasses |
Definition at line 4675 of file kernel.cpp.
|
inline |
Get status of duplicated classes mode. The method returns true, if the duplicated classes mode is switched 'On'. In such case the OKS will allow to load classes with equal names. Only first loaded class is taken into account, the next ones are ignored.
Definition at line 730 of file kernel.hpp.
|
inline |
Get status of duplicated objects mode. The method returns true, if the duplicated objects mode is switched 'On'. In such case the OKS will allow to load objects of the same class with equal IDs. The ID for duplicated object will be generated automatically.
Definition at line 741 of file kernel.hpp.
|
inlinenoexcept |
Return status of oks classes binding.
The method checks lack of dangling references on class types and returns string containing unbound references if any.
Definition at line 2007 of file kernel.hpp.
|
inlinenoexcept |
Return status of oks objects binding.
The method returns string containing unbound references after last bind_objects() call.
Definition at line 1995 of file kernel.hpp.
|
static |
Definition at line 689 of file kernel.cpp.
|
static |
Get domain name of host.
Definition at line 447 of file kernel.cpp.
std::string dunedaq::oks::OksKernel::get_file_path | ( | const std::string & | path, |
const OksFile * | parent_file = 0, | ||
bool | strict_paths = true ) const |
Calculates full path to file.
Method calculates full path to file. It takes into account the values of the OKS_DB_ROOT, TDAQ_DB_REPOSITORY, TDAQ_DB_USER_REPOSITORY and TDAQ_DB_PATH environment variables and optionally checks if the path is relative to the parent file defined by the parent_file parameter.
The method is thread-safe.
path | short, relative or absolute path to file |
parent_file | pointer to file including given one |
Throw | std::exception in case of problems. |
Definition at line 1660 of file kernel.cpp.
|
static |
Get hostname of given process.
Definition at line 429 of file kernel.cpp.
void dunedaq::oks::OksKernel::get_includes | ( | const std::string & | file_name, |
std::set< std::string > & | includes, | ||
bool | use_repository_name = false ) |
Opens file and reads its shallow includes.
The method is thread-safe.
Throw | std::exception in case of problems. |
Definition at line 1914 of file kernel.cpp.
void dunedaq::oks::OksKernel::get_modified_files | ( | std::set< OksFile * > & | mfs, |
std::set< OksFile * > & | rfs, | ||
const std::string & | version ) |
Get modified data files.
The method returns the data files modified or removed by an external process in file system or repository.
The method return parameters are:
mfs | set of modified data files |
rfs | set of removed data files |
version | repository version to compare with (if needed) |
The user is responsible to delete returned pointers after usage.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
Definition at line 3017 of file kernel.cpp.
|
inline |
Return OKS kernel mutex.
The mutex is used to lock most OKS kernel update operations like loading of files. It is used by the RDB server performing OKS operations in multi-threaded environment.
Definition at line 820 of file kernel.hpp.
|
inline |
Get status of profiling mode. The method returns true, if the profiling mode is switched 'On'. In such case the OKS will report time spend to execute main methods and a summary table of their calls on the OKS kernel destroy.
Definition at line 708 of file kernel.hpp.
|
inline |
Return repository checkout timestamp.
Return timestamp when the repository was checkout or updated last time (e.g. to track new changes).
Definition at line 1584 of file kernel.hpp.
|
inline |
Get repository search directories.
The method is not thread-safe.
Definition at line 1545 of file kernel.hpp.
|
static |
Get OKS repository name.
The repository name is defined by last directory of the TDAQ_DB_REPOSITORY environment variable, e.g.: for the name of oks-repository-root="/usr/local/databases/v10" is "v10". The method returns an empty string, if the oks-repository-root is not set or its value contains no name.
Definition at line 350 of file kernel.cpp.
|
static |
Get OKS repository root.
The repository root is defined by the TDAQ_DB_REPOSITORY environment variable. The method returns an empty string, if the variable is not set or its value is empty.
Definition at line 304 of file kernel.cpp.
|
inline |
Special behavior of get_repository_versions_diff(), return unmerged files
Definition at line 1646 of file kernel.hpp.
|
inline |
Definition at line 936 of file kernel.hpp.
std::vector< OksRepositoryVersion > dunedaq::oks::OksKernel::get_repository_versions | ( | bool | skip_irrelevant, |
const std::string & | command_line ) |
Return repository versions.
skip_irrelevant | ignore changes not affecting loaded configuration |
command_line | forward command line parameter to the oks-git-log.sh |
Throw | oks::exception in case of problems. |
Definition at line 5329 of file kernel.cpp.
std::vector< OksRepositoryVersion > dunedaq::oks::OksKernel::get_repository_versions_by_date | ( | bool | skip_irrelevant = true, |
const std::string & | since = "", | ||
const std::string & | until = "" ) |
Return repository versions between timestamps.
skip_irrelevant | ignore changes not affecting loaded configuration |
since | limit the versions committed on-or-after the specified date/time |
until | limit the versions committed on-or-before the specified date/time |
Throw | oks::exception in case of problems. |
Definition at line 5486 of file kernel.cpp.
std::vector< OksRepositoryVersion > dunedaq::oks::OksKernel::get_repository_versions_by_hash | ( | bool | skip_irrelevant = true, |
const std::string & | sha1 = "", | ||
const std::string & | sha2 = "" ) |
Return repository versions between hash keys.
skip_irrelevant | ignore changes not affecting loaded configuration |
sha1 | limit the versions committed on-or-after the specified hash key; if empty, start from earliest available |
sha2 | limit the versions committed on-or-before the specified hash key; if empty, retrieve all versions until "origin/master" |
Throw | oks::exception in case of problems. |
Definition at line 5450 of file kernel.cpp.
std::list< std::string > dunedaq::oks::OksKernel::get_repository_versions_diff | ( | const std::string & | sha1, |
const std::string & | sha2 ) |
Return names of files updated between revisions.
Throw | oks::exception in case of problems. |
Definition at line 5249 of file kernel.cpp.
|
inline |
Get status of silence mode. The method returns true, if the silence mode is switched 'On'. In such case the OKS will not print any info, warnings and error messages.
Definition at line 686 of file kernel.hpp.
|
inlinestatic |
Get status of string range validator.
The method returns true, if the check is switched 'Off'. If the check is switched 'On', OKS will validate string value using regexp regular expression, if it is defined for related attribute.
Definition at line 799 of file kernel.hpp.
|
inline |
Get status of test inherited duplicated objects mode. The method returns true, if the mode is switched 'On'. In such case the OKS will throw exception when there are objects with equal IDs within class inheritance hierarchy.
Definition at line 765 of file kernel.hpp.
|
static |
Generates temporal file name.
Method generates temporal file name by adding numeric suffix to the file_name and testing the file existence.
The method is not thread-safe.
Definition at line 665 of file kernel.cpp.
void dunedaq::oks::OksKernel::get_updated_repository_files | ( | std::set< std::string > & | updated, |
std::set< std::string > & | added, | ||
std::set< std::string > & | removed ) |
Get repository modified schema files.
The method returns those schema files which corresponding repository files were modified or removed by an external process. The method checks file system status of all OKS schema files loaded and created by the OKS kernel. The file is considered to be updated if it was modified after it was last time saved by the OKS kernel, or modified after it was loaded or created.
The method return parameters are:
updated | pointer to the list of modified schema files |
removed | pointer to the list of removed schema files |
The user is responsible to delete returned pointers after usage.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
Definition at line 5546 of file kernel.cpp.
|
static |
Get username of given process.
Definition at line 468 of file kernel.cpp.
const std::string & dunedaq::oks::OksKernel::get_user_repository_root | ( | ) | const |
Get user OKS repository root.
The user repository root is defined by the TDAQ_DB_USER_REPOSITORY environment variable. The method returns an empty string, if the variable is not set or its value is empty.
Definition at line 370 of file kernel.cpp.
|
inline |
Get status of verbose mode. The method returns true, if the verbose mode is switched 'On'.
Definition at line 665 of file kernel.hpp.
|
inline |
Definition at line 614 of file kernel.hpp.
|
static |
Get OKS version. The method returns string containing CVS tag and date of OKS build.
Definition at line 297 of file kernel.cpp.
std::string dunedaq::oks::OksKernel::insert_repository_dir | ( | const std::string & | dir, |
bool | push_back = true ) |
Insert repository search directory.
The method trues to insert new repository search directory. If no such directory exists, then the method inserts new directory and returns its fully qualified name. Otherwise method does nothing and return empty string.
The method is not thread-safe.
dir | directory name |
push_back | if true, push new directory back; otherwise push directory front |
Definition at line 1398 of file kernel.cpp.
bool dunedaq::oks::OksKernel::is_dangling | ( | OksClass * | class_ptr | ) | const |
Check pointer on oks class.
A pointer on class becomes dangling if such class was destroyed, or the schema file which contains it was closed. The method scans through all oks classes and checks if given pointer is valid, i.e. points to an oks class.
If the method is used in the multi-threaded environment, it may be necessary to set read kernel lock before calling the method, in case if another threads can to create or to destroy classes or to open or to close oks schema files.
class_ptr | a pointer to the oks class to be tested |
Definition at line 4638 of file kernel.cpp.
bool dunedaq::oks::OksKernel::is_dangling | ( | OksObject * | obj_ptr | ) | const |
Check pointer on oks object.
A pointer on object becomes dangling if such object was destroyed, or the data file which contains it was closed. The method scans through all oks objects and checks if given pointer is valid, i.e. points to an oks object.
If the method is used in the multi-threaded environment, it may be necessary to set read kernel lock before calling the method, in case if another threads can to create or to destroy objects or to open or to close oks data files.
obj_ptr | a pointer to the oks object to be tested |
Definition at line 4607 of file kernel.cpp.
|
inline |
Definition at line 942 of file kernel.hpp.
|
private |
Definition at line 4459 of file kernel.cpp.
|
private |
Definition at line 4368 of file kernel.cpp.
|
privatenoexcept |
Definition at line 5710 of file kernel.cpp.
|
private |
Check out repository files into local user directory.
The method checks out GIT repository files into local user directory. The files have to be loaded from repository defined by TDAQ_DB_REPOSITORY environment. The TDAQ_DB_USER_REPOSITORY environment defines user directory and must be set.
param | forward parameter to oks-git-checkout.sh |
val | forward value of above parameter to oks-git-checkout.sh |
branch | name of the branch to check out |
Throw | oks::exception in case of problems. |
Definition at line 4880 of file kernel.cpp.
void dunedaq::oks::OksKernel::k_close_dangling_includes | ( | ) |
Close files which lost their parent.
When a file is closed or an include is removed, some files may lost their parent and needs to be closed.
The method is not thread-safe.
Definition at line 1961 of file kernel.cpp.
|
private |
Definition at line 4192 of file kernel.cpp.
|
private |
Definition at line 2829 of file kernel.cpp.
|
private |
Definition at line 4959 of file kernel.cpp.
|
private |
Definition at line 3569 of file kernel.cpp.
|
private |
Definition at line 3650 of file kernel.cpp.
|
private |
Definition at line 1798 of file kernel.cpp.
|
private |
Definition at line 1880 of file kernel.cpp.
|
private |
Definition at line 2306 of file kernel.cpp.
|
private |
Definition at line 2374 of file kernel.cpp.
|
private |
Definition at line 2077 of file kernel.cpp.
|
private |
Definition at line 4488 of file kernel.cpp.
|
private |
Definition at line 4110 of file kernel.cpp.
|
private |
Definition at line 4862 of file kernel.cpp.
|
private |
Definition at line 2746 of file kernel.cpp.
|
private |
Definition at line 3849 of file kernel.cpp.
|
private |
Definition at line 2593 of file kernel.cpp.
void dunedaq::oks::OksKernel::k_set_active_data | ( | OksFile * | fp | ) |
Set active OKS data file.
Non thread-safe version of the set_active_data() method;
Throw | oks::exception in case of problems. |
Definition at line 4285 of file kernel.cpp.
void dunedaq::oks::OksKernel::k_set_active_schema | ( | OksFile * | file_h | ) |
Set active OKS schema file. Non thread-safe version of the set_active_schema() method;.
Throw | oks::exception in case of problems. |
Definition at line 2910 of file kernel.cpp.
OksFile * dunedaq::oks::OksKernel::load_data | ( | const std::string & | name, |
bool | bind = true ) |
Load OKS data file.
The method loads OKS data file.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
By default, after the the data file is loaded, the kernel tries to resolve links between objects. This can be rather cpu consuming operation and it is not scalable for sequential load of many files. In this case it is recommended to change the default bind parameter to false for all but last loading data file.
name | name of the file to be loaded |
bind | if true (by default), resolve links between objects |
Throw | oks::exception in case of problems. |
Definition at line 3559 of file kernel.cpp.
OksFile * dunedaq::oks::OksKernel::load_file | ( | const std::string & | name, |
bool | bind = true ) |
Load OKS database file.
The method loads OKS schema or data xml file. It parses the file's xml header to detect the file type and calls appropriate load_schema() or load_data() method.
The method is thread-safe. The user may not have the OKS kernel lock set in the thread which calls this method.
The parameters of the method are:
name | name of the file to be loaded |
bind | if true, bind objects after load (applicable to data files only) |
Throw | oks::exception in case of problems. |
Definition at line 1788 of file kernel.cpp.
OksFile * dunedaq::oks::OksKernel::load_schema | ( | const std::string & | name, |
const OksFile * | parent = 0 ) |
Load OKS schema file.
The method loads OKS schema file.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
The method parameters are:
name | name of the file to be loaded |
parent | descriptor of the parent file (if defined, the name can be relative to the parent file) |
Throw | oks::exception in case of problems. |
Definition at line 2297 of file kernel.cpp.
OksFile * dunedaq::oks::OksKernel::new_data | ( | const std::string & | name, |
const std::string & | logical_name = "", | ||
const std::string & | type = "" ) |
Create OKS data file.
The method creates new OKS data file and makes it active.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
The method parameters are:
name | name of the new data file |
logical_name | user-defined logical name of the file (any string passed to the OKS file xml header) |
type | user-defined type of the file (any string passed to the OKS file xml header) |
Throw | oks::exception in case of problems. |
Definition at line 3718 of file kernel.cpp.
OksFile * dunedaq::oks::OksKernel::new_schema | ( | const std::string & | name | ) |
Create OKS schema file.
The method creates new OKS schema file and makes it active.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
name | name of the new schema file |
Throw | oks::exception in case of problems. |
Definition at line 2485 of file kernel.cpp.
|
inline |
Get number of classes.
Definition at line 1776 of file kernel.hpp.
|
inline |
Get number of objects.
The method returns number of objects loaded in-memory.
Definition at line 1799 of file kernel.hpp.
|
inline |
Get objects.
In multi-threaded environment to iterate through the set it could be necessary to acquire at least read oks kernel lock before calling the method to be sure that another thread does not modify the set of objects (i.e. destroy or create objects, open or close oks data files).
Definition at line 1790 of file kernel.hpp.
std::string dunedaq::oks::OksKernel::read_repository_version | ( | ) |
Read and return current repository version.
Throw | oks::exception in case of problems. |
Definition at line 5509 of file kernel.cpp.
void dunedaq::oks::OksKernel::registrate_all_classes | ( | bool | skip_registered = false | ) |
The method rebuilds all classes taking into account inheritance.
skip_registered | skip registration of already processed classes (used to improve performance) |
Throw | oks::exception in case of problems. |
Definition at line 4499 of file kernel.cpp.
void dunedaq::oks::OksKernel::reload_data | ( | std::set< OksFile * > & | files, |
bool | allow_schema_extension = true ) |
Reload OKS data files.
The method reloads data files. The non-modified objects are not changed in-memory. The objects which were removed in the file are removed in-memory. New objects created in the file are created in-memory. The values of an object' relationships and attributes changed in the file are changed in memory, the address of such object in-memory is not changed.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
The method invokes notification on changes if there is an appropriate subscription.
The method parameters are:
files | set of pointer to the OKS data file descriptors returned by a kernel method |
allow_schema_extension | if true, new schema files can be included in modified data files |
Throw | oks::exception in case of problems. |
Definition at line 3211 of file kernel.cpp.
|
private |
Definition at line 3779 of file kernel.cpp.
void dunedaq::oks::OksKernel::remove_repository_dir | ( | const std::string & | dir | ) |
Remove repository search directory.
The method removes from the search list directory with given name. The method is not thread-safe.
dir | directory name (must be fully qualified name) |
Definition at line 1424 of file kernel.cpp.
|
private |
Definition at line 3785 of file kernel.cpp.
|
private |
Definition at line 4941 of file kernel.cpp.
|
inlinestatic |
Reset current working dir in case of chdir() call.
Definition at line 1714 of file kernel.hpp.
|
private |
Definition at line 3536 of file kernel.cpp.
void dunedaq::oks::OksKernel::save_all_data | ( | bool | force_defaults = false | ) |
Save all OKS data files.
The method saves all OKS data files which were created or loaded by the OKS kernel. The files are saved in the same format (extended or compact), in which they were saved last time.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
Throw | oks::exception in case of problems. |
Definition at line 4160 of file kernel.cpp.
void dunedaq::oks::OksKernel::save_all_schema | ( | ) |
Save all OKS schema files.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
The method saves all OKS schema files which were created or loaded by the OKS kernel.
Throw | oks::exception in case of problems. |
Definition at line 2794 of file kernel.cpp.
void dunedaq::oks::OksKernel::save_as_data | ( | const std::string & | new_name, |
OksFile * | file_h ) |
Save OKS data file under new name.
The method changes the name of given OKS data file and saves it.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
new_name | new name of the data file |
file_h | a pointer to the OKS data file descriptor returned by a kernel method |
Throw | oks::exception in case of problems. |
Definition at line 4118 of file kernel.cpp.
void dunedaq::oks::OksKernel::save_as_schema | ( | const std::string & | name, |
OksFile * | file_h ) |
Save OKS schema file under new name.
The method changes the name of given OKS schema file and saves it.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
name | new name of the schema file |
file_h | a pointer to the OKS schema file descriptor returned by a kernel method |
Throw | oks::exception in case of problems. |
Definition at line 2755 of file kernel.cpp.
void dunedaq::oks::OksKernel::save_data | ( | OksFile * | file_h, |
bool | ignore_bad_objects = false, | ||
OksFile * | true_file_h = nullptr, | ||
bool | force_defaults = false ) |
Save OKS data file.
The method saves given OKS data file. By default the format of data file is compact. To save the file in the extended format set parameter extended_format to true.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
file_h | a pointer to the OKS data file descriptor |
ignore_bad_objects | save the file if it has inconsistent objects or misses includes |
true_file_h | a pointer to the real OKS data file descriptor owning objects (used for backup) |
Throw | oks::exception in case of problems. |
Definition at line 3794 of file kernel.cpp.
void dunedaq::oks::OksKernel::save_data | ( | OksFile * | file_h, |
const OksObject::FSet & | objects ) |
Save objects into given OKS data file.
The method saves explicitly mentioned objects into given OKS data file.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
file_h | a pointer to an external OKS data file descriptor |
objects | set of objects to be saved into this data file |
Throw | oks::exception in case of problems. |
Definition at line 3801 of file kernel.cpp.
void dunedaq::oks::OksKernel::save_schema | ( | OksFile * | file_h, |
bool | force, | ||
const OksClass::Map & | classes ) |
Save classes into given OKS schema file.
The method saves explicit set of classes into given OKS schema file. This is used to merge schema files by RDB server.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
file_h | a pointer to an external OKS schema file descriptor |
force | if true, ignore problems if possible (e.g. dangling references) |
classes | set of classes to be saved |
Throw | oks::exception in case of problems. |
Definition at line 2546 of file kernel.cpp.
void dunedaq::oks::OksKernel::save_schema | ( | OksFile * | file_h, |
bool | force = false, | ||
OksFile * | true_file_h = 0 ) |
Save OKS schema file.
The method saves given OKS schema file.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
file_h | a pointer to the OKS schema file descriptor returned by a kernel method |
force | if true, ignore problems if possible (e.g. dangling references) |
true_file_h | a pointer to the real OKS data file descriptor owning classes (used for backup) |
Throw | oks::exception in case of problems. |
Definition at line 2538 of file kernel.cpp.
|
inline |
Get all schema files.
The method returns all schema files which were created or loaded by the OKS kernel.
The method is thread-safe.
Definition at line 1223 of file kernel.hpp.
void dunedaq::oks::OksKernel::set_active_data | ( | OksFile * | file_h | ) |
Set active OKS data file.
The method makes given OKS data file active. Any created object will go to the active data file.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
file_h | a pointer to the OKS data file descriptor returned by a kernel method |
Throw | oks::exception in case of problems. |
Definition at line 4278 of file kernel.cpp.
void dunedaq::oks::OksKernel::set_active_schema | ( | OksFile * | file_h | ) |
Set active OKS schema file.
The method makes given OKS schema file active. Any created class will go to the active schema file.
The method is thread-safe. The user must not have the OKS kernel lock set in the thread which calls this method.
file_h | a pointer to the OKS schema file descriptor returned by a kernel method |
Throw | oks::exception in case of problems. |
Definition at line 2903 of file kernel.cpp.
|
inline |
Set status of duplicated classes mode. To switch 'On'/'Off' use the method's parameter:
b | - set 'true' to switch 'On' or 'false' to switch 'Off'. |
The duplicated classes mode can also be switched 'On' using the "OKS_KERNEL_ALLOW_DUPLICATED_CLASSES" environment variable set to any value except 'no'.
Definition at line 777 of file kernel.hpp.
|
inline |
Set status of duplicated objects mode. To switch 'On'/'Off' use the method's parameter:
b | - set 'true' to switch 'On' or 'false' to switch 'Off'. |
The duplicated objects mode can also be switched 'On' using the "OKS_KERNEL_ALLOW_DUPLICATED_OBJECTS" environment variable set to any value except 'no'.
Definition at line 789 of file kernel.hpp.
void dunedaq::oks::OksKernel::set_profiling_mode | ( | const bool | b | ) |
Set status of profiling mode. To switch 'On'/'Off' use the method's parameter:
b | - set 'true' to switch 'On' or 'false' to switch 'Off'. |
The profiling mode can also be switched 'On' using the "OKS_KERNEL_PROFILING" environment variable set to any value except 'no'.
Definition at line 1439 of file kernel.cpp.
|
inline |
Set status of silence mode. To switch 'On'/'Off' use the method's parameter:
b | - set 'true' to switch 'On' or 'false' to switch 'Off'. |
The silence mode can also be switched 'On' using the "OKS_KERNEL_SILENCE" environment variable set to any value except 'no'.
Definition at line 698 of file kernel.hpp.
|
inlinestatic |
Set status of string range validator. To switch 'On'/'Off' use the method's parameter:
b | - set 'true' to switch 'On' (i.e. to bypass the test) or 'false' to switch 'Off' (i.e. to force the test). |
The skip max length check mode can also be switched 'On' using the "OKS_KERNEL_SKIP_STRING_RANGE" environment variable set to any value except 'no'.
Definition at line 811 of file kernel.hpp.
|
inline |
Set status of test inherited duplicated objects mode. To switch 'On'/'Off' use the method's parameter:
b | - set 'true' to switch 'On' or 'false' to switch 'Off'. |
When the mode is switched 'On', the OKS kernel does not allow objects with equal IDs withing the same class inheritance hierarchy.
The test inherited duplicated objects mode can also be switched 'On' using the "OKS_KERNEL_TEST_DUPLICATED_OBJECTS_VIA_INHERITANCE" environment variable set to any value except 'no'.
Definition at line 756 of file kernel.hpp.
|
inlinestatic |
Set flag to use strict-repository-paths check.
Definition at line 1722 of file kernel.hpp.
void dunedaq::oks::OksKernel::set_user_repository_root | ( | const std::string & | path, |
const std::string & | version = "" ) |
Set user OKS repository root.
Used by OKS and RDB tools only!
Definition at line 389 of file kernel.cpp.
|
inline |
Set status of verbose mode. To switch 'On'/'Off' use the method's parameter:
b | - set 'true' to switch 'On' or 'false' to switch 'Off'. |
The verbose mode can also be switched 'On' using the "OKS_KERNEL_VERBOSE" environment variable set to any value except 'no'.
Definition at line 677 of file kernel.hpp.
|
inline |
Subscribe on class changing.
The method subscribes user-provided callback function on changes of existing oks class. The callback function is called when a class is changed and its arguments are the pointer to the changed class, the type of change and the change parameter.
f | user callback function |
Definition at line 2206 of file kernel.hpp.
|
inline |
Subscribe on object changing.
The method subscribes user-provided callback function on changing of existing oks object. The callback function is called when an object is changed.
cb_f | user callback function |
parameter | parameter to be passed to the user callback function |
Definition at line 2183 of file kernel.hpp.
|
inline |
Subscribe on class creation.
The method subscribes user-provided callback function on creation of new oks class. The callback function is called when a new class is created and its argument is the pointer to the new class.
f | user callback function |
Definition at line 2199 of file kernel.hpp.
|
inline |
Subscribe on object creation.
The method subscribes user-provided callback function on creation of new oks object. The callback function is called when a new object is created (except when it is read from file using load_data() method).
cb_f | user callback function |
parameter | parameter to be passed to the user callback function |
Inline methods for class OksKernel
Definition at line 2175 of file kernel.hpp.
|
inline |
Subscribe on class destroying.
The method subscribes user-provided callback function on destroying of existing oks class. The callback function is called when a class is destroying (e.g. schema file containing the class is closed) and its argument is the pointer to the destroying class.
f | user callback function |
Definition at line 2213 of file kernel.hpp.
|
inline |
Subscribe on object deleting.
The method subscribes user-provided callback function on destroying of existing oks object. The callback function is called when an object is destroying (e.g. data file containing the object is closed) and its argument is the pointer to the destroying object.
cb_f | user callback function |
parameter | parameter to be passed to the user callback function |
Definition at line 2191 of file kernel.hpp.
void dunedaq::oks::OksKernel::tag_repository | ( | const std::string & | tag | ) |
Tag current state of repository.
The method assigns a tag to current state of repository.
tag | the tag |
Throw | oks::exception in case of problems. |
Definition at line 5202 of file kernel.cpp.
|
private |
Definition at line 1943 of file kernel.cpp.
|
private |
Unbind all references on given oks objects. The method unbinds all relationships referencing given objects.
rm_objs | objects to be destroyed |
updated | return updated objects (i.e. containing unbind references) |
Definition at line 4403 of file kernel.cpp.
|
inlineprivate |
Definition at line 2149 of file kernel.hpp.
void dunedaq::oks::OksKernel::unset_repository_created | ( | ) |
Set repository created flag to false to avoid created repository removal in destructor;.
Definition at line 4952 of file kernel.cpp.
|
inline |
Update user repository files from origin by hash.
The method performs GIT update of files in local user directory.
hash_val | SHA or "origin/master" |
update_type | action in case of conflicts (discard changes, try to merge changes, cancel) |
Throw | oks::exception in case of problems. |
Definition at line 1608 of file kernel.hpp.
void dunedaq::oks::OksKernel::update_repository | ( | const std::string & | param, |
const std::string & | val, | ||
RepositoryUpdateType | update_type ) |
Update user repository files from origin.
The method performs GIT update of files in local user directory. Pass parameters to the oks-git-update.sh script.
param | "tag", "date" or "hash" |
val | SHA or "origin/master" |
update_type | action in case of conflicts (discard changes, try to merge changes, cancel) |
Throw | oks::exception in case of problems. |
Definition at line 4994 of file kernel.cpp.
|
friend |
Definition at line 580 of file kernel.hpp.
|
friend |
Definition at line 583 of file kernel.hpp.
|
friend |
Definition at line 579 of file kernel.hpp.
|
friend |
Definition at line 582 of file kernel.hpp.
|
friend |
Definition at line 581 of file kernel.hpp.
|
friend |
Definition at line 1491 of file kernel.cpp.
|
private |
Definition at line 2054 of file kernel.hpp.
|
private |
Definition at line 2053 of file kernel.hpp.
|
private |
Definition at line 2023 of file kernel.hpp.
|
private |
Definition at line 2024 of file kernel.hpp.
|
private |
Definition at line 2022 of file kernel.hpp.
|
mutableprivate |
Definition at line 2077 of file kernel.hpp.
|
private |
Definition at line 2076 of file kernel.hpp.
|
private |
Definition at line 2161 of file kernel.hpp.
|
private |
Definition at line 2162 of file kernel.hpp.
|
private |
Definition at line 2066 of file kernel.hpp.
|
private |
Definition at line 2056 of file kernel.hpp.
|
staticprivate |
Definition at line 2068 of file kernel.hpp.
|
private |
Definition at line 2158 of file kernel.hpp.
|
private |
Definition at line 2159 of file kernel.hpp.
|
private |
Definition at line 2051 of file kernel.hpp.
|
private |
Definition at line 2164 of file kernel.hpp.
|
private |
Definition at line 2165 of file kernel.hpp.
|
mutableprivate |
Definition at line 2042 of file kernel.hpp.
|
private |
Definition at line 2079 of file kernel.hpp.
|
private |
Definition at line 2072 of file kernel.hpp.
|
mutableprivate |
Definition at line 2043 of file kernel.hpp.
|
private |
Definition at line 2044 of file kernel.hpp.
|
staticprivate |
Definition at line 2046 of file kernel.hpp.
|
private |
Definition at line 2082 of file kernel.hpp.
Definition at line 2081 of file kernel.hpp.
|
private |
Definition at line 2021 of file kernel.hpp.
|
private |
Definition at line 2036 of file kernel.hpp.
|
private |
Definition at line 2061 of file kernel.hpp.
|
staticprivate |
Definition at line 2031 of file kernel.hpp.
|
staticprivate |
Definition at line 2030 of file kernel.hpp.
|
private |
Definition at line 2037 of file kernel.hpp.
|
private |
Definition at line 2035 of file kernel.hpp.
|
private |
Definition at line 2050 of file kernel.hpp.
|
private |
Definition at line 2045 of file kernel.hpp.
|
private |
Definition at line 2019 of file kernel.hpp.
|
staticprivate |
Definition at line 2027 of file kernel.hpp.
|
private |
Definition at line 2025 of file kernel.hpp.
|
staticprivate |
Definition at line 2074 of file kernel.hpp.
|
staticprivate |
Definition at line 2028 of file kernel.hpp.
|
private |
Definition at line 2032 of file kernel.hpp.
|
private |
Definition at line 2034 of file kernel.hpp.
|
private |
Definition at line 2033 of file kernel.hpp.
|
private |
Definition at line 2020 of file kernel.hpp.
|
private |
Definition at line 2070 of file kernel.hpp.
|
staticprivate |
Definition at line 2063 of file kernel.hpp.