DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::conffwk::Configuration Class Reference

Defines base class for cache of template objects. More...

#include <Configuration.hpp>

Collaboration diagram for dunedaq::conffwk::Configuration:
[legend]

Classes

struct  CallbackSubscription
struct  CallbackPreSubscription
class  AttributeConverterBase
class  AttributeConverter
 Virtual converter class. More...

Public Types

typedef void(* notify) (const std::vector< ConfigurationChange * > &changed_classes, void *parameter)
 The user notification callback function which is invoked in case of changes.
typedef void(* pre_notify) (void *parameter)
 The user notification callback function which is invoked before changes are going to be applied.
typedef CallbackSubscriptionCallbackId
 Callback identifier.

Public Member Functions

 Configuration (const std::string &spec)
 Constructor to build a configuration object using implementation plug-in.
 Configuration ()
const std::string & get_impl_spec () const noexcept
const std::string & get_impl_name () const noexcept
const std::string & get_impl_param () const noexcept
 ~Configuration () noexcept
 Destructor to destroy a configuration object.
CallbackId subscribe (const ConfigurationSubscriptionCriteria &criteria, notify user_cb, void *user_param=nullptr)
 Subscribe on configuration changes.
CallbackId subscribe (pre_notify user_cb, void *user_param=nullptr)
 Subscribe on pre-notification on configuration changes.
void unsubscribe (CallbackId cb_handler=0)
 Remove callback function.
template<class T>
bool is_valid (const T *object) noexcept
 Checks validity of pointer to an objects of given user class.
template<class T>
void update (const std::vector< std::string > &modified, const std::vector< std::string > &removed, const std::vector< std::string > &created) noexcept
 Update cache of objects in case of modification.
void update_cache (std::vector< ConfigurationChange * > &changes) noexcept
 System function invoked in case of modifications.
template<class T>
void _reset_objects () noexcept
 Update state of objects after abort operations.
void unread_all_objects (bool unread_implementation_objs=false) noexcept
 Unread all template (i.e. set their state as uninitialized) and implementation objects (i.e. clear their cache).
void unread_template_objects () noexcept
 Unread all template (i.e. set their state as uninitialized) objects.
void unread_implementation_objects (dunedaq::conffwk::ObjectState state) noexcept
 Unread implementation objects (i.e. clear their cache).
void create (const std::string &at, const std::string &class_name, const std::string &id, ConfigObject &object)
 Create new object by class name and object id.
void create (const ConfigObject &at, const std::string &class_name, const std::string &id, ConfigObject &object)
 Create new object by class name and object id.
template<class T>
const T * create (const std::string &at, const std::string &id, bool init_object=false)
 Create object of given class by identity and instantiate the template parameter with it.
template<class T>
const T * create (const DalObject &at, const std::string &id, bool init_object=false)
 Create object of given class by identity and instantiate the template parameter with it.
void destroy_obj (ConfigObject &object)
 Destroy object.
template<class T>
void destroy (T &obj)
 Destroy object of given class.
bool test_object (const std::string &class_name, const std::string &id, unsigned long rlevel=0, const std::vector< std::string > *rclasses=0)
 Test the object existence.
void get (const std::string &class_name, const std::string &id, ConfigObject &object, unsigned long rlevel=0, const std::vector< std::string > *rclasses=0)
 Get object by class name and object id (multi-thread safe).
void get (const std::string &class_name, std::vector< ConfigObject > &objects, const std::string &query="", unsigned long rlevel=0, const std::vector< std::string > *rclasses=0)
 Get all objects of class.
void get (const ConfigObject &obj_from, const std::string &query, std::vector< ConfigObject > &objects, unsigned long rlevel=0, const std::vector< std::string > *rclasses=0)
 Get path between objects.
template<class T>
const T * get (const std::string &id, bool init_children=false, bool init=true, unsigned long rlevel=0, const std::vector< std::string > *rclasses=0)
 Get object of given class by identity and instantiate the template parameter with it (multi-thread safe).
template<class T>
const T * get (ConfigObject &obj, bool init_children=false, bool init=true)
 Get object of given class by object reference and instantiate the template parameter with it (multi-thread safe).
template<class T>
void get (std::vector< const T * > &objects, bool init_children=false, bool init=true, const std::string &query="", unsigned long rlevel=0, const std::vector< std::string > *rclasses=0)
 Get all objects of given class and instantiate a vector of the template parameters object with it (multi-thread safe).
template<class T>
const T * get (ConfigObject &obj, const std::string &id)
 Generate object of given class by object reference and instantiate the template parameter with it (multi-thread safe).
template<class T>
const T * find (const std::string &id)
 Find object of given class (multi-thread safe).
template<class T>
const T * ref (ConfigObject &obj, const std::string &name, bool init=false)
 Get signle value of object's relation and instantiate result with it (multi-thread safe).
template<class T>
void ref (ConfigObject &obj, const std::string &name, std::vector< const T * > &objects, bool init=false)
 Get multiple values of object's relation and instantiate result with them (multi-thread safe).
template<class T, class V>
void referenced_by (const T &obj, std::vector< const V * > &objects, const std::string &relationship_name="*", bool check_composite_only=true, bool init=false, unsigned long rlevel=0, const std::vector< std::string > *rclasses=nullptr)
 Get template DAL objects holding references on this object via given relationship (multi-thread safe).
std::vector< const DalObject * > referenced_by (const DalObject &obj, const std::string &relationship_name="*", bool check_composite_only=true, bool upcast_unregistered=true, bool init=false, unsigned long rlevel=0, const std::vector< std::string > *rclasses=nullptr)
 Get DAL objects holding references on this object via given relationship (multi-thread safe).
template<class TARGET, class SOURCE>
const TARGET * cast (const SOURCE *s) noexcept
 Cast objects from one class to another (multi-thread safe).
template<class T>
void downcast_dal_objects (const std::vector< const T * > &objs, bool, std::vector< const DalObject * > &result)
template<class T>
void downcast_dal_object (const T *obj, bool, std::vector< const DalObject * > &result)
template<class T>
const T * _find (const std::string &id)
 Multi-thread unsafe version of find(const std::string&) method.
template<class T>
const T * _ref (ConfigObject &obj, const std::string &name, bool read_children)
 Multi-thread unsafe version of ref(ConfigObject&, const std::string&, bool); The method should not be used by user.
template<class T>
void _ref (ConfigObject &obj, const std::string &name, std::vector< const T * > &results, bool read_children)
 Multi-thread unsafe version of ref(ConfigObject&, const std::string&, std::vector<const T*>&, bool); The method should not be used by user.
bool try_cast (const std::string &target, const std::string &source) noexcept
 Checks if cast from source class to target class is allowed.
bool try_cast (const std::string *target, const std::string *source) noexcept
bool is_superclass_of (const std::string &target, const std::string &source) noexcept
bool is_superclass_of (const std::string *target, const std::string *source) noexcept
bool loaded () const noexcept
 Check if database is correctly loaded.
void load (const std::string &db_name)
 Load database according to the name. If name is empty, take it from TDAQ_DB_NAME and TDAQ_DB_DATA environment variables.
void unload ()
 Unload database.
void create (const std::string &db_name, const std::list< std::string > &includes)
 Create database.
bool is_writable (const std::string &db_name) const
 Get write access status.
void add_include (const std::string &db_name, const std::string &include)
 Add include file to existing database.
void remove_include (const std::string &db_name, const std::string &include)
 Remove include file.
void get_includes (const std::string &db_name, std::list< std::string > &includes) const
 Get include files.
void get_updated_dbs (std::list< std::string > &dbs) const
 Get list of updated files to be committed.
void set_commit_credentials (const std::string &user, const std::string &password)
 Set commit credentials.
void commit (const std::string &log_message="")
 Commit database changes.
void abort ()
 Abort database changes.
void prefetch_all_data ()
 Prefetch all data into client cache.
std::vector< dunedaq::conffwk::Versionget_changes ()
 Get new conffwk versions.
std::vector< dunedaq::conffwk::Versionget_versions (const std::string &since, const std::string &until, dunedaq::conffwk::Version::QueryType type=dunedaq::conffwk::Version::query_by_date, bool skip_irrelevant=true)
 Get repository versions in interval.
const dunedaq::conffwk::class_tget_class_info (const std::string &class_name, bool direct_only=false)
 The method provides access to description of class.
void export_schema (boost::property_tree::ptree &tree, const std::string &classes="", bool direct_only=false)
 Export configuration schema into ptree.
void export_data (boost::property_tree::ptree &tree, const std::string &classes="", const std::string &objects="", const std::string &files="", const std::string &empty_array_item="")
 Export configuration data into ptree.
template<class T>
void register_converter (AttributeConverter< T > *object) noexcept
 Register user function for attribute conversion.
template<class T>
void convert (T &value, const ConfigObject &obj, const std::string &attr_name) noexcept
 Converts single value.
template<class T>
void convert2 (std::vector< T > &value, const ConfigObject &obj, const std::string &attr_name) noexcept
 Converts vector of single values.
void print_profiling_info () noexcept
 Print out profiling information.
const conffwk::fmap< conffwk::fset > & superclasses () const noexcept
const conffwk::fmap< conffwk::fset > & subclasses () const
std::vector< std::string > classes_in_python () const
void print (std::ostream &) const noexcept
 Prints out details of configuration object.
void add_action (ConfigAction *ac)
void remove_action (ConfigAction *ac)
std::unordered_map< std::string, std::unordered_map< std::string, std::string > > attributes_pybind (const std::string &class_name, bool all)
std::vector< std::string > get_class_list () const
ConfigObjectcreate_and_return_obj_pybind (const std::string &at, const std::string &class_name, const std::string &id)
ConfigObjectcreate_and_return_obj_pybind (const ConfigObject &at, const std::string &class_name, const std::string &id)
ConfigObjectget_obj_pybind (const std::string &class_name, const std::string &id)
std::vector< ConfigObject > * get_objs_pybind (const std::string &class_name, const std::string &query="")
std::unordered_map< std::string, std::unordered_map< std::string, std::string > > relations_pybind (const std::string &class_name, bool all)
std::list< std::string > * return_includes_pybind (const std::string &db_name)
std::vector< std::string > subclasses_pybind (const std::string &class_name, bool all)
std::vector< std::string > superclasses_pybind (const std::string &class_name, bool all)
const std::string & get_schema_path_pybind (const std::string &class_name)

Static Public Member Functions

static void system_cb (std::vector< ConfigurationChange * > &, Configuration *) noexcept
 System callback function invoked in case of modifications.
static void system_pre_cb (Configuration *) noexcept
 System callback function invoked in case of pre-modifications.

Private Types

typedef std::set< CallbackSubscription *, std::less< CallbackSubscription * > > CallbackSet
typedef std::set< CallbackPreSubscription *, std::less< CallbackPreSubscription * > > PreCallbackSet

Private Member Functions

void reset_subscription ()
void _unread_template_objects () noexcept
void _unread_implementation_objects (dunedaq::conffwk::ObjectState state) noexcept
void _get (const std::string &class_name, const std::string &id, ConfigObject &object, unsigned long rlevel, const std::vector< std::string > *rclasses)
template<class T>
const T * _get (const std::string &id, bool init_children=false, bool init=true, unsigned long rlevel=0, const std::vector< std::string > *rclasses=0)
template<class T>
const T * _get (ConfigObject &obj, bool init_children=false, bool init=true)
template<class T>
void _get (std::vector< const T * > &objects, bool init_children=false, bool init=true, const std::string &query="", unsigned long rlevel=0, const std::vector< std::string > *rclasses=0)
template<class T>
DalObject_make_instance (ConfigObject &obj, const std::string &uid)
const dunedaq::conffwk::class_t_get_class_info (const std::string &class_name, bool direct_only=false)
void set_subclasses () noexcept
void set_class_domain_map ()
void update_classes () noexcept
std::deque< std::set< std::string > > find_class_domains ()
void rename_object (ConfigObject &obj, const std::string &new_id)
 Cache of template object of given type.
CallbackSubscriptionfind_callback (CallbackId cb_handler) const
void action_on_update (const ConfigObject &obj, const std::string &name)
 Configuration (const Configuration &)
Configurationoperator= (const Configuration &)

Static Private Member Functions

static void update_impl_objects (conffwk::pmap< conffwk::map< ConfigObjectImpl * > * > &cache, ConfigurationChange &change, const std::string *class_name)
static std::string mk_ref_ex_text (const char *what, const std::string &cname, const std::string &rname, const ConfigObject &obj) noexcept
static std::string mk_ref_by_ex_text (const std::string &cname, const std::string &rname, const ConfigObject &obj) noexcept

Private Attributes

conffwk::map< dunedaq::conffwk::class_t * > p_direct_classes_desc_cache
conffwk::map< dunedaq::conffwk::class_t * > p_all_classes_desc_cache
std::atomic< uint_least64_t > p_number_of_cache_hits
std::atomic< uint_least64_t > p_number_of_template_object_created
std::atomic< uint_least64_t > p_number_of_template_object_read
conffwk::fmap< conffwk::fsetp_superclasses
conffwk::fmap< conffwk::fsetp_subclasses
conffwk::fmap< uint > p_class_domain_map
conffwk::map< std::list< AttributeConverterBase * > * > m_convert_map
ConfigurationImplm_impl
std::string m_impl_spec
std::string m_impl_name
std::string m_impl_param
void * m_shlib_h
CallbackSet m_callbacks
PreCallbackSet m_pre_callbacks
std::list< ConfigAction * > m_actions
DalRegistry m_registry
std::mutex m_impl_mutex
std::mutex m_tmpl_mutex
std::mutex m_actn_mutex
std::mutex m_else_mutex

Friends

class DalObject
class ConfigObject
class ConfigurationImpl
class DalRegistry

Detailed Description

Defines base class for cache of template objects.

The class is used as a base class for any cached template object. It defines:

  • virtual destructor
  • DAL factory functions
    \brief Provides abstract interface to database data.
    
     The class provides interfaces to data access and notification on data changes
     which are independent from the database implementation.
    
     The class is an entry point to the database information. It provides access
     to the database objects by name of the class and optionally (for named objects)
     by object identities. Normally, user should use this class to open/close database
     and to access objects via template \c get methods invoked with classes generated
     by the genconffwk utility.
    
     Below there is brief description of main methods. Most of then can only be used
     after successful initialization (i.e. database load) of the Configuration object.
    
     Methods throw exceptions in case of an error unless \b noexcept is explicitly
     used in their specification. The following exceptions can be thrown:
     - dunedaq::conffwk::Generic        is used to report most of the problems (bad DB, wrong parameter, plug-in specific, etc.)
     - dunedaq::conffwk::NotFound       the conffwk object accessed by ID is not found, class accessed by name is not found
     - dunedaq::conffwk::DeletedObject  accessing template object that has been deleted (via notification or by the user's code)
    
     All above exceptions have common class dunedaq::conffwk::Exception, that can be used to catch all of them.
    
try {
// load database using oks file /tmp/mydb.data.xml
Configuration db("oksconflibs:/tmp/mydb.data.xml");
// get object "foo@bar"
db.get("bar", "foo", obj);
// print object to the standard output stream
obj.print_ref(std::cout, db);
}
// the catch of dunedaq::conffwk::NotFound exception is optional:
// it is only used to distinguish NotFound exception from other possible once
catch (dunedaq::conffwk::NotFound & ex) {
std::cerr << "Object foo@bar is not found: " << ex << std::endl;
}
// always catch this exception: it can come unexpectedly from DBMS implementation,
// e.g. because of hardware problems or lack of computer resources
catch (dunedaq::conffwk::Exception & ex) {
std::cerr << "ERROR: " << ex << std::endl;
}
Configuration(const std::string &spec)
Constructor to build a configuration object using implementation plug-in.
msgpack::object obj


Database Manipulation

To get data a database can be opened, closed and it's state can be checked by the following methods:

  • load() open database (by default, the database is opened by the constructor)
  • unload() closes database (by default, the database is closed by the destructor)
  • loaded() returns true, if a database is correctly loaded

To create or to modify data a database the following methods can be used:

  • create(const std::string&, const std::string&, const std::list<std::string>&) create new database
  • add_include() add include to an existing database
  • remove_include() remove include from an existing database
  • commit() save chain of changes
  • abort() cancel all previous changes
Objects Access

The access to the objects is provided via two main methods:

Below there is example to read all computer objects

try {
Configuration db("oksconflibs:daq/partitions/part_hlt.data.xml");
// read all objects of "Computer" class
std::vector<ConfigObject> hosts;
db.get("Computer", hosts);
// print details of the Computer objects
for (const auto& x : objects)
x.print_ref(std::cout, db);
}
catch (dunedaq::conffwk::Exception & ex) {
std::cerr << "ERROR: " << ex << std::endl;
}
 For objects of classes generated by genconffwk there are analogous template methods which
 in addition store pointers to objects in the cache and which to be used by end-user:
 - get(const std::string& id, bool, bool, unsigned long, const std::vector<std::string> *) return const pointer to object of given user class
 - get(std::vector<const T*>& objects, bool, bool, const std::string& query, unsigned long, const std::vector<std::string> *) fills vector of objects of given user class

 Below there is an example for generated \b dal package:
// include generated files for classes used below
#include "dal/Variable.h"
#include "dal/Segment.h"
try {
Configuration db("oksconflibs:daq/partitions/part_hlt.data.xml");
// read all variables with Name = "TDAQ_DB_NAME"
std::vector<const daq::core::Variable*> vars;
db.get(vars, false, true, "(all (\"Name\" \"TDAQ_ERS_INFO\" =))");
// print variables
std::cout << "Got " << vars.size() << " variables with name TDAQ_ERS_INFO:\n";
for (const auto& x : vars)
std::cout << "object " << x << " => " << x->get_Value() << std::endl;
// get segment with id = "online" and print if found
if (const daq::core::Segment * p = db.get<daq::core::Segment>("online"))
std::cout << "The segment object is: " << *p << std::endl;
}
catch (dunedaq::conffwk::Exception & ex) {
std::cerr << "ERROR: " << ex << std::endl;
}
 \par Notification

 To subscribe and unsubscribe on changes it is necessary to create a subscription criteria
 (see ConfigurationSubscriptionCriteria class for more information).
 When a subscription criteria object is created, the following methods can be used:
 - subscribe() subscribe on any changes according criteria
 - unsubscribe() unsubscribe above changes (the CallbackId is returned by above method)

Definition at line 228 of file Configuration.hpp.

Member Typedef Documentation

◆ CallbackId

Callback identifier.

It uniquely identifies a callback inside given process. It is returned by subscribe() method and must be used as parameter for the unsubscribe() methods.

Definition at line 337 of file Configuration.hpp.

◆ CallbackSet

Definition at line 1684 of file Configuration.hpp.

◆ notify

typedef void(* dunedaq::conffwk::Configuration::notify) (const std::vector< ConfigurationChange * > &changed_classes, void *parameter)

The user notification callback function which is invoked in case of changes.

Parameters
changed_classesvector of changed classes
parameteruser-defined parameter

Definition at line 294 of file Configuration.hpp.

◆ pre_notify

typedef void(* dunedaq::conffwk::Configuration::pre_notify) (void *parameter)

The user notification callback function which is invoked before changes are going to be applied.

Parameters
parameteruser-defined parameter

Definition at line 306 of file Configuration.hpp.

◆ PreCallbackSet

Definition at line 1685 of file Configuration.hpp.

Constructor & Destructor Documentation

◆ Configuration() [1/3]

dunedaq::Configuration::Configuration ( const std::string & spec)

Constructor to build a configuration object using implementation plug-in.

The constructor expects parameter in format "plugin-name:plugin-parameter". The plugin-name is used to get implementation shared library by adding "lib" prefix and ".so" suffix, e.g. "oksconflibs" -> "liboksconflibs.so". The plugin-parameter is optional; if non-empty, it is passed to the plug-in constructor.

Parameters
specdatabase name to be understood by the database implementation
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 109 of file Configuration.cpp.

109 :
111{
112 std::string s;
113
114 if (spec.empty())
115 {
116 if (const char *env = getenv("TDAQ_DB"))
117 m_impl_spec = env;
118 }
119 else
120 {
121 m_impl_spec = spec;
122 }
123
124 if (m_impl_spec.empty())
125 throw dunedaq::conffwk::Generic(ERS_HERE, "no database parameter found (check parameter of the constructor or value of TDAQ_DB environment variable)");
126
127 std::string::size_type idx = m_impl_spec.find_first_of(':');
128
129 if (idx == std::string::npos)
130 {
132 }
133 else
134 {
135 m_impl_name = m_impl_spec.substr(0, idx);
136 m_impl_param = m_impl_spec.substr(idx + 1);
137 }
138
139 std::string plugin_name = std::string("lib") + m_impl_name + ".so";
140 std::string impl_creator = std::string("_") + m_impl_name + "_creator_";
141
142 // load plug-in
143 m_shlib_h = dlopen(plugin_name.c_str(), RTLD_LAZY | RTLD_GLOBAL);
144
145 if (!m_shlib_h)
146 {
147 std::ostringstream text;
148 text << "failed to load implementation plug-in \'" << plugin_name << "\': \"" << dlerror() << '\"';
149 throw(dunedaq::conffwk::Generic( ERS_HERE, text.str().c_str() ) );
150 }
151
152 // search in plug-in implementation creator function
153
155 (*f)(const std::string& spec);
156
158 (*)(const std::string&))dlsym(m_shlib_h, impl_creator.c_str());
159
160 char * error = 0;
161
162 if ((error = dlerror()) != 0)
163 {
164 std::ostringstream text;
165 text << "failed to find implementation creator function \'" << impl_creator << "\' in plug-in \'" << plugin_name << "\': \"" << error << '\"';
166 throw(dunedaq::conffwk::Generic( ERS_HERE, text.str().c_str() ) );
167 }
168
169
170 // create implementation
171
172 m_impl = (*f)(m_impl_param);
173
174 if (m_impl)
175 {
176 // m_impl->get_superclasses(p_superclasses);
177 // set_subclasses();
179 m_impl->set(this);
180 }
181
183 m_impl->prefetch_all_data();
184
185 TLOG_DEBUG(2) << "\n*** DUMP CONFIGURATION ***\n" << *this;
186}
#define ERS_HERE
std::atomic< uint_least64_t > p_number_of_template_object_created
std::atomic< uint_least64_t > p_number_of_template_object_read
std::atomic< uint_least64_t > p_number_of_cache_hits
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112
static bool check_prefetch_needs()
CIB Buffer std::string descriptor Message from std::string descriptor CIB process error

◆ Configuration() [2/3]

dunedaq::Configuration::Configuration ( )

Definition at line 104 of file Configuration.cpp.

◆ ~Configuration()

dunedaq::Configuration::~Configuration ( )
noexcept

Destructor to destroy a configuration object.

The destructor unloads database for given database implementation and destroys all user objects in cache.

Definition at line 221 of file Configuration.cpp.

222{
223 if (::getenv("TDAQ_DUMP_CONFFWK_PROFILER_INFO"))
225
226 try
227 {
228 unload();
229
230 if (m_shlib_h)
231 {
232 std::lock_guard<std::mutex> scoped_lock(m_impl_mutex);
233
234 delete m_impl;
235 m_impl = 0;
236 //dlclose(m_shlib_h);
237 m_shlib_h = 0;
238 }
239 }
240 catch (dunedaq::conffwk::Generic& ex)
241 {
242 ers::error(ex);
243 }
244}
void print_profiling_info() noexcept
Print out profiling information.
void unload()
Unload database.
void error(const Issue &issue)
Definition ers.hpp:92

◆ Configuration() [3/3]

dunedaq::conffwk::Configuration::Configuration ( const Configuration & )
private

Member Function Documentation

◆ _find()

template<class T>
const T * dunedaq::conffwk::Configuration::_find ( const std::string & id)

Multi-thread unsafe version of find(const std::string&) method.

Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 55 of file Configuration.hxx.

56 {
57 // auto it = m_cache_map.find(&T::s_class_name);
58 // return (it != m_cache_map.end() ? static_cast<Cache<T>*>(it->second)->find(id) : nullptr);
59 return m_registry.find<T>(id);
60 }

◆ _get() [1/4]

template<class T>
const T * dunedaq::conffwk::Configuration::_get ( ConfigObject & obj,
bool init_children = false,
bool init = true )
private
Exceptions
dunedaq::conffwk::Generic

Definition at line 40 of file Configuration.hxx.

41 {
42 return m_registry.get<T>(obj, init_children, init_object);
43 }

◆ _get() [2/4]

void dunedaq::conffwk::Configuration::_get ( const std::string & class_name,
const std::string & id,
ConfigObject & object,
unsigned long rlevel,
const std::vector< std::string > * rclasses )
private
Exceptions
dunedaq::conffwk::Genericor dunedaq::conffwk::NotFound

◆ _get() [3/4]

template<class T>
const T * dunedaq::conffwk::Configuration::_get ( const std::string & id,
bool init_children = false,
bool init = true,
unsigned long rlevel = 0,
const std::vector< std::string > * rclasses = 0 )
private
Exceptions
dunedaq::conffwk::Generic

Definition at line 32 of file Configuration.hxx.

33 {
34 return m_registry.get<T>(name, init_children, init_object, rlevel, rclasses);
35 }

◆ _get() [4/4]

template<class T>
void dunedaq::conffwk::Configuration::_get ( std::vector< const T * > & objects,
bool init_children = false,
bool init = true,
const std::string & query = "",
unsigned long rlevel = 0,
const std::vector< std::string > * rclasses = 0 )
private
Exceptions
dunedaq::conffwk::Generic

Definition at line 65 of file Configuration.hxx.

66 {
67 std::vector<ConfigObject> objs;
68
69 try
70 {
71 get(T::s_class_name, objs, query, rlevel, rclasses);
72 }
73 catch (dunedaq::conffwk::NotFound & ex)
74 {
75 std::ostringstream text;
76 text << "wrong database schema, cannot find class \'" << ex.get_data() << '\'';
77 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
78 }
79
80 if (!objs.empty())
81 {
82 for (auto& i : objs)
83 {
84 result.push_back(this->_get<T>(i, init_children, init_object));
85 }
86 }
87 }
void _get(const std::string &class_name, const std::string &id, ConfigObject &object, unsigned long rlevel, const std::vector< std::string > *rclasses)
void get(const std::string &class_name, const std::string &id, ConfigObject &object, unsigned long rlevel=0, const std::vector< std::string > *rclasses=0)
Get object by class name and object id (multi-thread safe).

◆ _get_class_info()

const dunedaq::conffwk::class_t & dunedaq::Configuration::_get_class_info ( const std::string & class_name,
bool direct_only = false )
private

Definition at line 902 of file Configuration.cpp.

903{
904 conffwk::map<dunedaq::conffwk::class_t *>& d_cache(direct_only ? p_direct_classes_desc_cache : p_all_classes_desc_cache);
905
906 conffwk::map<dunedaq::conffwk::class_t *>::const_iterator i = d_cache.find(class_name);
907
908 if (i != d_cache.end())
909 return *(i->second);
910
911 try
912 {
913 dunedaq::conffwk::class_t * d = m_impl->get(class_name, direct_only);
914 d_cache[class_name] = d;
915 return *d;
916 }
917 // catch Generic exception only; the NotFound is forwarded from implementation
918 catch (dunedaq::conffwk::Generic& ex)
919 {
920 std::ostringstream text;
921 text << "failed to get description of class \'" << class_name << '\'';
922 throw dunedaq::conffwk::Generic( ERS_HERE, text.str().c_str(), ex );
923 }
924}
conffwk::map< dunedaq::conffwk::class_t * > p_all_classes_desc_cache
conffwk::map< dunedaq::conffwk::class_t * > p_direct_classes_desc_cache

◆ _make_instance()

template<class T>
DalObject * dunedaq::conffwk::Configuration::_make_instance ( ConfigObject & obj,
const std::string & uid )
inlineprivate
Exceptions
dunedaq::conffwk::Generic

Definition at line 980 of file Configuration.hpp.

981 {
982 // note upcast since the _get() returns pointer to T
983 return const_cast<T*>(_get<T>(obj, uid));
984 }

◆ _ref() [1/2]

template<class T>
const T * dunedaq::conffwk::Configuration::_ref ( ConfigObject & obj,
const std::string & name,
bool read_children )

Multi-thread unsafe version of ref(ConfigObject&, const std::string&, bool); The method should not be used by user.

Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 93 of file Configuration.hxx.

94 {
95 return m_registry._ref<T>(obj, name, read_children);
96 // ConfigObject res;
97
98 // try
99 // {
100 // obj.get(name, res);
101 // }
102 // catch (dunedaq::conffwk::Generic & ex)
103 // {
104 // throw(dunedaq::conffwk::Generic( ERS_HERE, mk_ref_ex_text("an object", T::s_class_name, name, obj).c_str(), ex ) );
105 // }
106
107 // return ((!res.is_null()) ? get_cache<T>(res.class_name())->get(*this, res, read_children, read_children) : nullptr);
108 }

◆ _ref() [2/2]

template<class T>
void dunedaq::conffwk::Configuration::_ref ( ConfigObject & obj,
const std::string & name,
std::vector< const T * > & results,
bool read_children )

Multi-thread unsafe version of ref(ConfigObject&, const std::string&, std::vector<const T*>&, bool); The method should not be used by user.

Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 114 of file Configuration.hxx.

115 {
116
117 return m_registry._ref<T>(obj, name, results, read_children);
118 // std::vector<ConfigObject> objs;
119
120 // results.clear();
121
122 // try
123 // {
124 // obj.get(name, objs);
125 // results.reserve(objs.size());
126
127 // for (auto& i : objs)
128 // {
129 // results.push_back(get_cache<T>(i.class_name())->get(*this, i, read_children, read_children));
130 // }
131 // }
132 // catch (dunedaq::conffwk::Generic & ex)
133 // {
134 // throw(dunedaq::conffwk::Generic( ERS_HERE, mk_ref_ex_text("objects", T::s_class_name, name, obj).c_str(), ex ) );
135 // }
136 }

◆ _reset_objects()

template<class T>
void dunedaq::conffwk::Configuration::_reset_objects ( )
noexcept

Update state of objects after abort operations.

It is used by automatically generated data access libraries.

Definition at line 318 of file Configuration.hxx.

319 {
320 // auto j = m_cache_map.find(&T::s_class_name);
321
322 // if (j != m_cache_map.end())
323 // {
324 // _unread_objects(static_cast<Cache<T>*>(j->second));
325 // }
326 m_registry._reset_objects<T>();
327 }

◆ _unread_implementation_objects()

void dunedaq::Configuration::_unread_implementation_objects ( dunedaq::conffwk::ObjectState state)
privatenoexcept

Definition at line 668 of file Configuration.cpp.

669{
670 for (auto &i : m_impl->m_impl_objects)
671 for (auto &j : *i.second)
672 {
673 std::lock_guard<std::mutex> scoped_lock(j.second->m_mutex);
674 j.second->clear();
675 j.second->m_state = state;
676 }
677
678 for (auto& x : m_impl->m_tangled_objects)
679 {
680 std::lock_guard<std::mutex> scoped_lock(x->m_mutex);
681 x->clear();
682 x->m_state = state;
683 }
684}

◆ _unread_template_objects()

void dunedaq::Configuration::_unread_template_objects ( )
privatenoexcept

Definition at line 662 of file Configuration.cpp.

663{
664 m_registry.unread_all();
665}

◆ abort()

void dunedaq::Configuration::abort ( )

Abort database changes.

The method rolls back non-committed database modifications.

Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 608 of file Configuration.cpp.

609{
610 TLOG_DEBUG(1) << "call abort";
611
612 if (m_impl == nullptr)
613 throw dunedaq::conffwk::Generic( ERS_HERE, "no implementation loaded");
614
615 std::lock_guard<std::mutex> scoped_lock1(m_tmpl_mutex); // always lock template objects mutex first
616 std::lock_guard<std::mutex> scoped_lock2(m_impl_mutex);
617
618 try
619 {
620 m_impl->abort();
623 // m_impl->get_superclasses(p_superclasses);
624 // set_subclasses();
626
627 }
628 catch (dunedaq::conffwk::Generic & ex)
629 {
630 throw(dunedaq::conffwk::Generic( ERS_HERE, "abort failed", ex));
631 }
632}
void _unread_implementation_objects(dunedaq::conffwk::ObjectState state) noexcept

◆ action_on_update()

void dunedaq::Configuration::action_on_update ( const ConfigObject & obj,
const std::string & name )
private

Definition at line 87 of file Configuration.cpp.

88{
89 std::lock_guard<std::mutex> scoped_lock(m_actn_mutex);
90 for (auto &i : m_actions)
91 i->update(obj, name);
92}
std::list< ConfigAction * > m_actions

◆ add_action()

void dunedaq::Configuration::add_action ( ConfigAction * ac)

Add global action performed by user code on db [un]load and updates.

Definition at line 73 of file Configuration.cpp.

74{
75 std::lock_guard<std::mutex> scoped_lock(m_actn_mutex);
76 m_actions.push_back(ac);
77}

◆ add_include()

void dunedaq::Configuration::add_include ( const std::string & db_name,
const std::string & include )

Add include file to existing database.

The method adds (and loads) existing include file to the database.

Parameters
db_namename of database file to be included
includefile to be included
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 481 of file Configuration.cpp.

482{
483 if (m_impl == nullptr)
484 throw dunedaq::conffwk::Generic( ERS_HERE, "no implementation loaded" );
485
486 std::lock_guard<std::mutex> scoped_lock(m_impl_mutex);
487
488 try
489 {
490 m_impl->add_include(db_name, include);
491 // m_impl->get_superclasses(p_superclasses);
492 // set_subclasses();
494 }
495 catch(dunedaq::conffwk::Generic & ex)
496 {
497 std::ostringstream text;
498 text << "failed to add include \'" << include << "\' to database \'" << db_name<< '\'';
499 throw ( dunedaq::conffwk::Generic( ERS_HERE, text.str().c_str(), ex ) );
500 }
501}

◆ attributes_pybind()

std::unordered_map< std::string, std::unordered_map< std::string, std::string > > dunedaq::Configuration::attributes_pybind ( const std::string & class_name,
bool all )

Definition at line 2006 of file Configuration.cpp.

2006 {
2007
2008 std::unordered_map<std::string, std::unordered_map<std::string, std::string>> all_attributes_properties;
2009
2010 const dunedaq::conffwk::class_t& c = this->get_class_info(class_name, !all);
2011
2012 for (const auto& ap : c.p_attributes) {
2013 std::unordered_map<std::string, std::string> attribute_properties;
2014 attribute_properties["type"] = dunedaq::conffwk::attribute_t::type(ap.p_type);
2015
2016 attribute_properties["range"] = ap.p_range.empty() ? "None" : ap.p_range;
2017
2018 attribute_properties["description"] = ap.p_description;
2019
2020 attribute_properties["multivalue"] = ap.p_is_multi_value ? "True" : "False";
2021
2022 attribute_properties["not-null"] = ap.p_is_not_null ? "True" : "False";
2023
2024 attribute_properties["init-value"] = ap.p_default_value.empty() ? "None" : ap.p_default_value;
2025
2026 all_attributes_properties[ap.p_name] = attribute_properties;
2027 }
2028
2029 return all_attributes_properties;
2030}
const dunedaq::conffwk::class_t & get_class_info(const std::string &class_name, bool direct_only=false)
The method provides access to description of class.
static const char * type(type_t type)

◆ cast()

template<class TARGET, class SOURCE>
const TARGET * dunedaq::conffwk::Configuration::cast ( const SOURCE * s)
inlinenoexcept

Cast objects from one class to another (multi-thread safe).

Try to cast object SOURCE to TARGET. Returns 0 if not successful. Do not use the normal dynamic_cast<T>() for database classes.

Returns
Return nullptr if the cast is not successful.

Definition at line 957 of file Configuration.hpp.

957 {
958 return s->template cast<TARGET>();
959 }
const TARGET * cast(const SOURCE *s) noexcept
Cast objects from one class to another (multi-thread safe).

◆ classes_in_python()

std::vector< std::string > dunedaq::conffwk::Configuration::classes_in_python ( ) const

◆ commit()

void dunedaq::Configuration::commit ( const std::string & log_message = "")

Commit database changes.

The method commits the changes after a database was modified.

Parameters
log_messagelog information
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 587 of file Configuration.cpp.

588{
589 TLOG_DEBUG(1) << "call commit";
590
591 if (m_impl == nullptr)
592 throw dunedaq::conffwk::Generic( ERS_HERE, "no implementation loaded");
593
594 std::lock_guard<std::mutex> scoped_lock1(m_tmpl_mutex); // always lock template objects mutex first
595 std::lock_guard<std::mutex> scoped_lock2(m_impl_mutex);
596
597 try
598 {
599 m_impl->commit(log_message);
600 }
601 catch (dunedaq::conffwk::Generic & ex)
602 {
603 throw(dunedaq::conffwk::Generic( ERS_HERE, "commit failed", ex ) );
604 }
605}

◆ convert()

template<class T>
void dunedaq::conffwk::Configuration::convert ( T & value,
const ConfigObject & obj,
const std::string & attr_name )
noexcept

Converts single value.

The method is used by the code generated by the genconffwk utility.

Definition at line 387 of file Configuration.hxx.

388 {
389 conffwk::map<std::list<AttributeConverterBase*> *>::const_iterator l = m_convert_map.find(typeid(T).name());
390 if (l != m_convert_map.end())
391 {
392 for (const auto& i : *l->second)
393 {
394 static_cast<AttributeConverter<T>*>(i)->convert(value, *this, obj, attr_name);
395 }
396 }
397 }
conffwk::map< std::list< AttributeConverterBase * > * > m_convert_map
void convert(T &value, const ConfigObject &obj, const std::string &attr_name) noexcept
Converts single value.

◆ convert2()

template<class T>
void dunedaq::conffwk::Configuration::convert2 ( std::vector< T > & value,
const ConfigObject & obj,
const std::string & attr_name )
noexcept

Converts vector of single values.

The method is used by the code generated by the genconffwk utility.

Definition at line 401 of file Configuration.hxx.

402 {
403 conffwk::map<std::list<AttributeConverterBase*> *>::const_iterator l = m_convert_map.find(typeid(T).name());
404 if (l != m_convert_map.end())
405 {
406 for (auto& j : value)
407 {
408 for (const auto& i : *l->second)
409 {
410 static_cast<AttributeConverter<T>*>(i)->convert(j, *this, obj, attr_name);
411 }
412 }
413 }
414 }

◆ create() [1/5]

void dunedaq::Configuration::create ( const ConfigObject & at,
const std::string & class_name,
const std::string & id,
ConfigObject & object )

Create new object by class name and object id.

The method tries to create an object with given id in given class. If found, the method fills 'object' reference.

Parameters
atcreate new object at the same database file where 'at' object is located
class_namename of the class
idobject identity
objectreturned value in case of success
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 814 of file Configuration.cpp.

815{
816 try
817 {
818 std::lock_guard<std::mutex> scoped_lock(m_impl_mutex);
819 m_impl->create(at, class_name, id, object);
820 }
821 catch (dunedaq::conffwk::Generic& ex)
822 {
823 std::ostringstream text;
824 text << "failed to create object \'" << id << '@' << class_name << '\'';
825 throw dunedaq::conffwk::Generic( ERS_HERE, text.str().c_str(), ex );
826 }
827}

◆ create() [2/5]

template<class T>
const T * dunedaq::conffwk::Configuration::create ( const DalObject & at,
const std::string & id,
bool init_object = false )

Create object of given class by identity and instantiate the template parameter with it.

Such method to be used for user classes generated by the genconffwk utility.

Parameters
atan existing object of class generated by genconffwk to define location of the file where to store new object
idobject identity
init_objectif true, initialize object's attributes and relationships
Returns
non-null pointer to created object.
Exceptions
dunedaq::conffwk::Genericin case of an error

◆ create() [3/5]

void dunedaq::Configuration::create ( const std::string & at,
const std::string & class_name,
const std::string & id,
ConfigObject & object )

Create new object by class name and object id.

The method tries to create an object with given id in given class. If found, the method fills 'object' reference.

Parameters
atdatabase file where to create new object
class_namename of the class
idobject identity
objectreturned value in case of success
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 798 of file Configuration.cpp.

799{
800 try
801 {
802 std::lock_guard<std::mutex> scoped_lock(m_impl_mutex);
803 m_impl->create(at, class_name, id, object);
804 }
805 catch (dunedaq::conffwk::Generic& ex)
806 {
807 std::ostringstream text;
808 text << "failed to create object \'" << id << '@' << class_name << '\'';
809 throw dunedaq::conffwk::Generic( ERS_HERE, text.str().c_str(), ex );
810 }
811}

◆ create() [4/5]

template<class T>
const T * dunedaq::conffwk::Configuration::create ( const std::string & at,
const std::string & id,
bool init_object = false )

Create object of given class by identity and instantiate the template parameter with it.

Such method to be used for user classes generated by the genconffwk utility.

Parameters
atdatabase file where to create new object
idobject identity
init_objectif true, initialise object's attributes and relationships
Returns
non-null pointer to created object.
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 12 of file Configuration.hxx.

13 {
15
16 std::lock_guard<std::mutex> scoped_lock(m_tmpl_mutex);
17 create(at, T::s_class_name, id, obj);
18 return m_registry.get<T>(obj, false, init_object);
19 }
void create(const std::string &at, const std::string &class_name, const std::string &id, ConfigObject &object)
Create new object by class name and object id.

◆ create() [5/5]

void dunedaq::Configuration::create ( const std::string & db_name,
const std::list< std::string > & includes )

Create database.

The method creates database according to the name and list of others database files to be included.

Parameters
db_namename of new database file (must be an absolute path to non-existing file)
includesoptional list of others database files to be included
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 438 of file Configuration.cpp.

439{
440 if (m_impl == nullptr)
441 throw dunedaq::conffwk::Generic( ERS_HERE, "no implementation loaded" );
442
443 std::lock_guard<std::mutex> scoped_lock(m_impl_mutex);
444
445 try
446 {
447 m_impl->create(db_name, includes);
449 }
450 catch(dunedaq::conffwk::Generic & ex)
451 {
452 std::ostringstream text;
453 text << "failed to create database \'" << db_name << '\'';
454 throw ( dunedaq::conffwk::Generic( ERS_HERE, text.str().c_str(), ex ) );
455 }
456}

◆ create_and_return_obj_pybind() [1/2]

ConfigObject * dunedaq::Configuration::create_and_return_obj_pybind ( const ConfigObject & at,
const std::string & class_name,
const std::string & id )

Definition at line 2050 of file Configuration.cpp.

2051{
2052 auto co = new ConfigObject;
2053 this->create(at, class_name, id, *co);
2054 return co;
2055}

◆ create_and_return_obj_pybind() [2/2]

ConfigObject * dunedaq::Configuration::create_and_return_obj_pybind ( const std::string & at,
const std::string & class_name,
const std::string & id )

Definition at line 2043 of file Configuration.cpp.

2043 {
2044 auto co = new ConfigObject;
2045 this->create(at, class_name, id, *co);
2046 return co;
2047}

◆ destroy()

template<class T>
void dunedaq::conffwk::Configuration::destroy ( T & obj)

Destroy object of given class.

The method tries to destoy given object.

Parameters
objthe object's reference
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 24 of file Configuration.hxx.

25 {
26 destroy_obj(const_cast<ConfigObject&>(obj.config_object()));
27 }
void destroy_obj(ConfigObject &object)
Destroy object.

◆ destroy_obj()

void dunedaq::Configuration::destroy_obj ( ConfigObject & object)

Destroy object.

The method tries to destroy given object.

Parameters
objectthe object's reference
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 831 of file Configuration.cpp.

832{
833 try
834 {
835 std::lock_guard<std::mutex> scoped_lock(m_impl_mutex);
836 std::lock_guard<std::mutex> scoped_lock2(m_tmpl_mutex);
837 m_impl->destroy(object);
838 }
839 catch (dunedaq::conffwk::Generic& ex)
840 {
841 std::ostringstream text;
842 text << "failed to destroy object \'" << object << '\'';
843 throw dunedaq::conffwk::Generic( ERS_HERE, text.str().c_str(), ex );
844 }
845}

◆ downcast_dal_object()

template<class T>
void dunedaq::conffwk::Configuration::downcast_dal_object ( const T * obj,
bool ,
std::vector< const DalObject * > & result )
inline

Definition at line 1006 of file Configuration.hpp.

1007 {
1008 if(obj)
1009 result.push_back(obj);
1010 }

◆ downcast_dal_objects()

template<class T>
void dunedaq::conffwk::Configuration::downcast_dal_objects ( const std::vector< const T * > & objs,
bool ,
std::vector< const DalObject * > & result )
inline

Definition at line 997 of file Configuration.hpp.

999 {
1000 for (auto& i : objs)
1001 result.push_back(i);
1002 }

◆ export_data()

void dunedaq::Configuration::export_data ( boost::property_tree::ptree & tree,
const std::string & classes = "",
const std::string & objects = "",
const std::string & files = "",
const std::string & empty_array_item = "" )

Export configuration data into ptree.

Parameters
treeoutput ptree object
classesregex defining class names; ignore if empty
objectsregex defining object IDs; ignore if empty
filesregex defining data file names; ignore if empty
empty_array_itemif provided, add this item to mark empty arrays
Exceptions
dunedaq::conffwk::Genericin case of a problem

Definition at line 1099 of file Configuration.cpp.

1100{
1101 std::unique_ptr<std::regex> classes_regex, objects_regex, files_regex;
1102
1103 init_regex(classes_regex, classes_str, "classes");
1104 init_regex(objects_regex, objects_str, "objects");
1105 init_regex(files_regex, files_str, "files");
1106
1107 auto cmp_str_ptr = [](const std::string * s1, const std::string * s2) { return *s1 < *s2; };
1108 std::set<const std::string *, decltype(cmp_str_ptr)> sorted_classes(cmp_str_ptr);
1109
1110 for (const auto &c : superclasses())
1111 if (classes_str.empty() || std::regex_match(*c.first, *classes_regex.get()))
1112 sorted_classes.insert(c.first);
1113
1114 for (const auto &c : sorted_classes)
1115 if (classes_str.empty() || std::regex_match(*c, *classes_regex.get()))
1116 {
1117 const dunedaq::conffwk::class_t& info(get_class_info(*c));
1118
1119 boost::property_tree::ptree pt_objects;
1120
1121 std::vector<ConfigObject> objects;
1122 get(*c, objects);
1123
1124 auto comp_obj_ptr = [](const ConfigObject * o1, const ConfigObject * o2) { return o1->UID() < o2->UID(); };
1125 std::set<const ConfigObject *, decltype(comp_obj_ptr)> sorted_objects(comp_obj_ptr);
1126
1127 for (const auto& x : objects)
1128 if (objects_str.empty() || std::regex_match(x.UID(), *objects_regex.get()))
1129 if (x.class_name() == *c)
1130 if(files_str.empty() || std::regex_match(x.contained_in(), *files_regex.get()))
1131 sorted_objects.insert(&x);
1132
1133 if (!sorted_objects.empty())
1134 {
1135 boost::property_tree::ptree pt_objects;
1136
1137 for (const auto& x : sorted_objects)
1138 {
1139 boost::property_tree::ptree data;
1140
1141 for (const auto &a : info.p_attributes)
1142 switch (a.p_type)
1143 {
1145 add_data<bool>(data, *x, a, empty_array_item);
1146 break;
1148 add_data<int8_t>(data, *x, a, empty_array_item);
1149 break;
1151 add_data<uint8_t>(data, *x, a, empty_array_item);
1152 break;
1154 add_data<int16_t>(data, *x, a, empty_array_item);
1155 break;
1157 add_data<uint16_t>(data, *x, a, empty_array_item);
1158 break;
1160 add_data<int32_t>(data, *x, a, empty_array_item);
1161 break;
1163 add_data<uint32_t>(data, *x, a, empty_array_item);
1164 break;
1166 add_data<int64_t>(data, *x, a, empty_array_item);
1167 break;
1169 add_data<uint64_t>(data, *x, a, empty_array_item);
1170 break;
1172 add_data<float>(data, *x, a, empty_array_item);
1173 break;
1175 add_data<double>(data, *x, a, empty_array_item);
1176 break;
1182 add_data<std::string>(data, *x, a, empty_array_item);
1183 break;
1184 default:
1185 throw std::runtime_error("Invalid type of attribute " + a.p_name);
1186
1187 }
1188
1189 for (const auto &r : info.p_relationships)
1190 add_data(data, *x, r, empty_array_item);
1191
1192 pt_objects.push_back(boost::property_tree::ptree::value_type(x->UID(), data));
1193 }
1194
1195 pt.put_child(boost::property_tree::ptree::path_type(*c), pt_objects);
1196 }
1197 }
1198}
const conffwk::fmap< conffwk::fset > & superclasses() const noexcept
static void init_regex(std::unique_ptr< std::regex > &ptr, const std::string &str, const char *what)
static void add_data(boost::property_tree::ptree &pt, const ConfigObject &obj, const dunedaq::conffwk::attribute_t &attribute, const std::string &empty_array_item)

◆ export_schema()

void dunedaq::Configuration::export_schema ( boost::property_tree::ptree & tree,
const std::string & classes = "",
bool direct_only = false )

Export configuration schema into ptree.

Parameters
treeoutput ptree object
classesregex defining class names; all classes if empty
direct_onlyif true is set explicitly, return descriptions of direct attributes, relationships, super- and subclasses; by default return all descriptions taking into account inheritance
Exceptions
dunedaq::conffwk::Genericin case of a problem

Definition at line 955 of file Configuration.cpp.

956{
957 std::unique_ptr<std::regex> classes_regex;
958
959 init_regex(classes_regex, classes_str, "classes");
960
961 auto cmp_str_ptr = [](const std::string * s1, const std::string * s2) { return *s1 < *s2; };
962 std::set<const std::string *, decltype(cmp_str_ptr)> sorted_classes(cmp_str_ptr);
963
964 for (const auto &c : superclasses())
965 if (classes_str.empty() || std::regex_match(*c.first, *classes_regex.get()))
966 sorted_classes.insert(c.first);
967
968 for (const auto &c : sorted_classes)
969 if (classes_str.empty() || std::regex_match(*c, *classes_regex.get()))
970 {
971 const dunedaq::conffwk::class_t& info(get_class_info(*c, direct_only));
972
973 boost::property_tree::ptree class_pt;
974
975 class_pt.put("abstract", info.p_abstract);
976 if (!info.p_description.empty())
977 class_pt.put("description", info.p_description);
978
979 if (!info.p_superclasses.empty())
980 {
981 boost::property_tree::ptree superclasses;
982
983 for (const auto &x : info.p_superclasses)
985
986 class_pt.add_child("superclasses", superclasses);
987 }
988
989 if (!info.p_attributes.empty())
990 {
991 boost::property_tree::ptree attributes;
992
993 for (const auto &x : info.p_attributes)
994 {
995 boost::property_tree::ptree attribute;
996
997 attribute.put("type", dunedaq::conffwk::attribute_t::type(x.p_type));
998 if (!x.p_range.empty())
999 attribute.put("range", x.p_range);
1000 if (x.p_int_format != dunedaq::conffwk::na_int_format)
1001 attribute.put("format", dunedaq::conffwk::attribute_t::format2str(x.p_int_format));
1002 if (x.p_is_not_null)
1003 attribute.put("is-not-null", x.p_is_not_null);
1004 if (x.p_is_multi_value)
1005 attribute.put("is-multi-value", x.p_is_multi_value);
1006 if (!x.p_default_value.empty())
1007 attribute.put("default-value", x.p_default_value);
1008 if (!x.p_description.empty())
1009 attribute.put("description", x.p_description);
1010
1011 attributes.push_back(boost::property_tree::ptree::value_type(x.p_name, attribute));
1012 }
1013
1014 class_pt.add_child("attributes", attributes);
1015 }
1016
1017 if (!info.p_relationships.empty())
1018 {
1019 boost::property_tree::ptree relationships;
1020
1021 for (const auto &x : info.p_relationships)
1022 {
1023 boost::property_tree::ptree relationship;
1024
1025 relationship.put("type", x.p_type);
1026 relationship.put("cardinality", dunedaq::conffwk::relationship_t::card2str(x.p_cardinality));
1027 if (!x.p_is_aggregation)
1028 relationship.put("is-aggregation", x.p_is_aggregation);
1029 if (!x.p_description.empty())
1030 relationship.put("description", x.p_description);
1031
1032 relationships.push_back(boost::property_tree::ptree::value_type(x.p_name, relationship));
1033 }
1034
1035 class_pt.add_child("relationships", relationships);
1036 }
1037
1038 pt.put_child(boost::property_tree::ptree::path_type(*c), class_pt);
1039 }
1040}
std::vector< T > attributes(tref const &item)
T attribute(tref item, dunedaq::conffwk::attribute_t const &attr)
static void add_array_item(boost::property_tree::ptree &pt, const T &val)
static const char * format2str(int_format_t format)
static const char * card2str(cardinality_t cardinality)

◆ find()

template<class T>
const T * dunedaq::conffwk::Configuration::find ( const std::string & id)
inline

Find object of given class (multi-thread safe).

Could be used for generated template objects.

Parameters
idID of object
Returns
Return pointer to object or nullptr if there is no such object
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 845 of file Configuration.hpp.

846 {
847 std::lock_guard<std::mutex> scoped_lock(m_tmpl_mutex);
848 return _find<T>(id);
849 }
const T * _find(const std::string &id)
Multi-thread unsafe version of find(const std::string&) method.

◆ find_callback()

Configuration::CallbackSubscription * dunedaq::Configuration::find_callback ( CallbackId cb_handler) const
private

Definition at line 1250 of file Configuration.cpp.

1251{
1252 return ((!cb_handler || (m_callbacks.find(cb_handler) == m_callbacks.end())) ? 0 : cb_handler);
1253}

◆ find_class_domains()

std::deque< std::set< std::string > > dunedaq::Configuration::find_class_domains ( )
private

Definition at line 709 of file Configuration.cpp.

710{
711 std::deque<std::set<std::string>> domains;
712
713 std::deque<dunedaq::conffwk::class_t> seeds;
714 for (const auto& c : get_class_list()) {
715 auto ci = this->_get_class_info(c);
716 if (ci.p_superclasses.empty())
717 seeds.push_back(ci);
718 }
719
720 for (const auto& ci : seeds) {
721 // Make a candidate domain based using the seed subclasses
722 std::set<std::string> class_domain;
723 class_domain.insert(ci.p_name);
724 class_domain.insert(ci.p_subclasses.begin(), ci.p_subclasses.end());
725
726 // Look for overlaps with other domains
727 std::deque<std::set<std::string>> overlapping;
728 for (auto& d : domains) {
729 std::set<std::string> intersection;
730 std::set_intersection(d.begin(), d.end(), class_domain.begin(), class_domain.end(), std::inserter(intersection, intersection.begin()));
731 // non-zero intersection, overlap found
732 if (intersection.size() > 0) {
733 overlapping.push_back(d);
734 }
735 }
736
737 // If overlapping are found, add all overlapping to
738 // the new domain and remove them from the domain list
739 if ( !overlapping.empty() ) {
740 for( auto& d : overlapping ) {
741 // merge the existing cluster in class_domain
742 class_domain.insert(d.begin(), d.end());
743 // Remove the old cluster from the list
744 auto it = std::find(domains.begin(), domains.end(), d);
745 if (it!= domains.end()) {
746 domains.erase(it);
747 }
748 }
749 }
750
751 domains.push_back(class_domain);
752 }
753
754 return domains;
755}
const dunedaq::conffwk::class_t & _get_class_info(const std::string &class_name, bool direct_only=false)
std::vector< std::string > get_class_list() const

◆ get() [1/7]

template<class T>
const T * dunedaq::conffwk::Configuration::get ( ConfigObject & obj,
bool init_children = false,
bool init = true )
inline

Get object of given class by object reference and instantiate the template parameter with it (multi-thread safe).

Such method to be used for user classes generated by the genconffwk utility.

Parameters
objreference to conffwk object, that is used to instantiate template object
init_childrenif true, the referenced objects are initialized
initif true, the object's attributes and relationships are read
Returns
Return pointer to object.
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 778 of file Configuration.hpp.

779 {
780 std::lock_guard<std::mutex> scoped_lock(m_tmpl_mutex);
781 return _get<T>(obj, init_children, init);
782 }
void init(unordered_map< std::string, std::string > params)

◆ get() [2/7]

template<class T>
const T * dunedaq::conffwk::Configuration::get ( ConfigObject & obj,
const std::string & id )
inline

Generate object of given class by object reference and instantiate the template parameter with it (multi-thread safe).

Such method to be used to generate template objects.

Parameters
objreference to conffwk object, that is used to instantiate template object
idID of generated object could be different from obj.UID()
Returns
Return pointer to object.
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 824 of file Configuration.hpp.

825 {
826 std::lock_guard<std::mutex> scoped_lock(m_tmpl_mutex);
827 return _get<T>(obj, id);
828 }

◆ get() [3/7]

void dunedaq::Configuration::get ( const ConfigObject & obj_from,
const std::string & query,
std::vector< ConfigObject > & objects,
unsigned long rlevel = 0,
const std::vector< std::string > * rclasses = 0 )

Get path between objects.

The method returns all objects which are in the path starting from source object matching to the path query pattern.

Parameters
obj_fromobject to start from
querypath query
objectsreturned value in case of success
rleveloptional references level to optimize performance (defines how many objects referenced by found objects have also to be read to the implementation cache)
rclassesoptional array of class names to optimize performance (defines which referenced objects have to be read to the implementation cache)
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 289 of file Configuration.cpp.

290{
291 try
292 {
293 std::lock_guard<std::mutex> scoped_lock(m_impl_mutex);
294 m_impl->get(obj_from, query, objects, rlevel, rclasses);
295 }
296 catch (dunedaq::conffwk::Generic& ex)
297 {
298 std::ostringstream text;
299 text << "failed to get path \'" << query << "\' from object \'" << obj_from << '\'';
300 throw dunedaq::conffwk::Generic( ERS_HERE, text.str().c_str(), ex );
301 }
302}

◆ get() [4/7]

void dunedaq::Configuration::get ( const std::string & class_name,
const std::string & id,
ConfigObject & object,
unsigned long rlevel = 0,
const std::vector< std::string > * rclasses = 0 )

Get object by class name and object id (multi-thread safe).

The method searches an object with given id within the class and all derived subclasses.

Parameters
class_namename of the class
idobject identity
objectreturned value in case of success
rleveloptional references level to optimize performance (defines how many objects referenced by given object have also to be read to the implementation cache)
rclassesoptional array of class names to optimize performance (defines which referenced objects have to be read to the implementation cache)
Exceptions
dunedaq::conffwk::NotFoundexception if there is no such object or dunedaq::conffwk::Generic in case of an error

Definition at line 247 of file Configuration.cpp.

248{
249 std::lock_guard<std::mutex> scoped_lock(m_impl_mutex);
250 _get(class_name, id, object, rlevel, rclasses);
251}

◆ get() [5/7]

void dunedaq::Configuration::get ( const std::string & class_name,
std::vector< ConfigObject > & objects,
const std::string & query = "",
unsigned long rlevel = 0,
const std::vector< std::string > * rclasses = 0 )

Get all objects of class.

The method returns all objects of given class and objects of subclasses derived from it.

Parameters
class_namename of the class
objectsreturned value in case of success
queryoptional parameter defining selection criteria for objects of given class
rleveloptional references level to optimize performance (defines how many objects referenced by found objects have also to be read to the implementation cache)
rclassesoptional array of class names to optimize performance (defines which referenced objects have to be read to the implementation cache)
Exceptions
dunedaq::conffwk::NotFoundexception if there is no such class or dunedaq::conffwk::Generic in case of an error

Definition at line 269 of file Configuration.cpp.

270{
271 try
272 {
273 std::lock_guard<std::mutex> scoped_lock(m_impl_mutex);
274 m_impl->get(class_name, objects, query, rlevel, rclasses);
275 }
276 catch (dunedaq::conffwk::Generic& ex)
277 {
278 std::ostringstream text;
279 text << "failed to get objects of class \'" << class_name << '\'';
280 if (!query.empty())
281 {
282 text << " with query \'" << query << '\'';
283 }
284 throw dunedaq::conffwk::Generic( ERS_HERE, text.str().c_str(), ex );
285 }
286}

◆ get() [6/7]

template<class T>
const T * dunedaq::conffwk::Configuration::get ( const std::string & id,
bool init_children = false,
bool init = true,
unsigned long rlevel = 0,
const std::vector< std::string > * rclasses = 0 )
inline

Get object of given class by identity and instantiate the template parameter with it (multi-thread safe).

Such method to be used for user classes generated by the genconffwk utility.

Parameters
idobject identity
init_childrenif true, the referenced objects are initialized
initif true, the object's attributes and relationships are read
rleveloptional references level to optimize performance (defines how many objects referenced by given object have also to be read to the implementation cache)
rclassesoptional array of class names to optimize performance (defines which referenced objects have to be read to the implementation cache)
Returns
Return 0 if there is no object with such id or pointer to object otherwise.
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 754 of file Configuration.hpp.

755 {
756 std::lock_guard<std::mutex> scoped_lock(m_tmpl_mutex);
757 return _get<T>(id, init_children, init, rlevel, rclasses);
758 }

◆ get() [7/7]

template<class T>
void dunedaq::conffwk::Configuration::get ( std::vector< const T * > & objects,
bool init_children = false,
bool init = true,
const std::string & query = "",
unsigned long rlevel = 0,
const std::vector< std::string > * rclasses = 0 )
inline

Get all objects of given class and instantiate a vector of the template parameters object with it (multi-thread safe).

Such method to be used for user classes generated by the genconffwk utility.

Parameters
objectsthe vector is filled by the method
init_childrenif true, the referenced objects are initialized
initif true, the object's attributes and relationships are read
queryoptional parameter defining selection criteria for objects of given class
rleveloptional references level to optimize performance (defines how many objects referenced by found objects have also to be read to the implementation cache)
rclassesoptional array of class names to optimize performance (defines which referenced objects have to be read to the implementation cache)
Exceptions
dunedaq::conffwk::Genericin case of a problem (e.g. no such class, plug-in specific problem)

Definition at line 803 of file Configuration.hpp.

804 {
805 std::lock_guard<std::mutex> scoped_lock(m_tmpl_mutex);
806 _get<T>(objects, init_children, init, query, rlevel, rclasses);
807 }

◆ get_changes()

std::vector< dunedaq::conffwk::Version > dunedaq::Configuration::get_changes ( )

Get new conffwk versions.

Returns
repository changes: new versions created on remote origin after current HEAD version, or externally modified files
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 1210 of file Configuration.cpp.

1211{
1212 try
1213 {
1214 std::lock_guard<std::mutex> scoped_lock(m_impl_mutex);
1215 return m_impl->get_changes();
1216 }
1217 catch (dunedaq::conffwk::Generic& ex)
1218 {
1219 throw dunedaq::conffwk::Generic( ERS_HERE, "failed to get new versions", ex );
1220 }
1221}

◆ get_class_info()

const dunedaq::conffwk::class_t & dunedaq::Configuration::get_class_info ( const std::string & class_name,
bool direct_only = false )

The method provides access to description of class.

Parameters
class_namename of the class
direct_onlyif true is set explicitly, return descriptions of direct attributes, relationships, super- and subclasses; by default return all descriptions taking into account inheritance
Returns
Return pointer to class description object.
Exceptions
dunedaq::conffwk::NotFoundexception if there is no class with such name or dunedaq::conffwk::Generic in case of a problem

Definition at line 893 of file Configuration.cpp.

894{
895 std::lock_guard<std::mutex> scoped_lock(m_impl_mutex);
896
897 return this->_get_class_info(class_name, direct_only);
898}

◆ get_class_list()

std::vector< std::string > dunedaq::Configuration::get_class_list ( ) const

Definition at line 2033 of file Configuration.cpp.

2033 {
2034 std::vector<std::string> classes;
2035 for (const auto& it : this->superclasses()) {
2036 classes.push_back(*it.first);
2037 }
2038
2039 return classes;
2040}

◆ get_impl_name()

const std::string & dunedaq::conffwk::Configuration::get_impl_name ( ) const
inlinenoexcept

Get implementation plug-in name used to build conffwk object

Definition at line 266 of file Configuration.hpp.

266{return m_impl_name;}

◆ get_impl_param()

const std::string & dunedaq::conffwk::Configuration::get_impl_param ( ) const
inlinenoexcept

Get implementation plug-in parameter used to build conffwk object

Definition at line 271 of file Configuration.hpp.

271{return m_impl_param;}

◆ get_impl_spec()

const std::string & dunedaq::conffwk::Configuration::get_impl_spec ( ) const
inlinenoexcept

Get implementation plug-in and it's parameter used to build conffwk object

Definition at line 261 of file Configuration.hpp.

261{return m_impl_spec;}

◆ get_includes()

void dunedaq::Configuration::get_includes ( const std::string & db_name,
std::list< std::string > & includes ) const

Get include files.

The method returns list of files included by given database.

Parameters
db_namename of database file
includesreturned list of include files
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 528 of file Configuration.cpp.

529{
530 if (m_impl == nullptr)
531 throw dunedaq::conffwk::Generic( ERS_HERE, "no implementation loaded" );
532
533 std::lock_guard<std::mutex> scoped_lock(m_impl_mutex);
534
535 try
536 {
537 m_impl->get_includes(db_name, includes);
538 }
539 catch(dunedaq::conffwk::Generic & ex)
540 {
541 std::ostringstream text;
542 text << "failed to get includes of database \'" << db_name<< '\'';
543 throw ( dunedaq::conffwk::Generic( ERS_HERE, text.str().c_str(), ex ) );
544 }
545}

◆ get_obj_pybind()

ConfigObject * dunedaq::Configuration::get_obj_pybind ( const std::string & class_name,
const std::string & id )

Definition at line 2058 of file Configuration.cpp.

2059{
2060 auto co = new ConfigObject;
2061 this->get(class_name, id, *co);
2062 if (co->is_null()) {
2063 delete co;
2064 co = nullptr;
2065 }
2066 return co;
2067}

◆ get_objs_pybind()

std::vector< ConfigObject > * dunedaq::Configuration::get_objs_pybind ( const std::string & class_name,
const std::string & query = "" )

Definition at line 2070 of file Configuration.cpp.

2070 {
2071 auto objs = new std::vector<ConfigObject>;
2072 this->get(class_name, *objs, query);
2073 return objs;
2074}

◆ get_schema_path_pybind()

const std::string & dunedaq::Configuration::get_schema_path_pybind ( const std::string & class_name)
nodiscard

Definition at line 2121 of file Configuration.cpp.

2121 {
2122 const dunedaq::conffwk::class_t& c = this->get_class_info(class_name, false);
2123 return c.p_schema_path;
2124}

◆ get_updated_dbs()

void dunedaq::Configuration::get_updated_dbs ( std::list< std::string > & dbs) const

Get list of updated files to be committed.

The method returns list of uncommitted database files.

Parameters
dbsreturned list of uncommitted database files
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 549 of file Configuration.cpp.

550{
551 if (m_impl == nullptr)
552 throw dunedaq::conffwk::Generic( ERS_HERE, "no implementation loaded" );
553
554 std::lock_guard<std::mutex> scoped_lock(m_impl_mutex);
555
556 try
557 {
558 m_impl->get_updated_dbs(dbs);
559 }
560 catch(dunedaq::conffwk::Generic & ex)
561 {
562 throw ( dunedaq::conffwk::Generic( ERS_HERE, "get_updated_dbs failed", ex ) );
563 }
564}

◆ get_versions()

std::vector< dunedaq::conffwk::Version > dunedaq::Configuration::get_versions ( const std::string & since,
const std::string & until,
dunedaq::conffwk::Version::QueryType type = dunedaq::conffwk::Version::query_by_date,
bool skip_irrelevant = true )

Get repository versions in interval.

Access historical versions.

The date/time format has to be either a date in format "yyyy-mm-dd" or date-and-time in format "yyyy-mm-dd hh:mm:ss" (UTC).

Parameters
sincelimit the versions committed on-or-after the specified hash key, tag or date/time; if empty, start from earliest available
untillimit the versions committed on-or-before the specified hash key, tag or date/time; if empty, retrieve all versions until latest available
typedefine query type
skip_irrelevantif true, ignore changes not affecting loaded configuration
Returns
repository versions satisfying query
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 1225 of file Configuration.cpp.

1226{
1227 try
1228 {
1229 std::lock_guard<std::mutex> scoped_lock(m_impl_mutex);
1230 return m_impl->get_versions(since, until, type, skip_irrelevant);
1231 }
1232 catch (dunedaq::conffwk::Generic& ex)
1233 {
1234 throw dunedaq::conffwk::Generic( ERS_HERE, "failed to get versions", ex );
1235 }
1236}

◆ is_superclass_of() [1/2]

bool dunedaq::conffwk::Configuration::is_superclass_of ( const std::string & target,
const std::string & source )
noexcept

◆ is_superclass_of() [2/2]

bool dunedaq::conffwk::Configuration::is_superclass_of ( const std::string * target,
const std::string * source )
noexcept

◆ is_valid()

template<class T>
bool dunedaq::conffwk::Configuration::is_valid ( const T * object)
noexcept

Checks validity of pointer to an objects of given user class.

Check if the pointer to the object is a valid pointer in the cache. Dangling pointers to removed objects may appear after notification.

Returns
Return true if the pointer is valid and false otherwise.

Definition at line 275 of file Configuration.hxx.

276 {
277 // std::lock_guard<std::mutex> scoped_lock(m_tmpl_mutex);
278
279 // auto j = m_cache_map.find(&T::s_class_name);
280
281 // if (j != m_cache_map.end())
282 // {
283 // Cache<T> *c = static_cast<Cache<T>*>(j->second);
284
285 // for (const auto& i : c->m_cache)
286 // {
287 // if (i->second == object)
288 // return true;
289 // }
290 // }
291
292 // return false;
293
294 return m_registry.is_valid(object);
295 }

◆ is_writable()

bool dunedaq::Configuration::is_writable ( const std::string & db_name) const

Get write access status.

Check if given database file is writable by current user.

Parameters
db_namename of database
Returns
true, if database file is writable and false otherwise.
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 460 of file Configuration.cpp.

461{
462 if (m_impl == nullptr)
463 throw(dunedaq::conffwk::Generic(ERS_HERE, "no implementation loaded" ) );
464
465 std::lock_guard<std::mutex> scoped_lock(m_impl_mutex);
466
467 try
468 {
469 return m_impl->is_writable(db_name);
470 }
471 catch(dunedaq::conffwk::Generic & ex)
472 {
473 std::ostringstream text;
474 text << "failed to get write access status for database \'" << db_name<< '\'';
475 throw ( dunedaq::conffwk::Generic( ERS_HERE, text.str().c_str(), ex ) );
476 }
477}

◆ load()

void dunedaq::Configuration::load ( const std::string & db_name)

Load database according to the name. If name is empty, take it from TDAQ_DB_NAME and TDAQ_DB_DATA environment variables.

Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 311 of file Configuration.cpp.

312{
313 std::string name;
314
315 if (db_name.empty())
316 {
317 if (!m_impl_spec.empty() && !m_impl_param.empty())
318 {
319 name = m_impl_param;
320 }
321 else
322 {
323 const char * s = ::getenv("TDAQ_DB_NAME");
324 if (s == 0 || *s == 0)
325 s = ::getenv("TDAQ_DB_DATA");
326
327 if (s && *s)
328 {
329 name = s;
330 }
331 else
332 {
333 throw(dunedaq::conffwk::Generic( ERS_HERE, "no database name was provided" ) );
334 }
335 }
336 }
337 else
338 {
339 name = db_name;
340 }
341
342 std::lock_guard<std::mutex> scoped_lock(m_impl_mutex);
343
344 // call conffwk actions if any
345 {
346 std::lock_guard<std::mutex> scoped_lock(m_actn_mutex);
347 for (auto & i : m_actions)
348 {
349 i->load();
350 }
351 }
352
353 if (m_impl)
354 {
355 m_impl->open_db(name);
356 // m_impl->get_superclasses(p_superclasses);
357 // set_subclasses();
359 m_impl->set(this);
360
362 {
363 m_impl->prefetch_all_data();
364 }
365
366 TLOG_DEBUG(2) << "\n*** DUMP CONFIGURATION ***\n" << *this;
367 }
368 else
369 {
370 throw dunedaq::conffwk::Generic( ERS_HERE, "no implementation loaded" );
371 }
372}

◆ loaded()

bool dunedaq::Configuration::loaded ( ) const
noexcept

Check if database is correctly loaded.

Check state of the database after configuration object creation.

Returns
true if the database was successfully loaded and false otherwise.

Definition at line 305 of file Configuration.cpp.

306{
307 return (m_impl != nullptr) ? m_impl->loaded() : false;
308}

◆ mk_ref_by_ex_text()

std::string dunedaq::Configuration::mk_ref_by_ex_text ( const std::string & cname,
const std::string & rname,
const ConfigObject & obj )
staticprivatenoexcept

Helper method to prepare exception text when template referenced_by() method fails

Definition at line 1956 of file Configuration.cpp.

1957{
1958 std::ostringstream text;
1959 text << "failed to get objects of class \'" << cname << "\' referencing object \'" << obj << "\' via relationship \'" << rname << '\'';
1960 return text.str();
1961}

◆ mk_ref_ex_text()

std::string dunedaq::Configuration::mk_ref_ex_text ( const char * what,
const std::string & cname,
const std::string & rname,
const ConfigObject & obj )
staticprivatenoexcept

Helper method to prepare exception text when template ref() method fails

Definition at line 1947 of file Configuration.cpp.

1948{
1949 std::ostringstream text;
1950 text << "failed to get " << what << " of class \'" << cname << "\' via relationship \'" << rname << "\' of object \'" << obj << '\'';
1951 return text.str();
1952}

◆ operator=()

Configuration & dunedaq::conffwk::Configuration::operator= ( const Configuration & )
private

◆ prefetch_all_data()

void dunedaq::Configuration::prefetch_all_data ( )

Prefetch all data into client cache.

The method reads all objects defined in database into client cache.

Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 635 of file Configuration.cpp.

636{
637 std::lock_guard<std::mutex> scoped_lock1(m_tmpl_mutex); // always lock template objects mutex first
638 std::lock_guard<std::mutex> scoped_lock2(m_impl_mutex);
639
640 try
641 {
642 m_impl->prefetch_all_data();
643 }
644 catch (dunedaq::conffwk::Generic & ex)
645 {
646 throw(dunedaq::conffwk::Generic( ERS_HERE, "prefetch all data failed", ex));
647 }
648}

◆ print()

void dunedaq::Configuration::print ( std::ostream & s) const
noexcept

Prints out details of configuration object.

For the moment only inheritance hierarchy of configuration database is printed. In future it is planned to add more details, such as:

  • conffwk objects
  • status of template cache
  • profiling info

Definition at line 1845 of file Configuration.cpp.

1846{
1847 s << "Configuration object:\n Inheritance Hierarchy (class - all it's superclasses):\n";
1848
1849 for (const auto &i : p_superclasses)
1850 {
1851 s << " * \'" << *i.first << "\' - ";
1852 if (i.second.empty())
1853 s << "(null)";
1854 else
1855 for (auto j = i.second.begin(); j != i.second.end(); ++j)
1856 {
1857 if (j != i.second.begin())
1858 s << ", ";
1859 s << '\'' << **j << '\'';
1860 }
1861 s << std::endl;
1862 }
1863}
conffwk::fmap< conffwk::fset > p_superclasses

◆ print_profiling_info()

void dunedaq::Configuration::print_profiling_info ( )
noexcept

Print out profiling information.

The method prints out to the standard output stream profiling information of configuration object and it's implementation.

Definition at line 190 of file Configuration.cpp.

191{
192 std::lock_guard < std::mutex > scoped_lock(m_impl_mutex);
193
194 std::cout << "Configuration profiler report:\n"
195 " number of created template objects: " << p_number_of_template_object_created << "\n"
196 " number of read template objects: " << p_number_of_template_object_read << "\n"
197 " number of cache hits: " << p_number_of_cache_hits << std::endl;
198
199 // FIXME: re-implement for the dal registry
200 // const char * s = ::getenv("TDAQ_DUMP_CONFFWK_PROFILER_INFO");
201 // if (s && !strcmp(s, "DEBUG"))
202 // {
203 // std::cout << " Details of accessed objects:\n";
204
205 // for (auto & i : m_cache_map)
206 // {
207 // Cache<DalObject> *c = static_cast<Cache<DalObject>*>(i.second);
208 // std::cout << " *** " << c->m_cache.size() << " objects is class \'" << *i.first << "\' were accessed ***\n";
209 // for (auto & j : c->m_cache)
210 // std::cout << " - object \'" << j.first << '\'' << std::endl;
211 // }
212 // }
213
214 if (m_impl)
215 {
216 m_impl->print_cache_info();
217 m_impl->print_profiling_info();
218 }
219}

◆ ref() [1/2]

template<class T>
const T * dunedaq::conffwk::Configuration::ref ( ConfigObject & obj,
const std::string & name,
bool init = false )
inline

Get signle value of object's relation and instantiate result with it (multi-thread safe).

The method is used by the code generated by the genconffwk utility.

Parameters
objobject
namename of the relationship
initif true, the object and it's referenced objects are initialized
Returns
Return non-null pointer to object of user class in case if relationship with such name exists and it's value is set. Otherwise the method returns 0.
Exceptions
dunedaq::conffwk::Genericin case of a problem (e.g. no relationship with such name, plug-in specific problem)

Definition at line 868 of file Configuration.hpp.

868 {
869 std::lock_guard<std::mutex> scoped_lock(m_tmpl_mutex);
870 return _ref<T>(obj, name, init);
871 }
const T * _ref(ConfigObject &obj, const std::string &name, bool read_children)
Multi-thread unsafe version of ref(ConfigObject&, const std::string&, bool); The method should not be...

◆ ref() [2/2]

template<class T>
void dunedaq::conffwk::Configuration::ref ( ConfigObject & obj,
const std::string & name,
std::vector< const T * > & objects,
bool init = false )
inline

Get multiple values of object's relation and instantiate result with them (multi-thread safe).

The method is used by the code generated by the genconffwk utility.

Parameters
objobject
namename of the relationship
objectsreturned value
initif true, the objects and their referenced objects are initialized
Exceptions
dunedaq::conffwk::Genericin case of a problem (e.g. no relationship with such name, plug-in specific problem)

Definition at line 888 of file Configuration.hpp.

888 {
889 std::lock_guard<std::mutex> scoped_lock(m_tmpl_mutex);
890 _ref<T>(obj, name, objects, init);
891 }

◆ referenced_by() [1/2]

std::vector< const DalObject * > dunedaq::conffwk::Configuration::referenced_by ( const DalObject & obj,
const std::string & relationship_name = "*",
bool check_composite_only = true,
bool upcast_unregistered = true,
bool init = false,
unsigned long rlevel = 0,
const std::vector< std::string > * rclasses = nullptr )

Get DAL objects holding references on this object via given relationship (multi-thread safe).

The method returns vector of DalObject, which have references on given object via explicitly provided relationship name. If the relationship name is set to "*", then the method takes into account all relationships of all objects.

It is expected that the DAL for returned objects is generated and linked with user code. If this is not the case, then an exception will be thrown. The parameter upcast_unregistered allows to select one of the registered base classes instead. Note, this will be a random base class, not the closest based one.

The method is efficient only for composite relationships (i.e. when a parent has composite reference on this object). For generic relationships the method performs full scan of all database objects. It is not recommended at large scale to build complete graph of relations between all database object.

Parameters
objobject
relationship_namename of the relationship, via which the object is referenced
upcast_unregisteredif true, try to upcast objects of classes which DAL classes are not loaded; otherwise throw exception if such DAL class is not registered
check_composite_onlyonly returned composite parent objects
initif true, the returned objects and their referenced objects are initialized
rleveloptional references level to optimize performance (defines how many objects referenced by found objects have also to be read to the implementation cache)
rclassesoptional array of class names to optimize performance (defines which referenced objects have to be read to the implementation cache)
Returns
objects referencing given one
Exceptions
dunedaq::conffwk::Genericin case of an error

◆ referenced_by() [2/2]

template<class T, class V>
void dunedaq::conffwk::Configuration::referenced_by ( const T & obj,
std::vector< const V * > & objects,
const std::string & relationship_name = "*",
bool check_composite_only = true,
bool init = false,
unsigned long rlevel = 0,
const std::vector< std::string > * rclasses = nullptr )

Get template DAL objects holding references on this object via given relationship (multi-thread safe).

The method returns objects of class V, which have references on given object via explicitly provided relationship name. If the relationship name is set to "*", then the method takes into account all relationships of all objects. The method is efficient only for composite relationships (i.e. when a parent has composite reference on this object). For generic relationships the method performs full scan of all database objects. It is not recommended at large scale to build complete graph of relations between all database object.

Parameters
objobject
objectsreturned value
relationship_namename of the relationship, via which the object is referenced
check_composite_onlyonly returned composite parent objects
initif true, the returned objects and their referenced objects are initialized
rleveloptional references level to optimize performance (defines how many objects referenced by found objects have also to be read to the implementation cache)
rclassesoptional array of class names to optimize performance (defines which referenced objects have to be read to the implementation cache)
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 140 of file Configuration.hxx.

141 {
142 std::vector<ConfigObject> objs;
143
144 results.clear();
145
146 std::lock_guard<std::mutex> scoped_lock(m_tmpl_mutex);
147
148 try
149 {
150 obj.p_obj.referenced_by(objs, relationship_name, check_composite_only, rlevel, rclasses);
151
152 for (auto& i : objs)
153 {
154 if (try_cast(V::s_class_name, i.class_name()) == true)
155 {
156 // if (const V * o = get_cache<V>()->get(*this, i, init, init))
157 if (const V * o = m_registry.get<V>(i, init, init))
158 {
159 results.push_back(o);
160 }
161 }
162 }
163 }
164 catch (dunedaq::conffwk::Generic & ex)
165 {
166 throw(dunedaq::conffwk::Generic( ERS_HERE, mk_ref_by_ex_text(V::s_class_name, relationship_name, obj.p_obj).c_str(), ex ) );
167 }
168 }
static std::string mk_ref_by_ex_text(const std::string &cname, const std::string &rname, const ConfigObject &obj) noexcept
bool try_cast(const std::string &target, const std::string &source) noexcept
Checks if cast from source class to target class is allowed.

◆ register_converter()

template<class T>
void dunedaq::conffwk::Configuration::register_converter ( AttributeConverter< T > * object)
noexcept

Register user function for attribute conversion.

The user can register several objects which are used for attribute values conversion. The attributes conversion type is defined by the template parameter, e.g. given object to be used for string attribute values conversion, another object to be used for short unsigned integers, etc. It is possible to define several converters for each type. There is no check that given object was already registered or not. It is registered several times, the conversion will be done several times.

Parameters
objectthe converter object

Definition at line 372 of file Configuration.hxx.

373 {
374 std::lock_guard<std::mutex> scoped_lock(m_else_mutex);
375
376 std::list<AttributeConverterBase*> * c = m_convert_map[typeid(T).name()];
377 if (c == 0)
378 {
379 c = m_convert_map[typeid(T).name()] = new std::list<AttributeConverterBase*>();
380 }
381
382 c->push_back(object);
383 }

◆ relations_pybind()

std::unordered_map< std::string, std::unordered_map< std::string, std::string > > dunedaq::Configuration::relations_pybind ( const std::string & class_name,
bool all )

Definition at line 2078 of file Configuration.cpp.

2078 {
2079
2080 std::unordered_map<std::string, std::unordered_map<std::string, std::string>> all_relationships_properties;
2081
2082 const dunedaq::conffwk::class_t& c = this->get_class_info(class_name, !all);
2083
2084 for (const auto& rp : c.p_relationships) {
2085 std::unordered_map<std::string, std::string> relationship_properties;
2086
2087 relationship_properties["type"] = rp.p_type;
2088 relationship_properties["description"] = rp.p_description;
2089 relationship_properties["multivalue"] = (rp.p_cardinality == dunedaq::conffwk::zero_or_many || rp.p_cardinality == dunedaq::conffwk::one_or_many) ? "True" : "False";
2090 relationship_properties["aggregation"] = rp.p_is_aggregation ? "True" : "False";
2091 relationship_properties["not-null"] = (rp.p_cardinality == dunedaq::conffwk::only_one || rp.p_cardinality == dunedaq::conffwk::one_or_many) ? "True" : "False";
2092
2093 all_relationships_properties[rp.p_name] = relationship_properties;
2094 }
2095
2096 return all_relationships_properties;
2097}

◆ remove_action()

void dunedaq::Configuration::remove_action ( ConfigAction * ac)

Remove global action performed by user code on db [un]load and updates.

Definition at line 80 of file Configuration.cpp.

81{
82 std::lock_guard<std::mutex> scoped_lock(m_actn_mutex);
83 m_actions.remove(ac);
84}

◆ remove_include()

void dunedaq::Configuration::remove_include ( const std::string & db_name,
const std::string & include )

Remove include file.

The method removes existing include file from the database.

Parameters
db_namename of database file from which the include to be removed
includefile to be removed from includes
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 504 of file Configuration.cpp.

505{
506 if (m_impl == nullptr)
507 throw dunedaq::conffwk::Generic( ERS_HERE, "no implementation loaded" );
508
509 std::lock_guard<std::mutex> scoped_lock(m_impl_mutex);
510 std::lock_guard<std::mutex> scoped_lock2(m_tmpl_mutex);
511
512 try
513 {
514 m_impl->remove_include(db_name, include);
515 // m_impl->get_superclasses(p_superclasses);
516 // set_subclasses();
518 }
519 catch(dunedaq::conffwk::Generic & ex)
520 {
521 std::ostringstream text;
522 text << "failed to remove include \'" << include << "\' from database \'" << db_name<< '\'';
523 throw ( dunedaq::conffwk::Generic( ERS_HERE, text.str().c_str(), ex ) );
524 }
525}

◆ rename_object()

void dunedaq::Configuration::rename_object ( ConfigObject & obj,
const std::string & new_id )
private

Cache of template object of given type.

The class defines the cache of template objects of given type. The objects are stored in cache, where the key is object-ID and the value is a pointer on template object.

The access to cache and objects insertion are provided via two get() methods:

  • T * get(Configuration&, ConfigObject&, bool, bool) - get template object for given conffwk object
  • T * get(Configuration&, const std::string&, bool, bool, unsigned long, const std::vector<std::string> *) - get template object for given object ID

Definition at line 849 of file Configuration.cpp.

850{
851 std::lock_guard<std::mutex> scoped_impl_lock(m_tmpl_mutex); // always lock template objects mutex first
852 std::lock_guard<std::mutex> scoped_tmpl_lock(m_impl_mutex);
853
854 std::lock_guard<std::mutex> scoped_obj_lock(obj.m_impl->m_mutex);
855
856 const std::string old_id(obj.m_impl->m_id);
857
858 obj.m_impl->throw_if_deleted();
859 obj.m_impl->rename(new_id);
860 obj.m_impl->m_id = new_id;
861 m_impl->rename_impl_object(obj.m_impl->m_class_name, old_id, new_id);
862
863 TLOG_DEBUG(3) << " * call rename \'" << old_id << "\' to \'" << new_id << "\' in class \'" << obj.class_name() << "\')";
864
865 m_registry._rename_object(obj.class_name(), old_id, new_id);
866
867 // conffwk::fmap<CacheBase*>::iterator j = m_cache_map.find(&obj.class_name());
868 // if (j != m_cache_map.end())
869 // j->second->m_functions.m_rename_object_fn(j->second, old_id, new_id);
870
871 // conffwk::fmap<conffwk::fset>::const_iterator sc = p_superclasses.find(&obj.class_name());
872
873 // if (sc != p_superclasses.end())
874 // for (conffwk::fset::const_iterator c = sc->second.begin(); c != sc->second.end(); ++c)
875 // {
876 // conffwk::fmap<CacheBase*>::iterator j = m_cache_map.find(*c);
877
878 // if (j != m_cache_map.end())
879 // j->second->m_functions.m_rename_object_fn(j->second, old_id, new_id);
880 // }
881}

◆ reset_subscription()

void dunedaq::Configuration::reset_subscription ( )
private
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 1366 of file Configuration.cpp.

1367{
1368 // check that there is no at least one subscription
1369 // if NO, then unsubscribe
1370
1371 if (m_callbacks.empty())
1372 {
1373 m_impl->unsubscribe();
1374 return;
1375 }
1376
1377 // prepare subscription criteria
1378
1380 std::set<std::string> class_subscriptions;
1381
1382 // among existing subscriptions find one who has all subscriptions
1383
1384 bool found_subscribe_all = false;
1385
1386 for (const auto &i : m_callbacks)
1387 if (i->m_criteria.get_classes_subscription().empty() && i->m_criteria.get_objects_subscription().empty())
1388 {
1389 found_subscribe_all = true;
1390 break;
1391 }
1392
1393 if (found_subscribe_all == false)
1394 {
1395 // build list of all classes for which there is a subscription
1396 for (const auto &i : m_callbacks)
1397 for (const auto &j : i->m_criteria.get_classes_subscription())
1398 class_subscriptions.insert(j);
1399
1400 // build list of all objects for which there is a subscription (if there is no such class)
1401 for (const auto &i : m_callbacks)
1402 for (const auto &j : i->m_criteria.get_objects_subscription())
1403 {
1404 const std::string &obj_class_name = j.first;
1405 if (class_subscriptions.find(obj_class_name) == class_subscriptions.end())
1406 for (const auto &k : j.second)
1407 obj_subscriptions[obj_class_name].insert(k);
1408 }
1409 }
1410
1411 m_impl->subscribe(class_subscriptions, obj_subscriptions, system_cb, system_pre_cb);
1412}
std::map< std::string, std::set< std::string > > ObjectMap
The map stores full subsription information.
static void system_cb(std::vector< ConfigurationChange * > &, Configuration *) noexcept
System callback function invoked in case of modifications.
static void system_pre_cb(Configuration *) noexcept
System callback function invoked in case of pre-modifications.

◆ return_includes_pybind()

std::list< std::string > * dunedaq::Configuration::return_includes_pybind ( const std::string & db_name)

Definition at line 2100 of file Configuration.cpp.

2100 {
2101 auto l = new std::list<std::string>;
2102 this->get_includes(db_name, *l);
2103 return l;
2104}
void get_includes(const std::string &db_name, std::list< std::string > &includes) const
Get include files.

◆ set_class_domain_map()

void dunedaq::Configuration::set_class_domain_map ( )
private

Definition at line 759 of file Configuration.cpp.

759 {
760
761 p_class_domain_map.clear();
762
763 auto domains = this->find_class_domains();
764 for( size_t i(0); i<domains.size(); ++i ) {
765 const auto& dom = domains[i];
766 for( const auto& class_name : dom ) {
767 p_class_domain_map[&conffwk::DalFactory::instance().get_known_class_name_ref(class_name)] = i;
768 }
769 }
770}
std::deque< std::set< std::string > > find_class_domains()
conffwk::fmap< uint > p_class_domain_map

◆ set_commit_credentials()

void dunedaq::Configuration::set_commit_credentials ( const std::string & user,
const std::string & password )

Set commit credentials.

The method sets credentials used by commit method.

Parameters
useruser name
passworduser password
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 568 of file Configuration.cpp.

569{
570 if (m_impl == nullptr)
571 throw dunedaq::conffwk::Generic( ERS_HERE, "no implementation loaded" );
572
573 std::lock_guard<std::mutex> scoped_lock(m_impl_mutex);
574
575 try
576 {
577 m_impl->set_commit_credentials(user, password);
578 }
579 catch(dunedaq::conffwk::Generic & ex)
580 {
581 throw ( dunedaq::conffwk::Generic( ERS_HERE, "set_commit_credentials failed", ex ) );
582 }
583}

◆ set_subclasses()

void dunedaq::Configuration::set_subclasses ( )
privatenoexcept

Definition at line 688 of file Configuration.cpp.

689{
690 p_subclasses.clear();
691
692 for (const auto &i : p_superclasses)
693 for (const auto &j : i.second)
694 p_subclasses[j].insert(i.first);
695}
conffwk::fmap< conffwk::fset > p_subclasses

◆ subclasses()

const conffwk::fmap< conffwk::fset > & dunedaq::conffwk::Configuration::subclasses ( ) const
inline

Get names of subclasses for each class

Definition at line 1457 of file Configuration.hpp.

1457{return p_subclasses;}

◆ subclasses_pybind()

std::vector< std::string > dunedaq::Configuration::subclasses_pybind ( const std::string & class_name,
bool all )

Definition at line 2107 of file Configuration.cpp.

2107 {
2108
2109 const dunedaq::conffwk::class_t& c = this->get_class_info(class_name, !all);
2110 return c.p_subclasses;
2111}

◆ subscribe() [1/2]

CallbackId dunedaq::conffwk::Configuration::subscribe ( const ConfigurationSubscriptionCriteria & criteria,
notify user_cb,
void * user_param = nullptr )

Subscribe on configuration changes.

The method is used to make a subscription. The returned value is a subscription handler.

When subscribed changes occurred, the user callback function is invoked with changes description and parameter 'user_param' defined by user.

Parameters
criteriasubscription criteria
user_cbuser-defined callback function
user_paramoptional user-defined parameter
Returns
non-null value in case of success (the value to be used for unsubscribe() method).
Exceptions
dunedaq::conffwk::Genericin case of an error

◆ subscribe() [2/2]

CallbackId dunedaq::conffwk::Configuration::subscribe ( pre_notify user_cb,
void * user_param = nullptr )

Subscribe on pre-notification on configuration changes.

The method is used to make complimentary subscription on pre-notification about changes, that can only be used together with real subscription on changes, i.e. using subscribe(const ConfigurationSubscriptionCriteria&, notify, void *) method.

When subscribed changes occurred, but before they are going to be applied, the user callback function is invoked with parameter 'user_param' defined by user. This subscription can be used to be informed, that some changes are took place already and will be applied immediately after user's code exits given callback function.

Parameters
user_cbuser-defined callback function
user_paramoptional user-defined parameter
Returns
non-null value in case of success (the value to be used for unsubscribe() method).
Exceptions
dunedaq::conffwk::Genericin case of an error

◆ superclasses()

const conffwk::fmap< conffwk::fset > & dunedaq::conffwk::Configuration::superclasses ( ) const
inlinenoexcept

Get names of superclasses for each class

Definition at line 1452 of file Configuration.hpp.

1452{return p_superclasses;}

◆ superclasses_pybind()

std::vector< std::string > dunedaq::Configuration::superclasses_pybind ( const std::string & class_name,
bool all )

Definition at line 2114 of file Configuration.cpp.

2114 {
2115
2116 const dunedaq::conffwk::class_t& c = this->get_class_info(class_name, !all);
2117 return c.p_superclasses;
2118}

◆ system_cb()

void dunedaq::Configuration::system_cb ( std::vector< ConfigurationChange * > & changes,
Configuration * conf )
staticnoexcept

System callback function invoked in case of modifications.

It is used by the database implementation. Only is called, when a user subscription to related class is set.

Definition at line 1581 of file Configuration.cpp.

1582{
1583
1584 TLOG_DEBUG(3) <<
1585 "*** Enter Configuration::system_cb()\n"
1586 "*** Number of user subscriptions: " << conf->m_callbacks.size()
1587 ;
1588
1589 // call conffwk actions if any
1590 {
1591 std::lock_guard<std::mutex> scoped_lock(conf->m_impl_mutex);
1592 std::lock_guard<std::mutex> scoped_lock2(conf->m_actn_mutex);
1593 for (auto & i : conf->m_actions)
1594 i->notify(changes);
1595 }
1596
1597
1598 // update template objects in cache
1599 {
1600 std::lock_guard<std::mutex> scoped_lock(conf->m_tmpl_mutex); // always lock template objects mutex first
1601 std::lock_guard<std::mutex> scoped_lock2(conf->m_impl_mutex);
1602 conf->update_cache(changes);
1603 }
1604
1605
1606 // user removed all subscriptions
1607 if(conf->m_callbacks.empty()) return;
1608
1609 // note, one cannot lock m_tmpl_mutex or m_impl_mutex here,
1610 // since user callback may call arbitrary get() methods to access conffwk
1611 // and template objects locking above two mutexes
1612 std::lock_guard<std::mutex> scoped_lock(conf->m_else_mutex);
1613
1614 // check if there is only one subscription
1615 if (conf->m_callbacks.size() == 1)
1616 {
1617 auto j = *conf->m_callbacks.begin();
1618 (*(j->m_cb))(changes, j->m_param);
1619 }
1620 // may need to calculate the changes for each subscription
1621 else
1622 {
1623 for (const auto &j : conf->m_callbacks)
1624 {
1625
1626 if (ers::debug_level() >= 3)
1627 {
1628 std::ostringstream text;
1629
1630 text <<
1631 "*** Process subscription " << (void*) j << "\n"
1632 " class subscription done for " << j->m_criteria.get_classes_subscription().size() << " classes:\n";
1633
1634 for (const auto &i1 : j->m_criteria.get_classes_subscription())
1635 text << " * class \"" << i1 << "\"\n";
1636
1637 text << " object subscription done in " << j->m_criteria.get_objects_subscription().size() << " classes:\n";
1638
1639 for (const auto &i2 : j->m_criteria.get_objects_subscription())
1640 {
1641 text << " * class \"" << (i2.first) << "\":\n";
1642 for (const auto &i3 : i2.second)
1643 text << " - \"" << i3 << "\"\n";
1644 }
1645
1646 TLOG_DEBUG(3) << text.str();
1647 }
1648
1649 if (j->m_criteria.get_classes_subscription().empty() && j->m_criteria.get_objects_subscription().empty())
1650 {
1651 try
1652 {
1653 TLOG_DEBUG(3) << "*** Invoke callback " << (void *)j << " with\n" << changes;
1654 (*(j->m_cb))(changes, j->m_param);
1655 }
1656 catch (const ers::Issue &ex)
1657 {
1658 ers::error(dunedaq::conffwk::Generic( ERS_HERE, "user callback thrown ers exception", ex));
1659 }
1660 catch (const std::exception &ex)
1661 {
1662 ers::error(dunedaq::conffwk::Generic( ERS_HERE, "user callback thrown std exception", ex));
1663 }
1664 catch (...)
1665 {
1666 ers::error(dunedaq::conffwk::Generic( ERS_HERE, "user callback thrown unknown exception"));
1667 }
1668 }
1669 else
1670 {
1671 std::vector<ConfigurationChange*> changes1;
1672
1673 for (const auto &i : changes)
1674 {
1675 const std::string &cname = i->get_class_name();
1676 ConfigurationChange *class_changes = nullptr;
1677
1678 ConfigurationSubscriptionCriteria::ObjectMap::const_iterator p = j->m_criteria.get_objects_subscription().find(cname);
1679 const bool found_obj_subscription(p != j->m_criteria.get_objects_subscription().end());
1680 const bool found_class_subscription(j->m_criteria.get_classes_subscription().find(cname) != j->m_criteria.get_classes_subscription().end());
1681
1682 if (found_class_subscription || found_obj_subscription)
1683 class_changes = new ConfigurationChange(cname);
1684
1685 if (found_class_subscription)
1686 {
1687 for (const auto &k : i->m_modified)
1688 class_changes->m_modified.push_back(k);
1689
1690 for (const auto &k : i->m_created)
1691 class_changes->m_created.push_back(k);
1692
1693 for (const auto &k : i->m_removed)
1694 class_changes->m_removed.push_back(k);
1695 }
1696
1697 if (found_obj_subscription)
1698 {
1699 for (const auto &obj_id : i->m_modified)
1700 if (p->second.find(obj_id) != p->second.end())
1701 class_changes->m_modified.push_back(obj_id);
1702
1703 for (const auto &obj_id : i->m_removed)
1704 if (p->second.find(obj_id) != p->second.end())
1705 class_changes->m_removed.push_back(obj_id);
1706 }
1707
1708 // the changes for given class can be empty if there is subscription on objects of given class, but no such objects were modified
1709 if (class_changes)
1710 {
1711 if (class_changes->m_modified.empty() && class_changes->m_created.empty() && class_changes->m_removed.empty())
1712 delete class_changes;
1713 else
1714 changes1.push_back(class_changes);
1715 }
1716 }
1717
1718 if (!changes1.empty())
1719 {
1720 TLOG_DEBUG(3) << "*** Invoke callback " << (void *)j << " with\n" << changes1;
1721
1722 try
1723 {
1724 (*(j->m_cb))(changes1, j->m_param);
1725 }
1726 catch (const ers::Issue &ex)
1727 {
1728 ers::error(dunedaq::conffwk::Generic( ERS_HERE, "user callback thrown ers exception", ex));
1729 }
1730 catch (const std::exception &ex)
1731 {
1732 ers::error(dunedaq::conffwk::Generic( ERS_HERE, "user callback thrown std exception", ex));
1733 }
1734 catch (...)
1735 {
1736 ers::error(dunedaq::conffwk::Generic( ERS_HERE, "user callback thrown unknown exception"));
1737 }
1738
1739 for (const auto &i : changes1)
1740 delete i;
1741 }
1742 }
1743 }
1744 }
1745
1746 TLOG_DEBUG(3) <<"*** Leave Configuration::system_cb()";
1747}
int debug_level()
Definition ers.hpp:77

◆ system_pre_cb()

void dunedaq::Configuration::system_pre_cb ( Configuration * conf)
staticnoexcept

System callback function invoked in case of pre-modifications.

It is used by the database implementation. Only is called, when a user subscription is set.

Definition at line 1751 of file Configuration.cpp.

1752{
1753 TLOG_DEBUG(3) <<"*** Enter Configuration::system_pre_cb()";
1754
1755 std::lock_guard<std::mutex> scoped_lock(conf->m_else_mutex);
1756
1757 for(auto& j : conf->m_pre_callbacks)
1758 {
1759 TLOG_DEBUG(3) << "*** Invoke callback " << (void *)(j);
1760 (*(j->m_cb))(j->m_param);
1761 }
1762
1763 TLOG_DEBUG(3) <<"*** Leave Configuration::system_pre_cb()";
1764}

◆ test_object()

bool dunedaq::Configuration::test_object ( const std::string & class_name,
const std::string & id,
unsigned long rlevel = 0,
const std::vector< std::string > * rclasses = 0 )

Test the object existence.

The method searches an object with given id within the class and all derived subclasses. If found, the method returns true, otherwise the method return false.

Parameters
class_namename of the class
idobject identity
rleveloptional references level to optimize performance (defines how many objects referenced by given object have also to be read to the implementation cache)
rclassesoptional array of class names to optimize performance (defines which referenced objects have to be read to the implementation cache)
Exceptions
dunedaq::conffwk::Genericif there is no such class or in case of an error

Definition at line 782 of file Configuration.cpp.

783{
784 try
785 {
786 std::lock_guard<std::mutex> scoped_lock(m_impl_mutex);
787 return m_impl->test_object(class_name, id, rlevel, rclasses);
788 }
789 catch (dunedaq::conffwk::Generic& ex)
790 {
791 std::ostringstream text;
792 text << "failed to test existence of object \'" << id << '@' << class_name << '\'';
793 throw dunedaq::conffwk::Generic( ERS_HERE, text.str().c_str(), ex );
794 }
795}

◆ try_cast() [1/2]

bool dunedaq::Configuration::try_cast ( const std::string & target,
const std::string & source )
noexcept

Checks if cast from source class to target class is allowed.

Parameters
targetname of desired class (e.g. try to cast object of "source" class to this "target" one)
sourcename of casted object class
Returns
Return true if the cast is allowed by database schema

Definition at line 1867 of file Configuration.cpp.

1868{
1869 return is_superclass_of(target, source);
1870}
bool is_superclass_of(const std::string &target, const std::string &source) noexcept

◆ try_cast() [2/2]

bool dunedaq::Configuration::try_cast ( const std::string * target,
const std::string * source )
noexcept

Definition at line 1873 of file Configuration.cpp.

1874{
1875 return is_superclass_of(target, source);
1876}

◆ unload()

void dunedaq::Configuration::unload ( )

Unload database.

The database should be previously loaded. The method destroys all user objects from cache (i.e. created via conffwk and template get methods) and frees all DB resources allocated by the implementation plug-in.

Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 375 of file Configuration.cpp.

376{
377 if (m_impl == nullptr)
378 throw dunedaq::conffwk::Generic( ERS_HERE, "nothing to unload" );
379
380 std::lock_guard<std::mutex> scoped_lock1(m_tmpl_mutex); // always lock template objects mutex first
381 std::lock_guard<std::mutex> scoped_lock2(m_impl_mutex);
382
383 // call conffwk actions if any
384 {
385 std::lock_guard<std::mutex> scoped_lock(m_actn_mutex);
386 for(auto & i : m_actions)
387 {
388 i->unload();
389 }
390 }
391
392 // for (auto& i : m_cache_map) {
393 // delete i.second;
394 // }
395
396 // m_cache_map.clear();
397 m_registry.clear();
398
399 {
400 std::lock_guard<std::mutex> scoped_lock3(m_else_mutex);
401
402 for (auto& cb : m_callbacks)
403 delete cb;
404
405 for (auto& cb : m_pre_callbacks)
406 delete cb;
407
408 m_callbacks.clear();
409 m_pre_callbacks.clear();
410
411 m_impl->unsubscribe();
412
413 for (auto& l : m_convert_map) {
414 for (auto& a : *l.second)
415 delete a;
416
417 delete l.second;
418 }
419
420 m_convert_map.clear();
421 }
422
423 p_superclasses.clear();
424
425 for(auto& j : p_direct_classes_desc_cache)
426 delete j.second;
427
428 for(auto& j : p_all_classes_desc_cache)
429 delete j.second;
430
433
434 m_impl->close_db();
435}

◆ unread_all_objects()

void dunedaq::Configuration::unread_all_objects ( bool unread_implementation_objs = false)
noexcept

Unread all template (i.e. set their state as uninitialized) and implementation objects (i.e. clear their cache).

Unread template objects result changing their state to uninitialized. They will be re-initialized, when accessed by user code. This feature is used by attribute converter methods using unread_all_objects().

Unread implementation objects result removing any information from implementation cache, e.g. clear any object attributes data read from server. One may use the unread_all_objects() to re-read database after reload.

Parameters
unread_implementation_objsif true, clear implementation objects; otherwise only template objects are unread and the implementation conffwk objects are still valid.

Definition at line 651 of file Configuration.cpp.

652{
653 if (unread_implementation_objs)
655
657}
void unread_template_objects() noexcept
Unread all template (i.e. set their state as uninitialized) objects.
void unread_implementation_objects(dunedaq::conffwk::ObjectState state) noexcept
Unread implementation objects (i.e. clear their cache).

◆ unread_implementation_objects()

void dunedaq::conffwk::Configuration::unread_implementation_objects ( dunedaq::conffwk::ObjectState state)
inlinenoexcept

Unread implementation objects (i.e. clear their cache).

This results removing any information from implementation cache, e.g. clear any object attributes data read from server.

Parameters
stateset state of implementation objects after unread; is set to "Unknown" after abort()

Definition at line 550 of file Configuration.hpp.

551 {
552 std::lock_guard<std::mutex> scoped_lock(m_impl_mutex);
554 }

◆ unread_template_objects()

void dunedaq::conffwk::Configuration::unread_template_objects ( )
inlinenoexcept

Unread all template (i.e. set their state as uninitialized) objects.

Unread template objects result changing their state to uninitialized. They will be re-initialized, when accessed by user code. This feature is used by attribute converter methods using unread_all_objects().

Definition at line 534 of file Configuration.hpp.

535 {
536 std::lock_guard<std::mutex> scoped_lock(m_tmpl_mutex);
538 }

◆ unsubscribe()

void dunedaq::Configuration::unsubscribe ( CallbackId cb_handler = 0)

Remove callback function.

Remove callback function previously added by the subscribe() methods. If the parameter is a non-null value, it must be equal to id returned by the add_callback() method. Otherwise the method stops all subscription.

Exceptions
dunedaq::conffwk::Genericin case of an error (e.g. bad ID, plugin-specific problems)

Definition at line 1317 of file Configuration.cpp.

1318{
1319 std::lock_guard < std::mutex > scoped_lock(m_else_mutex);
1320
1321 if (id)
1322 {
1323 CallbackSet::iterator i = m_callbacks.find(id);
1324 PreCallbackSet::iterator j = m_pre_callbacks.find(reinterpret_cast<CallbackPreSubscription *>(id));
1325
1326 if (i != m_callbacks.end())
1327 {
1328 delete id;
1329 m_callbacks.erase(i);
1330 }
1331 else if (j != m_pre_callbacks.end())
1332 {
1333 delete reinterpret_cast<CallbackPreSubscription *>(id);
1334 m_pre_callbacks.erase(j);
1335 }
1336 else
1337 {
1338 std::ostringstream text;
1339 text << "unsubscription failed for CallbackId = " << (void *) id << " (no such callback id found)";
1340 throw(dunedaq::conffwk::Generic( ERS_HERE, text.str().c_str() ) );
1341 }
1342 }
1343 else
1344 {
1345 for (auto &i : m_callbacks)
1346 delete i;
1347
1348 for (auto &i : m_pre_callbacks)
1349 delete i;
1350
1351 m_callbacks.clear();
1352 m_pre_callbacks.clear();
1353 }
1354
1355 try
1356 {
1358 }
1359 catch (dunedaq::conffwk::Generic& ex)
1360 {
1361 throw dunedaq::conffwk::Generic( ERS_HERE, "unsubscription failed", ex );
1362 }
1363}

◆ update()

template<class T>
void dunedaq::conffwk::Configuration::update ( const std::vector< std::string > & modified,
const std::vector< std::string > & removed,
const std::vector< std::string > & created )
noexcept

Update cache of objects in case of modification.

Only is called, when a user subscription to related class is set. It is used by automatically generated data access libraries.

Parameters
modifiedvector of modified objects of given user class (objects to be re-read in cache)
removedvector of removed objects of given user class (objects to be removed from cache)
createdvector of created objects of given user class (objects to be reset in cache, if they were removed)

Definition at line 299 of file Configuration.hxx.

302 {
303 // auto j = m_cache_map.find(&T::s_class_name);
304
305 // TLOG_DEBUG(4) << "call for class \'" << T::s_class_name << '\'';
306
307 // if (j != m_cache_map.end())
308 // {
309 // Cache<T> *c = static_cast<Cache<T>*>(j->second);
310 // set_cache_unread(removed, *c);
311 // set_cache_unread(created, *c);
312 // set_cache_unread(modified, *c);
313 // }
314 m_registry.update<T>(modified, removed, created);
315 }

◆ update_cache()

void dunedaq::Configuration::update_cache ( std::vector< ConfigurationChange * > & changes)
noexcept

System function invoked in case of modifications.

It is used by the database implementation. Update cache of template DB objects.

Definition at line 1488 of file Configuration.cpp.

1489{
1490 TLOG_DEBUG(3) << "*** Enter Configuration::update_cache() with changes:\n" << changes;
1491
1492 // Remove deleted and update modified implementation objects first
1493 for (const auto& i : changes)
1494 {
1495 const std::string * class_name = &DalFactory::instance().get_known_class_name_ref(i->get_class_name());
1496
1497 update_impl_objects(m_impl->m_impl_objects, *i, class_name);
1498
1499 // delete/update implementation objects defined in superclasses
1500 conffwk::fmap<conffwk::fset>::const_iterator sc = p_superclasses.find(class_name);
1501
1502 if (sc != p_superclasses.end())
1503 for (const auto &c : sc->second)
1504 update_impl_objects(m_impl->m_impl_objects, *i, c);
1505
1506 // delete/update implementation objects defined in subclasses
1507 sc = p_subclasses.find(class_name);
1508
1509 if (sc != p_subclasses.end())
1510 for (const auto &c : sc->second)
1511 update_impl_objects(m_impl->m_impl_objects, *i, c);
1512 }
1513
1514 for (const auto& i : changes)
1515 {
1516
1517 m_registry.update(i->get_class_name(), i->get_modified_objs(), i->get_removed_objs(), i->get_created_objs());
1518
1519 // const std::string * class_name = &DalFactory::instance().get_known_class_name_ref(i->get_class_name()); // FIXME: optimise with above
1520
1521 // // invoke configuration update if there are template objects of given class
1522
1523 // {
1524 // conffwk::fmap<CacheBase*>::iterator j = m_cache_map.find(class_name);
1525
1526 // if (j != m_cache_map.end())
1527 // {
1528 // TLOG_DEBUG(3) << " * call update on \'" << j->first << "\' template objects";
1529 // j->second->m_functions.m_update_fn(*this, i);
1530 // }
1531 // }
1532
1533
1534 // // invoke configuration update if there are template objects in super-classes
1535
1536 // {
1537 // conffwk::fmap<conffwk::fset>::const_iterator sc = p_superclasses.find(class_name);
1538
1539 // if (sc != p_superclasses.end())
1540 // {
1541 // for (const auto& c : sc->second)
1542 // {
1543 // conffwk::fmap<CacheBase*>::iterator j = m_cache_map.find(c);
1544
1545 // if (j != m_cache_map.end())
1546 // {
1547 // TLOG_DEBUG(3) << " * call update on \'" << j->first << "\' template objects (as super-class of \'" << *class_name << "\')";
1548 // j->second->m_functions.m_update_fn(*this, i);
1549 // }
1550 // }
1551 // }
1552 // }
1553
1554
1555 // // invoke configuration update if there are template objects in sub-classes
1556
1557 // {
1558 // conffwk::fmap<conffwk::fset>::const_iterator sc = p_subclasses.find(class_name);
1559
1560 // if (sc != p_subclasses.end())
1561 // {
1562 // for (const auto& c : sc->second)
1563 // {
1564 // conffwk::fmap<CacheBase*>::iterator j = m_cache_map.find(c);
1565
1566 // if (j != m_cache_map.end())
1567 // {
1568 // TLOG_DEBUG(3) << " * call update on \'" << j->first << "\' template objects (as sub-class of \'" << *class_name << "\')";
1569 // j->second->m_functions.m_update_fn(*this, i);
1570 // }
1571 // }
1572 // }
1573 // }
1574
1575 }
1576
1577}
static void update_impl_objects(conffwk::pmap< conffwk::map< ConfigObjectImpl * > * > &cache, ConfigurationChange &change, const std::string *class_name)

◆ update_classes()

void dunedaq::Configuration::update_classes ( )
privatenoexcept

Definition at line 699 of file Configuration.cpp.

700{
701 m_impl->get_superclasses(p_superclasses);
702 this->set_subclasses();
703 this->set_class_domain_map();
704 m_registry.update_class_maps();
705}

◆ update_impl_objects()

void dunedaq::Configuration::update_impl_objects ( conffwk::pmap< conffwk::map< ConfigObjectImpl * > * > & cache,
ConfigurationChange & change,
const std::string * class_name )
staticprivate

Definition at line 1416 of file Configuration.cpp.

1417{
1418 if (change.get_removed_objs().empty() == false)
1419 {
1420 conffwk::pmap<conffwk::map<ConfigObjectImpl *> *>::iterator i = cache.find(class_name);
1421
1422 if (i != cache.end())
1423 {
1424 for (auto & x : change.get_removed_objs())
1425 {
1426 conffwk::map<ConfigObjectImpl *>::iterator j = i->second->find(x);
1427 if (j != i->second->end())
1428 {
1429 TLOG_DEBUG( 2 ) << "set implementation object " << x << '@' << *class_name << " [" << (void *)j->second << "] deleted";
1430
1431 std::lock_guard<std::mutex> scoped_lock(j->second->m_mutex);
1432 j->second->m_state = dunedaq::conffwk::Deleted;
1433 j->second->clear();
1434 }
1435 }
1436 }
1437 }
1438
1439 if (change.get_created_objs().empty() == false)
1440 {
1441 conffwk::pmap<conffwk::map<ConfigObjectImpl *> *>::iterator i = cache.find(class_name);
1442
1443 if (i != cache.end())
1444 {
1445 for (auto & x : change.get_created_objs())
1446 {
1447 conffwk::map<ConfigObjectImpl *>::iterator j = i->second->find(x);
1448 if (j != i->second->end())
1449 {
1450 TLOG_DEBUG( 2 ) << "re-set created implementation object " << x << '@' << *class_name << " [" << (void *)j->second << ']';
1451
1452 std::lock_guard<std::mutex> scoped_lock(j->second->m_mutex);
1453 j->second->reset(); // it does not matter what the state was, always reset
1454 }
1455 }
1456 }
1457 }
1458
1459 if (change.get_modified_objs().empty() == false)
1460 {
1461 conffwk::pmap<conffwk::map<ConfigObjectImpl *> *>::iterator i = cache.find(class_name);
1462
1463 if (i != cache.end())
1464 {
1465 for (auto & x : change.get_modified_objs())
1466 {
1467 conffwk::map<ConfigObjectImpl *>::iterator j = i->second->find(x);
1468 if (j != i->second->end())
1469 {
1470 TLOG_DEBUG(2) << "clear implementation object " << x << '@' << *class_name << " [" << (void *)j->second << ']';
1471
1472 std::lock_guard<std::mutex> scoped_lock(j->second->m_mutex);
1473
1474 if(j->second->m_state != dunedaq::conffwk::Valid)
1475 j->second->reset();
1476 else
1477 j->second->clear();
1478 }
1479 }
1480 }
1481 }
1482}

◆ ConfigObject

friend class ConfigObject
friend

Definition at line 231 of file Configuration.hpp.

◆ ConfigurationImpl

friend class ConfigurationImpl
friend

Definition at line 232 of file Configuration.hpp.

◆ DalObject

DalObject
friend

Definition at line 230 of file Configuration.hpp.

◆ DalRegistry

friend class DalRegistry
friend

Definition at line 235 of file Configuration.hpp.

Member Data Documentation

◆ m_actions

std::list<ConfigAction *> dunedaq::conffwk::Configuration::m_actions
private

Definition at line 1708 of file Configuration.hpp.

◆ m_actn_mutex

std::mutex dunedaq::conffwk::Configuration::m_actn_mutex
mutableprivate

Definition at line 1717 of file Configuration.hpp.

◆ m_callbacks

CallbackSet dunedaq::conffwk::Configuration::m_callbacks
private

Definition at line 1687 of file Configuration.hpp.

◆ m_convert_map

conffwk::map<std::list<AttributeConverterBase*> * > dunedaq::conffwk::Configuration::m_convert_map
private

Definition at line 1465 of file Configuration.hpp.

◆ m_else_mutex

std::mutex dunedaq::conffwk::Configuration::m_else_mutex
mutableprivate

Definition at line 1718 of file Configuration.hpp.

◆ m_impl

ConfigurationImpl* dunedaq::conffwk::Configuration::m_impl
private

Definition at line 1668 of file Configuration.hpp.

◆ m_impl_mutex

std::mutex dunedaq::conffwk::Configuration::m_impl_mutex
mutableprivate

Definition at line 1715 of file Configuration.hpp.

◆ m_impl_name

std::string dunedaq::conffwk::Configuration::m_impl_name
private

Definition at line 1670 of file Configuration.hpp.

◆ m_impl_param

std::string dunedaq::conffwk::Configuration::m_impl_param
private

Definition at line 1671 of file Configuration.hpp.

◆ m_impl_spec

std::string dunedaq::conffwk::Configuration::m_impl_spec
private

Definition at line 1669 of file Configuration.hpp.

◆ m_pre_callbacks

PreCallbackSet dunedaq::conffwk::Configuration::m_pre_callbacks
private

Definition at line 1688 of file Configuration.hpp.

◆ m_registry

DalRegistry dunedaq::conffwk::Configuration::m_registry
private

Definition at line 1713 of file Configuration.hpp.

◆ m_shlib_h

void* dunedaq::conffwk::Configuration::m_shlib_h
private

Definition at line 1675 of file Configuration.hpp.

◆ m_tmpl_mutex

std::mutex dunedaq::conffwk::Configuration::m_tmpl_mutex
mutableprivate

Definition at line 1716 of file Configuration.hpp.

◆ p_all_classes_desc_cache

conffwk::map<dunedaq::conffwk::class_t *> dunedaq::conffwk::Configuration::p_all_classes_desc_cache
private

Definition at line 1300 of file Configuration.hpp.

◆ p_class_domain_map

conffwk::fmap<uint> dunedaq::conffwk::Configuration::p_class_domain_map
private

Definition at line 1438 of file Configuration.hpp.

◆ p_direct_classes_desc_cache

conffwk::map<dunedaq::conffwk::class_t *> dunedaq::conffwk::Configuration::p_direct_classes_desc_cache
private

Definition at line 1299 of file Configuration.hpp.

◆ p_number_of_cache_hits

std::atomic<uint_least64_t> dunedaq::conffwk::Configuration::p_number_of_cache_hits
private

Definition at line 1429 of file Configuration.hpp.

◆ p_number_of_template_object_created

std::atomic<uint_least64_t> dunedaq::conffwk::Configuration::p_number_of_template_object_created
private

Definition at line 1430 of file Configuration.hpp.

◆ p_number_of_template_object_read

std::atomic<uint_least64_t> dunedaq::conffwk::Configuration::p_number_of_template_object_read
private

Definition at line 1431 of file Configuration.hpp.

◆ p_subclasses

conffwk::fmap<conffwk::fset> dunedaq::conffwk::Configuration::p_subclasses
private

Definition at line 1437 of file Configuration.hpp.

◆ p_superclasses

conffwk::fmap<conffwk::fset> dunedaq::conffwk::Configuration::p_superclasses
private

Definition at line 1436 of file Configuration.hpp.


The documentation for this class was generated from the following files: