DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DaphneConf.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _DaphneConf_0_dunedaq__appmodel_0_appmodel_H_
4#define _DaphneConf_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 DaphneMapEntry;
22 class DaphneV2BoardConf;
23 }
24}
25
26
27 // prologue of method DaphneConf::get_timeout()
28
29#include <chrono>
30
31namespace dunedaq {
32 namespace appmodel {
33
38 class DaphneConf : public virtual dunedaq::conffwk::DalObject {
39
40 friend class conffwk::Configuration;
41 friend class conffwk::DalObject;
42 friend class conffwk::DalFactory;
43 friend class conffwk::DalRegistry;
44
45 protected:
46
48 virtual ~DaphneConf() noexcept;
49 virtual void init(bool init_children);
50
51 public:
52
55 static const std::string& s_class_name;
56
57
67 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
68
69
79 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
80
81
82 protected:
83
84 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
85
86
87 private:
88
89 uint16_t m_timeout_ms;
90 bool m_time_reset;
92 std::vector<const dunedaq::appmodel::DaphneMapEntry*> m_boards;
94
95
96 public:
97
98 // attribute names
99
100 inline static const std::string s_timeout_ms = "timeout_ms";
101 inline static const std::string s_time_reset = "time_reset";
102
103 static const std::string& __get_timeout_ms_str() noexcept { return s_timeout_ms; }
104 static const std::string& __get_time_reset_str() noexcept { return s_time_reset; }
105
106
114 uint16_t
116 {
117 std::lock_guard scoped_lock(m_mutex);
118 check();
119 check_init();
120 return m_timeout_ms;
121 }
122
130 void
131 set_timeout_ms(uint16_t value)
132 {
133 std::lock_guard scoped_lock(m_mutex);
134 check();
135 clear();
137 }
138
139
147 bool
149 {
150 std::lock_guard scoped_lock(m_mutex);
151 check();
152 check_init();
153 return m_time_reset;
154 }
155
163 void
164 set_time_reset(bool value)
165 {
166 std::lock_guard scoped_lock(m_mutex);
167 check();
168 clear();
170 }
171
172
173 // relationship names
174
175 inline static const std::string s_default_v2_settings = "default_v2_settings";
176 inline static const std::string s_boards = "boards";
177 inline static const std::string s_default_v3_settings = "default_v3_settings";
178
179 static const std::string& __get_default_v2_settings_str() noexcept { return s_default_v2_settings; }
180 static const std::string& __get_boards_str() noexcept { return s_boards; }
181 static const std::string& __get_default_v3_settings_str() noexcept { return s_default_v3_settings; }
182
183
193 {
194 std::lock_guard scoped_lock(m_mutex);
195 check();
196 check_init();
198 {
199 std::ostringstream text;
200 text << "relationship \"" << s_default_v2_settings << "\" of object " << this << " is not set";
201 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
202 }
204 }
205
206
214 void
216
223 const std::vector<const dunedaq::appmodel::DaphneMapEntry*>&
225 {
226 std::lock_guard scoped_lock(m_mutex);
227 check();
228 check_init();
229 return m_boards;
230 }
231
232
239 void
240 set_boards(const std::vector<const dunedaq::appmodel::DaphneMapEntry*>& value);
241
250 {
251 std::lock_guard scoped_lock(m_mutex);
252 check();
253 check_init();
255 {
256 std::ostringstream text;
257 text << "relationship \"" << s_default_v3_settings << "\" of object " << this << " is not set";
258 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
259 }
261 }
262
263
270 void
272
273
274 public:
275
276 // user-defined algorithms
277
282 std::chrono::milliseconds get_timeout() const;
283 };
284
285 // out stream operator
286
287 inline std::ostream& operator<<(std::ostream& s, const DaphneConf& obj)
288 {
289 return obj.print_object(s);
290 }
291
292 typedef std::vector<const DaphneConf*>::const_iterator DaphneConfIterator;
293
294 }
295}
296
297#endif
#define ERS_HERE
static const std::string & s_class_name
static const std::string s_boards
const std::vector< const dunedaq::appmodel::DaphneMapEntry * > & get_boards() const
Get "boards" relationship value.
static const std::string & __get_default_v2_settings_str() noexcept
bool get_time_reset() const
Get "time_reset" attribute value. If True, it performs the time reset at configuration....
const dunedaq::appmodel::DaphneV2BoardConf * get_default_v2_settings() const
Get "default_v2_settings" relationship value. Value to be used during scrap.
virtual void init(bool init_children)
static const std::string & __get_timeout_ms_str() noexcept
void set_default_v2_settings(const dunedaq::appmodel::DaphneV2BoardConf *value)
Set "default_v2_settings" relationship value. Value to be used during scrap.
static const std::string & __get_time_reset_str() noexcept
static const std::string s_default_v2_settings
void set_default_v3_settings(const dunedaq::appmodel::DaphneV2BoardConf *value)
Set "default_v3_settings" relationship value.
const dunedaq::appmodel::DaphneV2BoardConf * m_default_v3_settings
static const std::string s_time_reset
virtual ~DaphneConf() noexcept
friend class conffwk::DalFactory
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...
static const std::string s_timeout_ms
void set_boards(const std::vector< const dunedaq::appmodel::DaphneMapEntry * > &value)
Set "boards" relationship value.
uint16_t get_timeout_ms() const
Get "timeout_ms" attribute value. timeout used for the board operations.
DaphneConf(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
static const std::string & __get_boards_str() noexcept
void set_time_reset(bool value)
Set "time_reset" attribute value. If True, it performs the time reset at configuration....
static const std::string s_default_v3_settings
static const std::string & __get_default_v3_settings_str() noexcept
friend class conffwk::DalObject
std::chrono::milliseconds get_timeout() const
void set_timeout_ms(uint16_t value)
Set "timeout_ms" attribute value. timeout used for the board operations.
std::vector< const dunedaq::appmodel::DaphneMapEntry * > m_boards
const dunedaq::appmodel::DaphneV2BoardConf * get_default_v3_settings() const
Get "default_v3_settings" relationship value.
const dunedaq::appmodel::DaphneV2BoardConf * m_default_v2_settings
void set_by_val(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::ostream & operator<<(std::ostream &s, const AVXAbsRunSumProcessor &obj)
std::vector< constDaphneConf * >::const_iterator DaphneConfIterator
The DUNE-DAQ namespace.
msgpack::object obj