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

#include <MLTConf.hpp>

Inheritance diagram for dunedaq::appmodel::MLTConf:
[legend]
Collaboration diagram for dunedaq::appmodel::MLTConf:
[legend]

Public Member Functions

virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the MLTConf object.
 
virtual std::vector< const dunedaq::conffwk::DalObject * > get (const std::string &name, bool upcast_unregistered=true) const
 Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject pointers.
 
const std::string & get_template_for () const
 Get "template_for" attribute value.
 
void set_template_for (const std::string &value)
 Set "template_for" attribute value.
 
bool get_latency_monitoring () const
 Get "latency_monitoring" attribute value. Should we monitor latency in Grafana?
 
void set_latency_monitoring (bool value)
 Set "latency_monitoring" attribute value. Should we monitor latency in Grafana?
 
const std::vector< const dunedaq::appmodel::SubdetectorReadoutWindowMap * > & get_subdetector_readout_map () const
 Get "subdetector_readout_map" relationship value. Optional detector readout map per sub-dector as defined in dunedaq::detdataformats::DetID::Subdetector.
 
void set_subdetector_readout_map (const std::vector< const dunedaq::appmodel::SubdetectorReadoutWindowMap * > &value)
 Set "subdetector_readout_map" relationship value. Optional detector readout map per sub-dector as defined in dunedaq::detdataformats::DetID::Subdetector.
 
virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the MLTConf object.
 
virtual std::vector< const dunedaq::conffwk::DalObject * > get (const std::string &name, bool upcast_unregistered=true) const
 Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject pointers.
 
const std::string & get_template_for () const
 Get "template_for" attribute value.
 
void set_template_for (const std::string &value)
 Set "template_for" attribute value.
 
bool get_latency_monitoring () const
 Get "latency_monitoring" attribute value. Should we monitor latency in Grafana?
 
void set_latency_monitoring (bool value)
 Set "latency_monitoring" attribute value. Should we monitor latency in Grafana?
 
const std::vector< const dunedaq::appmodel::SubdetectorReadoutWindowMap * > & get_subdetector_readout_map () const
 Get "subdetector_readout_map" relationship value. Optional detector readout map per sub-dector as defined in dunedaq::detdataformats::DetID::Subdetector.
 
void set_subdetector_readout_map (const std::vector< const dunedaq::appmodel::SubdetectorReadoutWindowMap * > &value)
 Set "subdetector_readout_map" relationship value. Optional detector readout map per sub-dector as defined in dunedaq::detdataformats::DetID::Subdetector.
 
- Public Member Functions inherited from dunedaq::conffwk::DalObject
const std::string & UID () const noexcept
 
const std::string & class_name () const noexcept
 
bool castable (const std::string &target) const noexcept
 
bool castable (const std::string *target) const noexcept
 
template<class TARGET >
const TARGET * cast () const noexcept
 Casts object to different class.
 
std::string full_name () const noexcept
 
const ConfigObjectconfig_object () const
 
DalRegistryregistry () const noexcept
 
Configurationconfiguration () const noexcept
 
void unread ()
 
void set (const ConfigObject &o) noexcept
 
void move (const std::string &at)
 
void rename (const std::string &new_id)
 
void p_hdr (std::ostream &s, unsigned int indent, const std::string &cl, const char *nm=nullptr) const
 print object headers
 
std::ostream & print_object (std::ostream &s) const
 print object details
 
void throw_init_ex (dunedaq::conffwk::Exception &ex)
 throw object initialisation exception (i.e.
 

Static Public Member Functions

static const std::string & __get_template_for_str () noexcept
 
static const std::string & __get_latency_monitoring_str () noexcept
 
static const std::string & __get_subdetector_readout_map_str () noexcept
 
static const std::string & __get_template_for_str () noexcept
 
static const std::string & __get_latency_monitoring_str () noexcept
 
static const std::string & __get_subdetector_readout_map_str () noexcept
 
- Static Public Member Functions inherited from dunedaq::conffwk::DalObject
static void p_null (std::ostream &s)
 print "(null)"
 
static void p_rm (std::ostream &s)
 print "(deleted object)"
 
static void p_error (std::ostream &s, dunedaq::conffwk::Exception &ex)
 print error text
 
static void throw_get_ex (const std::string &what, const std::string &class_name, const DalObject *obj)
 throw exception in generated get method (i.e.
 
static bool is_null (const DalObject *ref) noexcept
 check a pointer on DAL object is null
 

Static Public Attributes

static const std::string & s_class_name
 
static const std::string s_template_for = "template_for"
 
static const std::string s_latency_monitoring = "latency_monitoring"
 
static const std::string s_subdetector_readout_map = "subdetector_readout_map"
 

Protected Member Functions

 MLTConf (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~MLTConf () noexcept
 
virtual void init (bool init_children)
 
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 
 MLTConf (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~MLTConf () noexcept
 
virtual void init (bool init_children)
 
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 
- Protected Member Functions inherited from dunedaq::conffwk::DalObject
 DalObject (DalRegistry &db, const ConfigObject &o) noexcept
 
virtual ~DalObject ()
 
void clear () noexcept
 
void check () const
 
bool is_deleted () const
 
void increment_created () noexcept
 
void increment_read () noexcept
 
void check_init () const
 Check and initialize object if necessary.
 
template<typename T >
void _set_object (const std::string &name, const T *value)
 Helper method for generated set single-value relationship methods.
 
template<typename T >
void _set_objects (const std::string &name, const std::vector< const T * > &value)
 Helper method for generated set multi-value relationship methods.
 
bool get_rel_objects (const std::string &name, bool upcast_unregistered, std::vector< const DalObject * > &objs) const
 Read relationship values as DAL objects using DAL factory.
 
bool get_algo_objects (const std::string &name, std::vector< const DalObject * > &objs) const
 Run algorithm and return result as DAL objects using DAL factory.
 

Private Attributes

std::string m_template_for
 
bool m_latency_monitoring
 
std::vector< const dunedaq::appmodel::SubdetectorReadoutWindowMap * > m_subdetector_readout_map
 

Friends

class conffwk::Configuration
 
class conffwk::DalObject
 
class conffwk::DalFactory
 
class conffwk::DalRegistry
 

Additional Inherited Members

- Protected Attributes inherited from dunedaq::conffwk::DalObject
std::mutex m_mutex
 Used to protect changes of DAL object.
 
bool p_was_read
 is true, if the object was read
 
DalRegistryp_registry
 Configuration object.
 
ConfigObject p_obj
 Config object used by given template object.
 
std::string p_UID
 Is used for template objects (see dqm_conffwk)
 

Detailed Description

Definition at line 29 of file MLTConf.hpp.

Constructor & Destructor Documentation

◆ MLTConf() [1/2]

dunedaq::appmodel::MLTConf::MLTConf ( conffwk::DalRegistry & db,
const conffwk::ConfigObject & obj )
protectednoexcept

Definition at line 31 of file MLTConf.cpp.

31 :
33 {
34 ;
35 }
The base class for any generated DAL object.
Definition DalObject.hpp:45

◆ ~MLTConf() [1/2]

dunedaq::appmodel::MLTConf::~MLTConf ( )
protectedvirtualnoexcept

Definition at line 81 of file MLTConf.cpp.

82 {
83 }

◆ MLTConf() [2/2]

dunedaq::appmodel::MLTConf::MLTConf ( conffwk::DalRegistry & db,
const conffwk::ConfigObject & obj )
protectednoexcept

◆ ~MLTConf() [2/2]

virtual dunedaq::appmodel::MLTConf::~MLTConf ( )
protectedvirtualnoexcept

Member Function Documentation

◆ __get_latency_monitoring_str() [1/2]

static const std::string & dunedaq::appmodel::MLTConf::__get_latency_monitoring_str ( )
inlinestaticnoexcept

Definition at line 93 of file MLTConf.hpp.

93{ return s_latency_monitoring; }
static const std::string s_latency_monitoring
Definition MLTConf.hpp:90

◆ __get_latency_monitoring_str() [2/2]

static const std::string & dunedaq::appmodel::MLTConf::__get_latency_monitoring_str ( )
inlinestaticnoexcept

Definition at line 93 of file MLTConf.hpp.

93{ return s_latency_monitoring; }

◆ __get_subdetector_readout_map_str() [1/2]

static const std::string & dunedaq::appmodel::MLTConf::__get_subdetector_readout_map_str ( )
inlinestaticnoexcept

Definition at line 164 of file MLTConf.hpp.

static const std::string s_subdetector_readout_map
Definition MLTConf.hpp:162

◆ __get_subdetector_readout_map_str() [2/2]

static const std::string & dunedaq::appmodel::MLTConf::__get_subdetector_readout_map_str ( )
inlinestaticnoexcept

Definition at line 164 of file MLTConf.hpp.

◆ __get_template_for_str() [1/2]

static const std::string & dunedaq::appmodel::MLTConf::__get_template_for_str ( )
inlinestaticnoexcept

Definition at line 92 of file MLTConf.hpp.

92{ return s_template_for; }
static const std::string s_template_for
Definition MLTConf.hpp:89

◆ __get_template_for_str() [2/2]

static const std::string & dunedaq::appmodel::MLTConf::__get_template_for_str ( )
inlinestaticnoexcept

Definition at line 92 of file MLTConf.hpp.

92{ return s_template_for; }

◆ get() [1/4]

std::vector< const dunedaq::conffwk::DalObject * > dunedaq::appmodel::MLTConf::get ( const std::string & name,
bool upcast_unregistered = true ) const
virtual

Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject pointers.

Parameters are:

Parameters
namename of the relationship or algorithm
Returns
value of relationship or result of algorithm
Exceptions
std::exceptionif there is no relationship or algorithm with such name in this and base classes

Implements dunedaq::conffwk::DalObject.

Definition at line 85 of file MLTConf.cpp.

86 {
87 std::vector<const dunedaq::conffwk::DalObject *> vec;
88
89 if (!get(name, vec, upcast_unregistered, true))
90 throw_get_ex(name, s_class_name, this);
91
92 return vec;
93 }
virtual std::vector< const dunedaq::conffwk::DalObject * > get(const std::string &name, bool upcast_unregistered=true) const
Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject...
Definition MLTConf.cpp:85
static const std::string & s_class_name
Definition MLTConf.hpp:46
static void throw_get_ex(const std::string &what, const std::string &class_name, const DalObject *obj)
throw exception in generated get method (i.e.
Definition DalObject.cpp:82

◆ get() [2/4]

virtual std::vector< const dunedaq::conffwk::DalObject * > dunedaq::appmodel::MLTConf::get ( const std::string & name,
bool upcast_unregistered = true ) const
virtual

Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject pointers.

Parameters are:

Parameters
namename of the relationship or algorithm
Returns
value of relationship or result of algorithm
Exceptions
std::exceptionif there is no relationship or algorithm with such name in this and base classes

Implements dunedaq::conffwk::DalObject.

◆ get() [3/4]

bool dunedaq::appmodel::MLTConf::get ( const std::string & name,
std::vector< const dunedaq::conffwk::DalObject * > & vec,
bool upcast_unregistered,
bool first_call ) const
protected

Definition at line 95 of file MLTConf.cpp.

96 {
97 if (first_call)
98 {
99 std::lock_guard scoped_lock(m_mutex);
100
101 check();
102 check_init();
103
104 if (get_rel_objects(name, upcast_unregistered, vec))
105 return true;
106 }
107
108 if (first_call)
109 return get_algo_objects(name, vec);
110
111 return false;
112 }
bool get_rel_objects(const std::string &name, bool upcast_unregistered, std::vector< const DalObject * > &objs) const
Read relationship values as DAL objects using DAL factory.
Definition DalObject.cpp:8
std::mutex m_mutex
Used to protect changes of DAL object.
bool get_algo_objects(const std::string &name, std::vector< const DalObject * > &objs) const
Run algorithm and return result as DAL objects using DAL factory.
Definition DalObject.cpp:25
void check_init() const
Check and initialize object if necessary.

◆ get() [4/4]

bool dunedaq::appmodel::MLTConf::get ( const std::string & name,
std::vector< const dunedaq::conffwk::DalObject * > & vec,
bool upcast_unregistered,
bool first_call ) const
protected

◆ get_latency_monitoring() [1/2]

bool dunedaq::appmodel::MLTConf::get_latency_monitoring ( ) const
inline

Get "latency_monitoring" attribute value. Should we monitor latency in Grafana?

Returns
the attribute value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 135 of file MLTConf.hpp.

136 {
137 std::lock_guard scoped_lock(m_mutex);
138 check();
139 check_init();
141 }

◆ get_latency_monitoring() [2/2]

bool dunedaq::appmodel::MLTConf::get_latency_monitoring ( ) const
inline

Get "latency_monitoring" attribute value. Should we monitor latency in Grafana?

Returns
the attribute value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 135 of file MLTConf.hpp.

136 {
137 std::lock_guard scoped_lock(m_mutex);
138 check();
139 check_init();
141 }

◆ get_subdetector_readout_map() [1/2]

const std::vector< const dunedaq::appmodel::SubdetectorReadoutWindowMap * > & dunedaq::appmodel::MLTConf::get_subdetector_readout_map ( ) const
inline

Get "subdetector_readout_map" relationship value. Optional detector readout map per sub-dector as defined in dunedaq::detdataformats::DetID::Subdetector.

Returns
the relationship value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 175 of file MLTConf.hpp.

176 {
177 std::lock_guard scoped_lock(m_mutex);
178 check();
179 check_init();
181 }
std::vector< const dunedaq::appmodel::SubdetectorReadoutWindowMap * > m_subdetector_readout_map
Definition MLTConf.hpp:82

◆ get_subdetector_readout_map() [2/2]

const std::vector< const dunedaq::appmodel::SubdetectorReadoutWindowMap * > & dunedaq::appmodel::MLTConf::get_subdetector_readout_map ( ) const
inline

Get "subdetector_readout_map" relationship value. Optional detector readout map per sub-dector as defined in dunedaq::detdataformats::DetID::Subdetector.

Returns
the relationship value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 175 of file MLTConf.hpp.

176 {
177 std::lock_guard scoped_lock(m_mutex);
178 check();
179 check_init();
181 }

◆ get_template_for() [1/2]

const std::string & dunedaq::appmodel::MLTConf::get_template_for ( ) const
inline

Get "template_for" attribute value.

Returns
the attribute value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 103 of file MLTConf.hpp.

104 {
105 std::lock_guard scoped_lock(m_mutex);
106 check();
107 check_init();
108 return m_template_for;
109 }

◆ get_template_for() [2/2]

const std::string & dunedaq::appmodel::MLTConf::get_template_for ( ) const
inline

Get "template_for" attribute value.

Returns
the attribute value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 103 of file MLTConf.hpp.

104 {
105 std::lock_guard scoped_lock(m_mutex);
106 check();
107 check_init();
108 return m_template_for;
109 }

◆ init() [1/2]

void dunedaq::appmodel::MLTConf::init ( bool init_children)
protectedvirtual

Initialize object (method generated by genconffwk)

Parameters
init_childrenif true, initialize referenced objects

Implements dunedaq::conffwk::DalObject.

Definition at line 65 of file MLTConf.cpp.

66 {
67 p_was_read = true;
69 TLOG_DEBUG(5) << "read object " << this << " (class " << s_class_name << ')';
70
71 try {
75 }
76 catch (dunedaq::conffwk::Exception & ex) {
77 throw_init_ex(ex);
78 }
79 }
void get(const std::string &name, T &value)
Get value of object's attribute or relationship.
void throw_init_ex(dunedaq::conffwk::Exception &ex)
throw object initialisation exception (i.e.
Definition DalObject.cpp:74
void increment_read() noexcept
DalRegistry & p_registry
Configuration object.
bool p_was_read
is true, if the object was read
ConfigObject p_obj
Config object used by given template object.
const T * _ref(ConfigObject &obj, const std::string &name, bool read_children)
Get signle value of object's relation and instantiate result with it (multi-thread safe).
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112

◆ init() [2/2]

virtual void dunedaq::appmodel::MLTConf::init ( bool init_children)
protectedvirtual

Initialize object (method generated by genconffwk)

Parameters
init_childrenif true, initialize referenced objects

Implements dunedaq::conffwk::DalObject.

◆ print() [1/2]

void dunedaq::appmodel::MLTConf::print ( unsigned int offset,
bool print_header,
std::ostream & s ) const
virtual

Print details of the MLTConf object.

Parameters are:

Parameters
offsetnumber of spaces to shift object right (useful to print nested objects)
print_headerif false, do not print object header (to print attributes of base classes)
soutput stream

Implements dunedaq::conffwk::DalObject.

Definition at line 38 of file MLTConf.cpp.

39 {
40 check_init();
41
42 try {
43 const std::string str(indent+2, ' ');
44
45 if (print_header)
46 p_hdr(s, indent, s_class_name, "dunedaq::appmodel");
47
48
49 // print direct attributes
50
53
54
55 // print direct relationships
56
58 }
59 catch (dunedaq::conffwk::Exception & ex) {
61 }
62 }
void p_hdr(std::ostream &s, unsigned int indent, const std::string &cl, const char *nm=nullptr) const
print object headers
Definition DalObject.cpp:65
static void p_error(std::ostream &s, dunedaq::conffwk::Exception &ex)
print error text
Definition DalObject.cpp:59
void p_mv_rel(std::ostream &s, const std::string &str, const std::string &name, const T &objs) noexcept
print weak multi-value relationship
void p_sv_attr(std::ostream &s, const std::string &str, const std::string &name, const T &val) noexcept
print single-value attribute

◆ print() [2/2]

virtual void dunedaq::appmodel::MLTConf::print ( unsigned int offset,
bool print_header,
std::ostream & s ) const
virtual

Print details of the MLTConf object.

Parameters are:

Parameters
offsetnumber of spaces to shift object right (useful to print nested objects)
print_headerif false, do not print object header (to print attributes of base classes)
soutput stream

Implements dunedaq::conffwk::DalObject.

◆ set_latency_monitoring() [1/2]

void dunedaq::appmodel::MLTConf::set_latency_monitoring ( bool value)
inline

Set "latency_monitoring" attribute value. Should we monitor latency in Grafana?

Parameters
valuenew attribute value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 151 of file MLTConf.hpp.

152 {
153 std::lock_guard scoped_lock(m_mutex);
154 check();
155 clear();
157 }
void set_by_val(const std::string &name, T value)
Set attribute value.

◆ set_latency_monitoring() [2/2]

void dunedaq::appmodel::MLTConf::set_latency_monitoring ( bool value)
inline

Set "latency_monitoring" attribute value. Should we monitor latency in Grafana?

Parameters
valuenew attribute value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 151 of file MLTConf.hpp.

152 {
153 std::lock_guard scoped_lock(m_mutex);
154 check();
155 clear();
157 }

◆ set_subdetector_readout_map() [1/2]

void dunedaq::appmodel::MLTConf::set_subdetector_readout_map ( const std::vector< const dunedaq::appmodel::SubdetectorReadoutWindowMap * > & value)

Set "subdetector_readout_map" relationship value. Optional detector readout map per sub-dector as defined in dunedaq::detdataformats::DetID::Subdetector.

Parameters
valuenew relationship value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 114 of file MLTConf.cpp.

115 {
117 }
void _set_objects(const std::string &name, const std::vector< const T * > &value)
Helper method for generated set multi-value relationship methods.

◆ set_subdetector_readout_map() [2/2]

void dunedaq::appmodel::MLTConf::set_subdetector_readout_map ( const std::vector< const dunedaq::appmodel::SubdetectorReadoutWindowMap * > & value)

Set "subdetector_readout_map" relationship value. Optional detector readout map per sub-dector as defined in dunedaq::detdataformats::DetID::Subdetector.

Parameters
valuenew relationship value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

◆ set_template_for() [1/2]

void dunedaq::appmodel::MLTConf::set_template_for ( const std::string & value)
inline

Set "template_for" attribute value.

Parameters
valuenew attribute value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 118 of file MLTConf.hpp.

119 {
120 std::lock_guard scoped_lock(m_mutex);
121 check();
122 clear();
124 }
void set_class(const std::string &name, const std::string &value)
Set attribute class value.

◆ set_template_for() [2/2]

void dunedaq::appmodel::MLTConf::set_template_for ( const std::string & value)
inline

Set "template_for" attribute value.

Parameters
valuenew attribute value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 118 of file MLTConf.hpp.

119 {
120 std::lock_guard scoped_lock(m_mutex);
121 check();
122 clear();
124 }

Friends And Related Symbol Documentation

◆ conffwk::Configuration

Definition at line 31 of file MLTConf.hpp.

◆ conffwk::DalFactory

conffwk::DalFactory
friend

Definition at line 33 of file MLTConf.hpp.

◆ conffwk::DalObject

Definition at line 32 of file MLTConf.hpp.

◆ conffwk::DalRegistry

Definition at line 34 of file MLTConf.hpp.

Member Data Documentation

◆ m_latency_monitoring

bool dunedaq::appmodel::MLTConf::m_latency_monitoring
private

Definition at line 81 of file MLTConf.hpp.

◆ m_subdetector_readout_map

std::vector< const dunedaq::appmodel::SubdetectorReadoutWindowMap * > dunedaq::appmodel::MLTConf::m_subdetector_readout_map
private

Definition at line 82 of file MLTConf.hpp.

◆ m_template_for

std::string dunedaq::appmodel::MLTConf::m_template_for
private

Definition at line 80 of file MLTConf.hpp.

◆ s_class_name

static const std::string & dunedaq::appmodel::MLTConf::s_class_name
static

The name of the configuration class.

Definition at line 46 of file MLTConf.hpp.

◆ s_latency_monitoring

static const std::string dunedaq::appmodel::MLTConf::s_latency_monitoring = "latency_monitoring"
inlinestatic

Definition at line 90 of file MLTConf.hpp.

◆ s_subdetector_readout_map

static const std::string dunedaq::appmodel::MLTConf::s_subdetector_readout_map = "subdetector_readout_map"
inlinestatic

Definition at line 162 of file MLTConf.hpp.

◆ s_template_for

static const std::string dunedaq::appmodel::MLTConf::s_template_for = "template_for"
inlinestatic

Definition at line 89 of file MLTConf.hpp.


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