DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
CIBConf.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _CIBConf_0_dunedaq__appmodel_0_appmodel_H_
4#define _CIBConf_0_dunedaq__appmodel_0_appmodel_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 appmodel {
21 class CIBCalibrationStream;
22 class CIBTrigger;
23 class CIBTriggerReport;
24 }
25}
26
27
28namespace dunedaq {
29 namespace appmodel {
30
35 class CIBConf : public virtual dunedaq::conffwk::DalObject {
36
37 friend class conffwk::Configuration;
38 friend class conffwk::DalObject;
39 friend class conffwk::DalFactory;
40 friend class conffwk::DalRegistry;
41
42 protected:
43
45 virtual ~CIBConf() noexcept;
46 virtual void init(bool init_children);
47
48 public:
49
52 static const std::string& s_class_name;
53
54
64 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
65
66
76 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
77
78
79 protected:
80
81 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
82
83
84 private:
85
86 std::string m_cib_host;
87 uint16_t m_cib_port;
89 uint32_t m_trigger_bit;
91 const dunedaq::appmodel::CIBTrigger* m_cib_trigger;
93
94
95 public:
96
97 // attribute names
98
99 inline static const std::string s_cib_host = "cib_host";
100 inline static const std::string s_cib_port = "cib_port";
101 inline static const std::string s_connection_timeout_ms = "connection_timeout_ms";
102 inline static const std::string s_trigger_bit = "trigger_bit";
103
104 static const std::string& __get_cib_host_str() noexcept { return s_cib_host; }
105 static const std::string& __get_cib_port_str() noexcept { return s_cib_port; }
106 static const std::string& __get_connection_timeout_ms_str() noexcept { return s_connection_timeout_ms; }
107 static const std::string& __get_trigger_bit_str() noexcept { return s_trigger_bit; }
108
109
117 const std::string&
119 {
120 std::lock_guard scoped_lock(m_mutex);
121 check();
122 check_init();
123 return m_cib_host;
124 }
125
133 void
134 set_cib_host(const std::string& value)
135 {
136 std::lock_guard scoped_lock(m_mutex);
137 check();
138 clear();
140 }
141
142
150 uint16_t
152 {
153 std::lock_guard scoped_lock(m_mutex);
154 check();
155 check_init();
156 return m_cib_port;
157 }
158
166 void
167 set_cib_port(uint16_t value)
168 {
169 std::lock_guard scoped_lock(m_mutex);
170 check();
171 clear();
173 }
174
175
183 uint16_t
185 {
186 std::lock_guard scoped_lock(m_mutex);
187 check();
188 check_init();
190 }
191
199 void
201 {
202 std::lock_guard scoped_lock(m_mutex);
203 check();
204 clear();
206 }
207
208
216 uint32_t
218 {
219 std::lock_guard scoped_lock(m_mutex);
220 check();
221 check_init();
222 return m_trigger_bit;
223 }
224
232 void
233 set_trigger_bit(uint32_t value)
234 {
235 std::lock_guard scoped_lock(m_mutex);
236 check();
237 clear();
239 }
240
241
242 // relationship names
243
244 inline static const std::string s_calibration_stream = "calibration_stream";
245 inline static const std::string s_cib_trigger = "cib_trigger";
246 inline static const std::string s_trigger_report = "trigger_report";
247
248 static const std::string& __get_calibration_stream_str() noexcept { return s_calibration_stream; }
249 static const std::string& __get_cib_trigger_str() noexcept { return s_cib_trigger; }
250 static const std::string& __get_trigger_report_str() noexcept { return s_trigger_report; }
251
252
261 {
262 std::lock_guard scoped_lock(m_mutex);
263 check();
264 check_init();
266 }
267
268
275 void
277
286 {
287 std::lock_guard scoped_lock(m_mutex);
288 check();
289 check_init();
290 if (!m_cib_trigger)
291 {
292 std::ostringstream text;
293 text << "relationship \"" << s_cib_trigger << "\" of object " << this << " is not set";
294 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
295 }
296 return m_cib_trigger;
297 }
298
299
306 void
308
317 {
318 std::lock_guard scoped_lock(m_mutex);
319 check();
320 check_init();
321 return m_trigger_report;
322 }
323
324
331 void
333
334 };
335
336 // out stream operator
337
338 inline std::ostream& operator<<(std::ostream& s, const CIBConf& obj)
339 {
340 return obj.print_object(s);
341 }
342
343 typedef std::vector<const CIBConf*>::const_iterator CIBConfIterator;
344
345 }
346}
347
348#endif
#define ERS_HERE
static const std::string & __get_calibration_stream_str() noexcept
Definition CIBConf.hpp:248
virtual void init(bool init_children)
Definition CIBConf.cpp:75
static const std::string & __get_cib_host_str() noexcept
Definition CIBConf.hpp:104
static const std::string s_cib_host
Definition CIBConf.hpp:99
void set_cib_trigger(const dunedaq::appmodel::CIBTrigger *value)
Set "cib_trigger" relationship value.
void set_cib_host(const std::string &value)
Set "cib_host" attribute value. IP address of the board.
Definition CIBConf.hpp:134
const dunedaq::appmodel::CIBTriggerReport * m_trigger_report
Definition CIBConf.hpp:92
static const std::string & __get_cib_trigger_str() noexcept
Definition CIBConf.hpp:249
static const std::string s_cib_trigger
Definition CIBConf.hpp:245
static const std::string & __get_connection_timeout_ms_str() noexcept
Definition CIBConf.hpp:106
CIBConf(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
virtual ~CIBConf() noexcept
static const std::string & s_class_name
Definition CIBConf.hpp:52
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 CIBConf.cpp:99
const dunedaq::appmodel::CIBTriggerReport * get_trigger_report() const
Get "trigger_report" relationship value.
Definition CIBConf.hpp:316
static const std::string s_trigger_report
Definition CIBConf.hpp:246
static const std::string s_connection_timeout_ms
Definition CIBConf.hpp:101
friend class conffwk::DalFactory
Definition CIBConf.hpp:39
const dunedaq::appmodel::CIBTrigger * get_cib_trigger() const
Get "cib_trigger" relationship value.
Definition CIBConf.hpp:285
static const std::string s_calibration_stream
Definition CIBConf.hpp:244
void set_connection_timeout_ms(uint16_t value)
Set "connection_timeout_ms" attribute value. Connection timeout.
Definition CIBConf.hpp:200
void set_calibration_stream(const dunedaq::appmodel::CIBCalibrationStream *value)
Set "calibration_stream" relationship value.
friend class conffwk::DalObject
Definition CIBConf.hpp:38
const std::string & get_cib_host() const
Get "cib_host" attribute value. IP address of the board.
Definition CIBConf.hpp:118
static const std::string s_trigger_bit
Definition CIBConf.hpp:102
static const std::string & __get_cib_port_str() noexcept
Definition CIBConf.hpp:105
uint32_t get_trigger_bit() const
Get "trigger_bit" attribute value. Trigger bit that this particular instance is associated with.
Definition CIBConf.hpp:217
void set_trigger_bit(uint32_t value)
Set "trigger_bit" attribute value. Trigger bit that this particular instance is associated with.
Definition CIBConf.hpp:233
void set_trigger_report(const dunedaq::appmodel::CIBTriggerReport *value)
Set "trigger_report" relationship value.
const dunedaq::appmodel::CIBTrigger * m_cib_trigger
Definition CIBConf.hpp:91
static const std::string & __get_trigger_bit_str() noexcept
Definition CIBConf.hpp:107
uint16_t get_connection_timeout_ms() const
Get "connection_timeout_ms" attribute value. Connection timeout.
Definition CIBConf.hpp:184
uint16_t get_cib_port() const
Get "cib_port" attribute value. Port where the CIB is listening to.
Definition CIBConf.hpp:151
static const std::string s_cib_port
Definition CIBConf.hpp:100
void set_cib_port(uint16_t value)
Set "cib_port" attribute value. Port where the CIB is listening to.
Definition CIBConf.hpp:167
const dunedaq::appmodel::CIBCalibrationStream * get_calibration_stream() const
Get "calibration_stream" relationship value.
Definition CIBConf.hpp:260
const dunedaq::appmodel::CIBCalibrationStream * m_calibration_stream
Definition CIBConf.hpp:90
static const std::string & __get_trigger_report_str() noexcept
Definition CIBConf.hpp:250
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.
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.
conffwk entry point
double offset
std::vector< constCIBConf * >::const_iterator CIBConfIterator
Definition CIBConf.hpp:343
std::ostream & operator<<(std::ostream &s, const AVXAbsRunSumProcessor &obj)
Including Qt Headers.
msgpack::object obj