DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
Segment.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _Segment_0_dunedaq__confmodel_0_confmodel_H_
4#define _Segment_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 RCApplication;
26 }
27}
28
29
30namespace dunedaq {
31 namespace confmodel {
32
38
39 friend class conffwk::Configuration;
40 friend class conffwk::DalObject;
41 friend class conffwk::DalFactory;
42 friend class conffwk::DalRegistry;
43
44 protected:
45
47 virtual ~Segment() noexcept;
48 virtual void init(bool init_children);
49
50 public:
51
54 static const std::string& s_class_name;
55
56
66 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
67
68
78 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
79
80
81 protected:
82
83 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
84
85
86 private:
87
88 std::vector<const dunedaq::confmodel::Segment*> m_segments;
91
92
93 public:
94
95 // relationship names
96
97 inline static const std::string s_segments = "segments";
98 inline static const std::string s_applications = "applications";
99 inline static const std::string s_controller = "controller";
100
101 static const std::string& __get_segments_str() noexcept { return s_segments; }
102 static const std::string& __get_applications_str() noexcept { return s_applications; }
103 static const std::string& __get_controller_str() noexcept { return s_controller; }
104
105
113 const std::vector<const dunedaq::confmodel::Segment*>&
115 {
116 std::lock_guard scoped_lock(m_mutex);
117 check();
118 check_init();
119 return m_segments;
120 }
121
122
130 void
131 set_segments(const std::vector<const dunedaq::confmodel::Segment*>& value);
132
140 const std::vector<const dunedaq::confmodel::Application*>&
142 {
143 std::lock_guard scoped_lock(m_mutex);
144 check();
145 check_init();
146 return m_applications;
147 }
148
149
157 void
158 set_applications(const std::vector<const dunedaq::confmodel::Application*>& value);
159
169 {
170 std::lock_guard scoped_lock(m_mutex);
171 check();
172 check_init();
173 if (!m_controller)
174 {
175 std::ostringstream text;
176 text << "relationship \"" << s_controller << "\" of object " << this << " is not set";
177 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
178 }
179 return m_controller;
180 }
181
182
190 void
192
193 };
194
195 // out stream operator
196
197 inline std::ostream& operator<<(std::ostream& s, const Segment& obj)
198 {
199 return obj.print_object(s);
200 }
201
202 typedef std::vector<const Segment*>::const_iterator SegmentIterator;
203
204 }
205}
206
207#endif
#define ERS_HERE
The base class for any generated DAL object.
Definition DalObject.hpp:45
std::mutex m_mutex
Used to protect changes of DAL 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.
void set_controller(const dunedaq::confmodel::RCApplication *value)
Set "controller" relationship value. This Segment's run controller.
std::vector< const dunedaq::confmodel::Segment * > m_segments
Definition Segment.hpp:88
const std::vector< const dunedaq::confmodel::Segment * > & get_segments() const
Get "segments" relationship value. Nested list of Segments that form part of this Segment.
Definition Segment.hpp:114
static const std::string & __get_applications_str() noexcept
Definition Segment.hpp:102
const std::vector< const dunedaq::confmodel::Application * > & get_applications() const
Get "applications" relationship value. List of Applications that run in this Segment.
Definition Segment.hpp:141
static const std::string s_controller
Definition Segment.hpp:99
Segment(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
virtual void init(bool init_children)
Definition Segment.cpp:70
friend class conffwk::DalFactory
Definition Segment.hpp:41
virtual ~Segment() noexcept
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 Segment.cpp:90
const dunedaq::confmodel::RCApplication * get_controller() const
Get "controller" relationship value. This Segment's run controller.
Definition Segment.hpp:168
void set_segments(const std::vector< const dunedaq::confmodel::Segment * > &value)
Set "segments" relationship value. Nested list of Segments that form part of this Segment.
static const std::string & s_class_name
Definition Segment.hpp:54
friend class conffwk::DalObject
Definition Segment.hpp:40
const dunedaq::confmodel::RCApplication * m_controller
Definition Segment.hpp:90
static const std::string s_segments
Definition Segment.hpp:97
static const std::string s_applications
Definition Segment.hpp:98
static const std::string & __get_controller_str() noexcept
Definition Segment.hpp:103
static const std::string & __get_segments_str() noexcept
Definition Segment.hpp:101
std::vector< const dunedaq::confmodel::Application * > m_applications
Definition Segment.hpp:89
void set_applications(const std::vector< const dunedaq::confmodel::Application * > &value)
Set "applications" relationship value. List of Applications that run in this Segment.
conffwk entry point
double offset
std::vector< constSegment * >::const_iterator SegmentIterator
Definition Segment.hpp:202
std::ostream & operator<<(std::ostream &s, const ActionPlan &obj)
Including Qt Headers.