DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
Provides pure virtual interface used by the Configuration class. More...
#include <ConfigurationImpl.hpp>
Public Types | |
typedef void(*) | notify(std::vector< ConfigurationChange * > &changes, Configuration *) |
Callback to notify database changes. | |
typedef void(*) | pre_notify(Configuration *) |
Callback to pre-notify database changes. | |
Public Member Functions | |
ConfigurationImpl () noexcept | |
The constructor. | |
virtual | ~ConfigurationImpl () |
Virtual destructor. | |
virtual void | open_db (const std::string &db_name)=0 |
Open database implementation in accordance with given name. | |
virtual void | close_db ()=0 |
Close database implementation. | |
virtual bool | loaded () const noexcept=0 |
Check if a database is loaded. | |
virtual void | create (const std::string &db_name, const std::list< std::string > &includes)=0 |
Create database. | |
virtual bool | is_writable (const std::string &db_name)=0 |
Return write access status. | |
virtual void | add_include (const std::string &db_name, const std::string &include)=0 |
Add include file. | |
virtual void | remove_include (const std::string &db_name, const std::string &include)=0 |
Remove include file. | |
virtual void | get_includes (const std::string &db_name, std::list< std::string > &includes) const =0 |
Get included files. | |
virtual void | get_updated_dbs (std::list< std::string > &dbs) const =0 |
Get uncommitted files. | |
virtual void | set_commit_credentials (const std::string &user, const std::string &password)=0 |
Set commit credentials. | |
virtual void | commit (const std::string &log_message)=0 |
Commit database changes. | |
virtual void | abort ()=0 |
Abort database changes. | |
virtual void | prefetch_all_data ()=0 |
Prefetch all data into client cache. | |
virtual std::vector< dunedaq::conffwk::Version > | get_changes ()=0 |
Get newly available versions. | |
virtual std::vector< dunedaq::conffwk::Version > | get_versions (const std::string &since, const std::string &until, dunedaq::conffwk::Version::QueryType type, bool skip_irrelevant)=0 |
Get archived versions. | |
virtual void | get (const std::string &class_name, const std::string &id, ConfigObject &object, unsigned long rlevel, const std::vector< std::string > *rclasses)=0 |
Get object of class by id. | |
virtual void | get (const std::string &class_name, std::vector< ConfigObject > &objects, const std::string &query, unsigned long rlevel, const std::vector< std::string > *rclasses)=0 |
Get objects of class according to query. | |
virtual void | get (const ConfigObject &obj_from, const std::string &query, std::vector< ConfigObject > &objects, unsigned long rlevel, const std::vector< std::string > *rclasses)=0 |
Get objects according to path. | |
virtual bool | test_object (const std::string &class_name, const std::string &id, unsigned long rlevel, const std::vector< std::string > *rclasses)=0 |
Test object existence (used by Python binding) | |
virtual void | create (const std::string &at, const std::string &class_name, const std::string &id, ConfigObject &object)=0 |
Create object of class by id at given file. | |
virtual void | create (const ConfigObject &at, const std::string &class_name, const std::string &id, ConfigObject &object)=0 |
Create object of class by id at file identified by object 'at'. | |
virtual void | destroy (ConfigObject &object)=0 |
Destroy object of class by id. | |
virtual dunedaq::conffwk::class_t * | get (const std::string &class_name, bool direct_only)=0 |
Get description of class in accordance with parameters. | |
virtual void | get_superclasses (conffwk::fmap< conffwk::fset > &schema)=0 |
Get inheritance hierarchy. | |
virtual void | subscribe (const std::set< std::string > &class_names, const std::map< std::string, std::set< std::string > > &objs, notify cb, pre_notify pre_cb)=0 |
Subscribe on database changes. | |
virtual void | unsubscribe ()=0 |
Remove subscription on database changes. | |
virtual void | print_profiling_info () noexcept=0 |
Print implementation specific profiling information. | |
void | print_cache_info () noexcept |
Print profiling information about objects in cache. | |
void | set (Configuration *db) noexcept |
set configuration object | |
void | rename_impl_object (const std::string *class_name, const std::string &old_id, const std::string &new_id) noexcept |
rename object in cache | |
Protected Member Functions | |
ConfigObjectImpl * | get_impl_object (const std::string &class_name, const std::string &id) const noexcept |
get object from cache | |
void | put_impl_object (const std::string &class_name, const std::string &id, ConfigObjectImpl *obj) noexcept |
put object to cache | |
template<class T , class OBJ > | |
T * | insert_object (OBJ &obj, const std::string &id, const std::string &class_name) noexcept |
insert new object (update cache or create-and-insert) | |
void | clean () noexcept |
clean cache (e.g. to be used by destructor) | |
std::mutex & | get_conf_impl_mutex () const |
Is required by reload methods. | |
Protected Attributes | |
Configuration * | m_conf |
Configuration pointer is needed for notification on changes, e.g. in case of subscription or an object deletion. | |
Private Attributes | |
conffwk::pmap< conffwk::map< ConfigObjectImpl * > * > | m_impl_objects |
cache of implementation objects (class-name::->object_id->implementation) | |
std::vector< ConfigObjectImpl * > | m_tangled_objects |
unsigned long | p_number_of_cache_hits |
unsigned long | p_number_of_object_read |
Friends | |
class | ConfigObject |
class | ConfigObjectImpl |
class | Configuration |
Provides pure virtual interface used by the Configuration class.
The class has several pure virtual methods to manipulate databases, access database information, subscribe and receive notification on data changes. Any database implementation inherits from this class and implements it's methods.
The methods may throw dunedaq::conffwk::Exception exception (like Generic, NotFound) in case of an error unless noexcept is explicitly used in their specification.
Definition at line 43 of file ConfigurationImpl.hpp.
void(*) dunedaq::conffwk::ConfigurationImpl::notify(std::vector< ConfigurationChange * > &changes, Configuration *) |
Callback to notify database changes.
Definition at line 182 of file ConfigurationImpl.hpp.
void(*) dunedaq::conffwk::ConfigurationImpl::pre_notify(Configuration *) |
Callback to pre-notify database changes.
Definition at line 186 of file ConfigurationImpl.hpp.
|
noexcept |
The constructor.
Definition at line 224 of file ConfigurationImpl.cpp.
|
virtual |
Virtual destructor.
Definition at line 231 of file ConfigurationImpl.cpp.
|
pure virtual |
Abort database changes.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
pure virtual |
Add include file.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
protectednoexcept |
clean cache (e.g. to be used by destructor)
Definition at line 379 of file ConfigurationImpl.cpp.
|
pure virtual |
Close database implementation.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
pure virtual |
Commit database changes.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
pure virtual |
Create object of class by id at file identified by object 'at'.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
pure virtual |
Create object of class by id at given file.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
pure virtual |
Create database.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
pure virtual |
Destroy object of class by id.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
pure virtual |
Get objects according to path.
|
pure virtual |
Get description of class in accordance with parameters.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
pure virtual |
Get object of class by id.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
pure virtual |
Get objects of class according to query.
|
pure virtual |
Get newly available versions.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
protected |
Is required by reload methods.
Definition at line 398 of file ConfigurationImpl.cpp.
|
protectednoexcept |
get object from cache
Definition at line 246 of file ConfigurationImpl.cpp.
|
pure virtual |
Get included files.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
pure virtual |
Get inheritance hierarchy.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
pure virtual |
Get uncommitted files.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
pure virtual |
Get archived versions.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
inlineprotectednoexcept |
insert new object (update cache or create-and-insert)
Definition at line 232 of file ConfigurationImpl.hpp.
|
pure virtual |
Return write access status.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
pure virtualnoexcept |
Check if a database is loaded.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
pure virtual |
Open database implementation in accordance with given name.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
pure virtual |
Prefetch all data into client cache.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
noexcept |
Print profiling information about objects in cache.
Definition at line 237 of file ConfigurationImpl.cpp.
|
pure virtualnoexcept |
Print implementation specific profiling information.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
protectednoexcept |
put object to cache
Definition at line 333 of file ConfigurationImpl.cpp.
|
pure virtual |
Remove include file.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
noexcept |
rename object in cache
Definition at line 352 of file ConfigurationImpl.cpp.
|
inlinenoexcept |
|
pure virtual |
Set commit credentials.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
pure virtual |
Subscribe on database changes.
|
pure virtual |
Test object existence (used by Python binding)
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
pure virtual |
Remove subscription on database changes.
Implemented in dunedaq::oksconflibs::OksConfiguration.
|
friend |
Definition at line 45 of file ConfigurationImpl.hpp.
|
friend |
Definition at line 46 of file ConfigurationImpl.hpp.
|
friend |
Definition at line 47 of file ConfigurationImpl.hpp.
|
protected |
Configuration pointer is needed for notification on changes, e.g. in case of subscription or an object deletion.
Definition at line 260 of file ConfigurationImpl.hpp.
|
private |
cache of implementation objects (class-name::->object_id->implementation)
Definition at line 209 of file ConfigurationImpl.hpp.
|
private |
Definition at line 210 of file ConfigurationImpl.hpp.
|
mutableprivate |
Definition at line 212 of file ConfigurationImpl.hpp.
|
mutableprivate |
Definition at line 213 of file ConfigurationImpl.hpp.