20#include <unordered_set>
44 sequenced_command_stack (
new QUndoStack() ),
46 coreconfig (
nullptr ),
47 this_change_enabled (
false ),
48 this_total_objects ( 0 )
67 return ref().this_change_enabled;
122 return ref().this_dblocation;
127 return ref().this_resource_location;
156 return ref().this_total_objects;
161 ref().this_total_objects += i;
166 ref().this_total_objects = i;
176 static QString
const implementation (
"oksconflibs" );
178 this_dblocation = location;
179 this_resource_location = implementation +
":" + location;
187 this_dblocation = location;
188 static QString
const implementation (
"roksconflibs" );
189 this_resource_location = implementation +
":" + location;
190 t_lock l ( this_change_enabled_mutex );
191 this_change_enabled =
true;
197 static QString
const implementation (
"rdbconfig" );
198 this_resource_location = implementation +
":" + location;
199 this_dblocation = this_resource_location;
200 t_lock l ( this_change_enabled_mutex );
201 this_change_enabled =
true;
229 ref().this_resource_location = Implementation;
244 if ( not fn.endsWith (
".schema.xml" ) )
249 catch ( dunedaq::conffwk::Generic
const & ex )
252 "\n\nCheck filename:", fn.toStdString() );
263 ref().get_commands()->clear();
265 ref().get_internal_change_stack()->swap ( cleared );
279 std::list<std::string> dbs;
296 if ( subscribeToChanges ==
true ) {
315 catch ( dunedaq::conffwk::Exception
const & e )
327 std::list<std::string> tobecommited{};
338 catch ( dunedaq::conffwk::Exception
const & e )
341 throw daq::dbe::CouldNotCommitChanges (
ERS_HERE,
"confaccessor", e );
350 QString DUNEDAQ_DB_PATH = getenv (
"DUNEDAQ_DB_PATH" );
351 QString GUI_DATA = getenv (
"OKS_GUI_INIT_DATA" );
353 QStringList CONFIG_DATABASE = GUI_DATA.split (
":", Qt::SkipEmptyParts );
354 QStringList DUNEDAQ_DB_PATH_SPLIT = DUNEDAQ_DB_PATH.split (
":", Qt::SkipEmptyParts );
358 std::vector<std::string> full_path_names;
360 for ( QString & FileName : CONFIG_DATABASE )
363 for ( QString & PATH : DUNEDAQ_DB_PATH_SPLIT )
365 QFileInfo CheckFile ( PATH +
"/" + FileName );
367 if ( CheckFile.exists() and CheckFile.isFile() )
369 QString fullpathname = PATH +
"/" + FileName;
370 full_path_names.push_back ( fullpathname.toStdString() );
391 throw daq::dbe::ChangeNotAllowed (
ERS_HERE );
402 throw daq::dbe::ChangeNotAllowed (
ERS_HERE );
422 Q_UNUSED ( parameter );
429 const auto& cl = Change->get_class_name();
430 const auto& mod = Change->get_modified_objs();
431 const auto& cre = Change->get_created_objs();
432 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.
Defines base class for cache of template objects.
char const *const dbe_lib_internal_version
std::string const parse(ers::Issue const &)
config_object_description dref
#define dbe_compiled_version