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 // include files for classes used in inheritance hierarchy
17
19
20 // forward declaration for classes used in relationships and algorithms
21
22namespace dunedaq {
23 namespace confmodel {
24 class Application;
25 class ConnectivityService;
26 class DetectorConfig;
27 class OpMonURI;
28 class ResourceSet;
29 class Segment;
30 class VariableBase;
31 }
32}
33
34
35 // prologue of method Session::all_applications()
36
37namespace dunedaq::confmodel{class Segment;}
38
39namespace dunedaq {
40 namespace confmodel {
41
42 class Session : public dunedaq::confmodel::ResourceTree {
43
45 friend class conffwk::DalObject;
46 friend class conffwk::DalFactory;
48
49 protected:
50
52 virtual ~Session() noexcept;
53 virtual void init(bool init_children);
54
55 public:
56
59 static const std::string& s_class_name;
60
61
71 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
72
73
83 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
84
85
86 protected:
87
88 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
89
90
91 private:
92
98 std::string m_log_path;
105
106 // extension of method Session::all_applications()
107 friend class DisabledResources;
108 std::vector<const Application*>getSegmentApps(const Segment*,bool)const;
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
266 struct Controller_log_level {
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_segment = "segment";
345 inline static const std::string s_infrastructure_applications = "infrastructure_applications";
346 inline static const std::string s_detector_configuration = "detector_configuration";
347 inline static const std::string s_opmon_uri = "opmon_uri";
348
349 static const std::string& __get_connectivity_service_str() noexcept { return s_connectivity_service; }
350 static const std::string& __get_environment_str() noexcept { return s_environment; }
351 static const std::string& __get_segment_str() noexcept { return s_segment; }
352 static const std::string& __get_infrastructure_applications_str() noexcept { return s_infrastructure_applications; }
353 static const std::string& __get_detector_configuration_str() noexcept { return s_detector_configuration; }
354 static const std::string& __get_opmon_uri_str() noexcept { return s_opmon_uri; }
355
356
366 {
367 std::lock_guard scoped_lock(m_mutex);
368 check();
369 check_init();
371 }
372
373
381 void
383
391 const std::vector<const dunedaq::confmodel::VariableBase*>&
393 {
394 std::lock_guard scoped_lock(m_mutex);
395 check();
396 check_init();
397 return m_environment;
398 }
399
400
408 void
409 set_environment(const std::vector<const dunedaq::confmodel::VariableBase*>& value);
410
420 {
421 std::lock_guard scoped_lock(m_mutex);
422 check();
423 check_init();
424 if (!m_segment)
425 {
426 std::ostringstream text;
427 text << "relationship \"" << s_segment << "\" of object " << this << " is not set";
428 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
429 }
430 return m_segment;
431 }
432
433
441 void
443
450 const std::vector<const dunedaq::confmodel::Application*>&
452 {
453 std::lock_guard scoped_lock(m_mutex);
454 check();
455 check_init();
457 }
458
459
466 void
467 set_infrastructure_applications(const std::vector<const dunedaq::confmodel::Application*>& value);
468
477 {
478 std::lock_guard scoped_lock(m_mutex);
479 check();
480 check_init();
482 {
483 std::ostringstream text;
484 text << "relationship \"" << s_detector_configuration << "\" of object " << this << " is not set";
485 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
486 }
488 }
489
490
497 void
499
509 {
510 std::lock_guard scoped_lock(m_mutex);
511 check();
512 check_init();
513 if (!m_opmon_uri)
514 {
515 std::ostringstream text;
516 text << "relationship \"" << s_opmon_uri << "\" of object " << this << " is not set";
517 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
518 }
519 return m_opmon_uri;
520 }
521
522
530 void
532
533
534 public:
535
536 // user-defined algorithms
537
542 std::vector<const dunedaq::confmodel::Application *> all_applications() const;
543
544
549 std::vector<const dunedaq::confmodel::Application *> enabled_applications() const;
550
551
552 const ResourceSet* resource_root() const override;
553 };
554
555 // out stream operator
556
557 inline std::ostream& operator<<(std::ostream& s, const Session& obj)
558 {
559 return obj.print_object(s);
560 }
561
562 typedef std::vector<const Session*>::const_iterator SessionIterator;
563
564 }
565}
566
567#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:97
std::vector< const dunedaq::confmodel::Application * > enabled_applications() const
static const std::string & __get_connectivity_service_str() noexcept
Definition Session.hpp:349
static const std::string s_connectivity_service
Definition Session.hpp:342
void set_segment(const dunedaq::confmodel::Segment *value)
Set "segment" relationship value. List of configuration Segments that form this Session.
Definition Session.cpp:160
virtual ~Session() noexcept
Definition Session.cpp:115
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:104
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:103
void set_detector_configuration(const dunedaq::confmodel::DetectorConfig *value)
Set "detector_configuration" relationship value.
Definition Session.cpp:170
static const std::string & __get_rte_script_str() noexcept
Definition Session.hpp:125
std::vector< const dunedaq::confmodel::Application * > m_infrastructure_applications
Definition Session.hpp:102
static const std::string & __get_log_path_str() noexcept
Definition Session.hpp:127
static const std::string & __get_segment_str() noexcept
Definition Session.hpp:351
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...
Definition Session.cpp:155
const std::vector< const dunedaq::confmodel::Application * > & get_infrastructure_applications() const
Get "infrastructure_applications" relationship value.
Definition Session.hpp:451
static const std::string & __get_detector_configuration_str() noexcept
Definition Session.hpp:353
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:46
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
Definition Session.cpp:36
const dunedaq::confmodel::Segment * get_segment() const
Get "segment" relationship value. List of configuration Segments that form this Session.
Definition Session.hpp:419
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.
Definition Session.cpp:165
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:119
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:352
static const std::string & __get_opmon_uri_str() noexcept
Definition Session.hpp:354
static const std::string & __get_environment_str() noexcept
Definition Session.hpp:350
std::vector< const dunedaq::confmodel::Application * > all_applications() const
std::vector< const dunedaq::confmodel::VariableBase * > m_environment
Definition Session.hpp:100
friend class conffwk::DalObject
Definition Session.hpp:45
std::vector< const Application * > getSegmentApps(const Segment *, bool) const
void set_opmon_uri(const dunedaq::confmodel::OpMonURI *value)
Set "opmon_uri" relationship value. Configuration for the OpMon facilities used across the session.
Definition Session.cpp:175
static const std::string s_infrastructure_applications
Definition Session.hpp:345
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:476
static const std::string s_segment
Definition Session.hpp:344
virtual void init(bool init_children)
Definition Session.cpp:90
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.
Definition Session.cpp:150
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:101
static const std::string s_log_path
Definition Session.hpp:120
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:392
const ResourceSet * resource_root() const override
Definition Session.cpp:182
const dunedaq::confmodel::ConnectivityService * m_connectivity_service
Definition Session.hpp:99
static const std::string s_opmon_uri
Definition Session.hpp:347
static const std::string & s_class_name
Definition Session.hpp:59
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:365
static const std::string & __get_description_str() noexcept
Definition Session.hpp:122
static const std::string s_detector_configuration
Definition Session.hpp:346
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:508
uint32_t m_data_rate_slowdown_factor
Definition Session.hpp:95
const std::string & get_log_path() const
Get "log_path" attribute value. Where the applications, controllers and infrastructure applications s...
Definition Session.hpp:315
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:562
std::ostream & operator<<(std::ostream &s, const ActionPlan &obj)
The DUNE-DAQ namespace.
Definition DataStore.hpp:57
msgpack::object obj