DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
Session.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _Session_0_dunedaq__confmodel_0_confmodel_H_
4#define _Session_0_dunedaq__confmodel_0_confmodel_H_
5
6#include <stdint.h> // to define 64 bits types
7#include <iostream>
8#include <sstream>
9#include <string>
10#include <map>
11#include <vector>
12
14#include "conffwk/DalObject.hpp"
15
16
17 // forward declaration for classes used in relationships and algorithms
18
19namespace dunedaq {
20 namespace confmodel {
21 class Application;
22 class Component;
23 class ConnectivityService;
24 class DetectorConfig;
25 class OpMonURI;
26 class ResourceBase;
27 class Segment;
28 class VariableBase;
29 }
30}
31
32
33 // prologue of method Session::set_disabled()
34
36
37namespace dunedaq {
38 namespace confmodel {
39
40 class Session : public virtual dunedaq::conffwk::DalObject {
41
42 friend class conffwk::Configuration;
43 friend class conffwk::DalObject;
44 friend class conffwk::DalFactory;
45 friend class conffwk::DalRegistry;
46
47 protected:
48
50 virtual ~Session() noexcept;
51 virtual void init(bool init_children);
52
53 public:
54
57 static const std::string& s_class_name;
58
59
69 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
70
71
81 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
82
83
84 protected:
85
86 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
87
88
89 private:
90
91 std::string m_description;
94 std::string m_rte_script;
96 std::string m_log_path;
104
105 // extension of method Session::set_disabled()
106 friend class DisabledComponents;
107 friend class Component;
109
110
111 public:
112
113 // attribute names
114
115 inline static const std::string s_description = "description";
116 inline static const std::string s_data_request_timeout_ms = "data_request_timeout_ms";
117 inline static const std::string s_data_rate_slowdown_factor = "data_rate_slowdown_factor";
118 inline static const std::string s_rte_script = "rte_script";
119 inline static const std::string s_controller_log_level = "controller_log_level";
120 inline static const std::string s_log_path = "log_path";
121
122 static const std::string& __get_description_str() noexcept { return s_description; }
123 static const std::string& __get_data_request_timeout_ms_str() noexcept { return s_data_request_timeout_ms; }
124 static const std::string& __get_data_rate_slowdown_factor_str() noexcept { return s_data_rate_slowdown_factor; }
125 static const std::string& __get_rte_script_str() noexcept { return s_rte_script; }
126 static const std::string& __get_controller_log_level_str() noexcept { return s_controller_log_level; }
127 static const std::string& __get_log_path_str() noexcept { return s_log_path; }
128
129
137 const std::string&
139 {
140 std::lock_guard scoped_lock(m_mutex);
141 check();
142 check_init();
143 return m_description;
144 }
145
153 void
154 set_description(const std::string& value)
155 {
156 std::lock_guard scoped_lock(m_mutex);
157 check();
158 clear();
160 }
161
162
170 uint32_t
172 {
173 std::lock_guard scoped_lock(m_mutex);
174 check();
175 check_init();
177 }
178
186 void
188 {
189 std::lock_guard scoped_lock(m_mutex);
190 check();
191 clear();
193 }
194
195
203 uint32_t
205 {
206 std::lock_guard scoped_lock(m_mutex);
207 check();
208 check_init();
210 }
211
219 void
221 {
222 std::lock_guard scoped_lock(m_mutex);
223 check();
224 clear();
226 }
227
228
236 const std::string&
238 {
239 std::lock_guard scoped_lock(m_mutex);
240 check();
241 check_init();
242 return m_rte_script;
243 }
244
252 void
253 set_rte_script(const std::string& value)
254 {
255 std::lock_guard scoped_lock(m_mutex);
256 check();
257 clear();
259 }
260
261
267 inline static const std::string CRITICAL = "CRITICAL";
268 inline static const std::string ERROR = "ERROR";
269 inline static const std::string WARNING = "WARNING";
270 inline static const std::string INFO = "INFO";
271 inline static const std::string DEBUG = "DEBUG";
272 };
273
281 const std::string&
283 {
284 std::lock_guard scoped_lock(m_mutex);
285 check();
286 check_init();
288 }
289
297 void
298 set_controller_log_level(const std::string& value)
299 {
300 std::lock_guard scoped_lock(m_mutex);
301 check();
302 clear();
304 }
305
306
314 const std::string&
316 {
317 std::lock_guard scoped_lock(m_mutex);
318 check();
319 check_init();
320 return m_log_path;
321 }
322
330 void
331 set_log_path(const std::string& value)
332 {
333 std::lock_guard scoped_lock(m_mutex);
334 check();
335 clear();
337 }
338
339
340 // relationship names
341
342 inline static const std::string s_connectivity_service = "connectivity_service";
343 inline static const std::string s_environment = "environment";
344 inline static const std::string s_disabled = "disabled";
345 inline static const std::string s_segment = "segment";
346 inline static const std::string s_infrastructure_applications = "infrastructure_applications";
347 inline static const std::string s_detector_configuration = "detector_configuration";
348 inline static const std::string s_opmon_uri = "opmon_uri";
349
350 static const std::string& __get_connectivity_service_str() noexcept { return s_connectivity_service; }
351 static const std::string& __get_environment_str() noexcept { return s_environment; }
352 static const std::string& __get_disabled_str() noexcept { return s_disabled; }
353 static const std::string& __get_segment_str() noexcept { return s_segment; }
354 static const std::string& __get_infrastructure_applications_str() noexcept { return s_infrastructure_applications; }
355 static const std::string& __get_detector_configuration_str() noexcept { return s_detector_configuration; }
356 static const std::string& __get_opmon_uri_str() noexcept { return s_opmon_uri; }
357
358
368 {
369 std::lock_guard scoped_lock(m_mutex);
370 check();
371 check_init();
373 }
374
375
383 void
385
393 const std::vector<const dunedaq::confmodel::VariableBase*>&
395 {
396 std::lock_guard scoped_lock(m_mutex);
397 check();
398 check_init();
399 return m_environment;
400 }
401
402
410 void
411 set_environment(const std::vector<const dunedaq::confmodel::VariableBase*>& value);
412
420 const std::vector<const dunedaq::confmodel::ResourceBase*>&
422 {
423 std::lock_guard scoped_lock(m_mutex);
424 check();
425 check_init();
426 return m_disabled;
427 }
428
429
437 void
438 set_disabled(const std::vector<const dunedaq::confmodel::ResourceBase*>& value);
439
449 {
450 std::lock_guard scoped_lock(m_mutex);
451 check();
452 check_init();
453 if (!m_segment)
454 {
455 std::ostringstream text;
456 text << "relationship \"" << s_segment << "\" of object " << this << " is not set";
457 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
458 }
459 return m_segment;
460 }
461
462
470 void
472
479 const std::vector<const dunedaq::confmodel::Application*>&
481 {
482 std::lock_guard scoped_lock(m_mutex);
483 check();
484 check_init();
486 }
487
488
495 void
496 set_infrastructure_applications(const std::vector<const dunedaq::confmodel::Application*>& value);
497
506 {
507 std::lock_guard scoped_lock(m_mutex);
508 check();
509 check_init();
511 {
512 std::ostringstream text;
513 text << "relationship \"" << s_detector_configuration << "\" of object " << this << " is not set";
514 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
515 }
517 }
518
519
526 void
528
538 {
539 std::lock_guard scoped_lock(m_mutex);
540 check();
541 check_init();
542 if (!m_opmon_uri)
543 {
544 std::ostringstream text;
545 text << "relationship \"" << s_opmon_uri << "\" of object " << this << " is not set";
546 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
547 }
548 return m_opmon_uri;
549 }
550
551
559 void
561
562
563 public:
564
565 // user-defined algorithms
566
571 std::vector<const dunedaq::confmodel::Application *> get_all_applications() const;
572
573
578 std::vector<const dunedaq::confmodel::Application *> get_enabled_applications() const;
579
580
585 void set_disabled(const std::set<const dunedaq::confmodel::Component *>& objs) const;
586
587
592 void set_enabled(const std::set<const dunedaq::confmodel::Component *>& objs) const;
593 };
594
595 // out stream operator
596
597 inline std::ostream& operator<<(std::ostream& s, const Session& obj)
598 {
599 return obj.print_object(s);
600 }
601
602 typedef std::vector<const Session*>::const_iterator SessionIterator;
603
604 }
605}
606
607#endif
#define ERS_HERE
void set_by_val(const std::string &name, T value)
Set attribute value.
void set_by_ref(const std::string &name, T &value)
Set attribute value.
void set_enum(const std::string &name, const std::string &value)
Set attribute enumeration value.
The base class for any generated DAL object.
Definition DalObject.hpp:45
std::mutex m_mutex
Used to protect changes of DAL object.
ConfigObject p_obj
Config object used by given template object.
void check_init() const
Check and initialize object if necessary.
DalRegistry: A registry of DalObjects It provides a single interface to create, cache and manage DalO...
Generic configuration exception.
std::string m_controller_log_level
Definition Session.hpp:95
static const std::string & __get_connectivity_service_str() noexcept
Definition Session.hpp:350
static const std::string s_connectivity_service
Definition Session.hpp:342
std::vector< const dunedaq::confmodel::Application * > get_enabled_applications() const
std::vector< const dunedaq::confmodel::ResourceBase * > m_disabled
Definition Session.hpp:99
void set_segment(const dunedaq::confmodel::Segment *value)
Set "segment" relationship value. List of configuration Segments that form this Session.
void set_rte_script(const std::string &value)
Set "rte_script" attribute value. Path to a script for setting up the runtime environment for DAQ app...
Definition Session.hpp:253
const dunedaq::confmodel::OpMonURI * m_opmon_uri
Definition Session.hpp:103
void set_controller_log_level(const std::string &value)
Set "controller_log_level" attribute value. Log level to use for drunc controllers.
Definition Session.hpp:298
const dunedaq::confmodel::DetectorConfig * m_detector_configuration
Definition Session.hpp:102
void set_detector_configuration(const dunedaq::confmodel::DetectorConfig *value)
Set "detector_configuration" relationship value.
static const std::string & __get_rte_script_str() noexcept
Definition Session.hpp:125
void set_enabled(const std::set< const dunedaq::confmodel::Component * > &objs) const
std::vector< const dunedaq::confmodel::Application * > m_infrastructure_applications
Definition Session.hpp:101
void set_disabled(const std::vector< const dunedaq::confmodel::ResourceBase * > &value)
Set "disabled" relationship value. Resources that should not participate in the current run.
static const std::string & __get_log_path_str() noexcept
Definition Session.hpp:127
static const std::string & __get_segment_str() noexcept
Definition Session.hpp:353
static const std::string s_data_request_timeout_ms
Definition Session.hpp:116
void set_environment(const std::vector< const dunedaq::confmodel::VariableBase * > &value)
Set "environment" relationship value. Define process environment for any application run in given ses...
dunedaq::confmodel::DisabledComponents m_disabled_components
Definition Session.hpp:108
const std::vector< const dunedaq::confmodel::Application * > & get_infrastructure_applications() const
Get "infrastructure_applications" relationship value.
Definition Session.hpp:480
static const std::string & __get_disabled_str() noexcept
Definition Session.hpp:352
static const std::string & __get_detector_configuration_str() noexcept
Definition Session.hpp:355
uint32_t get_data_rate_slowdown_factor() const
Get "data_rate_slowdown_factor" attribute value. "Factor by which to suppress data generation.
Definition Session.hpp:204
static const std::string s_rte_script
Definition Session.hpp:118
friend class conffwk::DalFactory
Definition Session.hpp:44
void set_data_request_timeout_ms(uint32_t value)
Set "data_request_timeout_ms" attribute value. The baseline data request timeout that will be used by...
Definition Session.hpp:187
static const std::string & __get_data_request_timeout_ms_str() noexcept
Definition Session.hpp:123
static const std::string s_data_rate_slowdown_factor
Definition Session.hpp:117
Session(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
const dunedaq::confmodel::Segment * get_segment() const
Get "segment" relationship value. List of configuration Segments that form this Session.
Definition Session.hpp:448
const std::string & get_description() const
Get "description" attribute value. A description of the session.
Definition Session.hpp:138
void set_infrastructure_applications(const std::vector< const dunedaq::confmodel::Application * > &value)
Set "infrastructure_applications" relationship value.
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 Session.cpp:117
uint32_t get_data_request_timeout_ms() const
Get "data_request_timeout_ms" attribute value. The baseline data request timeout that will be used by...
Definition Session.hpp:171
static const std::string & __get_infrastructure_applications_str() noexcept
Definition Session.hpp:354
static const std::string & __get_opmon_uri_str() noexcept
Definition Session.hpp:356
static const std::string & __get_environment_str() noexcept
Definition Session.hpp:351
std::vector< const dunedaq::confmodel::VariableBase * > m_environment
Definition Session.hpp:98
friend class conffwk::DalObject
Definition Session.hpp:43
void set_opmon_uri(const dunedaq::confmodel::OpMonURI *value)
Set "opmon_uri" relationship value. Configuration for the OpMon facilities used across the session.
static const std::string s_infrastructure_applications
Definition Session.hpp:346
void set_disabled(const std::set< const dunedaq::confmodel::Component * > &objs) const
static const std::string s_description
Definition Session.hpp:115
const dunedaq::confmodel::DetectorConfig * get_detector_configuration() const
Get "detector_configuration" relationship value.
Definition Session.hpp:505
static const std::string s_segment
Definition Session.hpp:345
static const std::string s_disabled
Definition Session.hpp:344
virtual void init(bool init_children)
Definition Session.cpp:87
static const std::string & __get_data_rate_slowdown_factor_str() noexcept
Definition Session.hpp:124
void set_connectivity_service(const dunedaq::confmodel::ConnectivityService *value)
Set "connectivity_service" relationship value. Configuration for the Connectivity Service lookups.
const std::string & get_controller_log_level() const
Get "controller_log_level" attribute value. Log level to use for drunc controllers.
Definition Session.hpp:282
const dunedaq::confmodel::Segment * m_segment
Definition Session.hpp:100
static const std::string s_log_path
Definition Session.hpp:120
const std::vector< const dunedaq::confmodel::ResourceBase * > & get_disabled() const
Get "disabled" relationship value. Resources that should not participate in the current run.
Definition Session.hpp:421
static const std::string s_controller_log_level
Definition Session.hpp:119
static const std::string & __get_controller_log_level_str() noexcept
Definition Session.hpp:126
static const std::string s_environment
Definition Session.hpp:343
const std::vector< const dunedaq::confmodel::VariableBase * > & get_environment() const
Get "environment" relationship value. Define process environment for any application run in given ses...
Definition Session.hpp:394
const dunedaq::confmodel::ConnectivityService * m_connectivity_service
Definition Session.hpp:97
static const std::string s_opmon_uri
Definition Session.hpp:348
static const std::string & s_class_name
Definition Session.hpp:57
void set_data_rate_slowdown_factor(uint32_t value)
Set "data_rate_slowdown_factor" attribute value. "Factor by which to suppress data generation.
Definition Session.hpp:220
void set_description(const std::string &value)
Set "description" attribute value. A description of the session.
Definition Session.hpp:154
void set_log_path(const std::string &value)
Set "log_path" attribute value. Where the applications, controllers and infrastructure applications s...
Definition Session.hpp:331
const dunedaq::confmodel::ConnectivityService * get_connectivity_service() const
Get "connectivity_service" relationship value. Configuration for the Connectivity Service lookups.
Definition Session.hpp:367
static const std::string & __get_description_str() noexcept
Definition Session.hpp:122
static const std::string s_detector_configuration
Definition Session.hpp:347
const dunedaq::confmodel::OpMonURI * get_opmon_uri() const
Get "opmon_uri" relationship value. Configuration for the OpMon facilities used across the session.
Definition Session.hpp:537
uint32_t m_data_rate_slowdown_factor
Definition Session.hpp:93
const std::string & get_log_path() const
Get "log_path" attribute value. Where the applications, controllers and infrastructure applications s...
Definition Session.hpp:315
std::vector< const dunedaq::confmodel::Application * > get_all_applications() const
virtual ~Session() noexcept
const std::string & get_rte_script() const
Get "rte_script" attribute value. Path to a script for setting up the runtime environment for DAQ app...
Definition Session.hpp:237
conffwk entry point
double offset
std::vector< constSession * >::const_iterator SessionIterator
Definition Session.hpp:602
std::ostream & operator<<(std::ostream &s, const ActionPlan &obj)
Including Qt Headers.