28#include <unordered_set>
74 return ref().this_change_enabled;
137 return ref().this_dblocation;
143 return ref().this_resource_location;
176 return ref().this_total_objects;
182 ref().this_total_objects += i;
188 ref().this_total_objects = i;
199 static QString
const implementation(
"oksconflibs");
201 this_dblocation = location;
202 this_resource_location = implementation +
":" + location;
211 this_dblocation = location;
212 static QString
const implementation(
"roksconflibs");
213 this_resource_location = implementation +
":" + location;
214 t_lock l(this_change_enabled_mutex);
215 this_change_enabled =
true;
222 static QString
const implementation(
"rdbconfig");
223 this_resource_location = implementation +
":" + location;
224 this_dblocation = this_resource_location;
225 t_lock l(this_change_enabled_mutex);
226 this_change_enabled =
true;
255 ref().this_resource_location = Implementation;
271 if (not fn.endsWith(
".schema.xml")) {
274 }
catch (dunedaq::conffwk::Generic
const& ex) {
286 ref().get_commands()->clear();
288 ref().get_internal_change_stack()->swap(cleared);
301std::list<std::string>
304 std::list<std::string> dbs;
320 if (subscribeToChanges ==
true) {
335 }
catch (dunedaq::conffwk::Exception
const& e) {
341std::list<std::string>
345 std::list<std::string> tobecommited{};
354 }
catch (dunedaq::conffwk::Exception
const& e) {
356 throw daq::dbe::CouldNotCommitChanges(
ERS_HERE,
"confaccessor", e);
366 QString DUNEDAQ_DB_PATH = getenv(
"DUNEDAQ_DB_PATH");
367 QString GUI_DATA = getenv(
"OKS_GUI_INIT_DATA");
369 QStringList CONFIG_DATABASE = GUI_DATA.split(
":", Qt::SkipEmptyParts);
370 QStringList DUNEDAQ_DB_PATH_SPLIT = DUNEDAQ_DB_PATH.split(
":", Qt::SkipEmptyParts);
374 std::vector<std::string> full_path_names;
376 for (QString& FileName : CONFIG_DATABASE) {
378 for (QString& PATH : DUNEDAQ_DB_PATH_SPLIT) {
379 QFileInfo CheckFile(PATH +
"/" + FileName);
381 if (CheckFile.exists() and CheckFile.isFile()) {
382 QString fullpathname = PATH +
"/" + FileName;
383 full_path_names.push_back(fullpathname.toStdString());
404 throw daq::dbe::ChangeNotAllowed(
ERS_HERE);
415 throw daq::dbe::ChangeNotAllowed(
ERS_HERE);
440 const auto& cl = Change->get_class_name();
441 const auto& mod = Change->get_modified_objs();
442 const auto& cre = Change->get_created_objs();
443 const auto& rem = Change->get_removed_objs();
std::lock_guard< t_mutex > t_lock
static int get_total_objects()
QList< QStringList > IncludedFileCache
void force_emit_object_created(QString const &, dref const)
static cptr< datahandler > gethandler()
cptr< t_internal_changes_stack > t_internal_changes_stack_cptr
void GetFileCache(QList< QStringList > &FileCache)
void object_created(QString const &source, dref const &obj)
static void setdblocation(const QString &Implementation)
void removefile(std::string const &db, std::string const &fn)
static t_undo_stack_cptr get_commands()
static void CallbackFunction(const std::vector< dunedaq::conffwk::ConfigurationChange * > &changes, void *parameter)
static void increase_total_objects(int const i)
static bool is_database_loaded()
cptr< t_undo_stack > t_undo_stack_cptr
void ExternalChangesAccepted()
static void unsubscribe()
t_external_changes_stack external_change_stack
static std::list< std::string > uncommitted_files()
std::stack< t_internal_change, std::vector< t_internal_change > > t_internal_changes_stack
void db_committed(const std::list< std::string > &files, const std::string &msg)
t_undo_stack * sequenced_command_stack
std::shared_ptr< t_internal_changes_stack > internal_change_stack
void force_emit_object_deleted(QString const &, dref const)
QList< QStringList > GetIncludedFileCache() const
static cptr< ui::config::info > guiconfig()
static void set_total_objects(int const i)
ui::config::info * coreconfig
static void clear_commands()
void force_emit_object_renamed(QString const &, dref const)
void force_emit_object_changed(QString const &, dref const)
void object_deleted(QString const &source, dref const &obj)
void object_renamed(QString const &source, dref const &obj)
static bool check_file_rw(const QString &FileName)
void object_changed(QString const &source, dref const &obj)
static QString dbfullname()
static t_internal_changes_stack_cptr get_internal_change_stack()
static bool load(bool subscribeToChanges=true)
QString this_resource_location
t_mutex this_change_enabled_mutex
static std::list< std::string > save(QString const &)
void docallback(std::vector< dunedaq::conffwk::ConfigurationChange * > const &changes, void *parameter)
void set_dbinfo(QString const &p)
static void setdbinfo(QString const &location, dbinfo const itype=dbinfo::oks)
static confaccessor & ref()
dunedaq::conffwk::Configuration::CallbackId CallId
void addfile(std::string const &db, std::string const &fn)
static QString db_implementation_name()
static cptr< dunedaq::conffwk::Configuration > dbptr()
static cptr< dunedaq::conffwk::Configuration > database_concurrent_ptr
dbe::types::common::type_lock t_lock
static dunedaq::conffwk::Configuration * database
static dbe::types::common::type_mutex database_lock
Describes changes inside a class returned by the notification mechanism.
Describes a subscription criteria.
char const *const dbe_lib_internal_version
std::string const parse(ers::Issue const &)
config_object_description dref
#define dbe_compiled_version