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 DaphneV2BoardConf;
22 }
23}
24
25
26 // prologue of method DaphneConf::get_timeout()
27
28#include <chrono>
29
30 // prologue of method DaphneConf::get_json()
31
32#include <nlohmann/json.hpp>
33
34namespace dunedaq {
35 namespace appmodel {
36
41 class DaphneConf : public virtual dunedaq::conffwk::DalObject {
42
44 friend class conffwk::DalObject;
45 friend class conffwk::DalFactory;
47
48 protected:
49
51 virtual ~DaphneConf() noexcept;
52 virtual void init(bool init_children);
53
54 public:
55
58 static const std::string& s_class_name;
59
60
70 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
71
72
82 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
83
84
85 protected:
86
87 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
88
89
90 private:
91
92 uint16_t m_timeout_ms;
95
96
97 public:
98
99 // attribute names
100
101 inline static const std::string s_timeout_ms = "timeout_ms";
102 inline static const std::string s_json_file = "json_file";
103
104 static const std::string& __get_timeout_ms_str() noexcept { return s_timeout_ms; }
105 static const std::string& __get_json_file_str() noexcept { return s_json_file; }
106
107
115 uint16_t
117 {
118 std::lock_guard scoped_lock(m_mutex);
119 check();
120 check_init();
121 return m_timeout_ms;
122 }
123
131 void
132 set_timeout_ms(uint16_t value)
133 {
134 std::lock_guard scoped_lock(m_mutex);
135 check();
136 clear();
138 }
139
140
147 const std::string&
149 {
150 std::lock_guard scoped_lock(m_mutex);
151 check();
152 check_init();
153 return m_json_file;
154 }
155
162 void
163 set_json_file(const std::string& value)
164 {
165 std::lock_guard scoped_lock(m_mutex);
166 check();
167 clear();
169 }
170
171
172 // relationship names
173
174 inline static const std::string s_default_v2_settings = "default_v2_settings";
175
176 static const std::string& __get_default_v2_settings_str() noexcept { return s_default_v2_settings; }
177
178
188 {
189 std::lock_guard scoped_lock(m_mutex);
190 check();
191 check_init();
193 {
194 std::ostringstream text;
195 text << "relationship \"" << s_default_v2_settings << "\" of object " << this << " is not set";
196 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
197 }
199 }
200
201
209 void
211
212
213 public:
214
215 // user-defined algorithms
216
221 std::chrono::milliseconds get_timeout() const;
222
223
228 nlohmann::json get_json() const;
229
230
235 uint16_t get_board_slot(const std::string & ip) const;
236 };
237
238 // out stream operator
239
240 inline std::ostream& operator<<(std::ostream& s, const DaphneConf& obj)
241 {
242 return obj.print_object(s);
243 }
244
245 typedef std::vector<const DaphneConf*>::const_iterator DaphneConfIterator;
246
247 }
248}
249
250#endif
#define ERS_HERE
static const std::string & s_class_name
static const std::string s_json_file
void set_json_file(const std::string &value)
Set "json_file" attribute value.
static const std::string & __get_default_v2_settings_str() noexcept
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
nlohmann::json get_json() const
void set_default_v2_settings(const dunedaq::appmodel::DaphneV2BoardConf *value)
Set "default_v2_settings" relationship value. Value to be used during scrap.
const std::string & get_json_file() const
Get "json_file" attribute value.
static const std::string s_default_v2_settings
virtual ~DaphneConf() noexcept
uint16_t get_board_slot(const std::string &ip) const
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
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
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.
static const std::string & __get_json_file_str() noexcept
const dunedaq::appmodel::DaphneV2BoardConf * m_default_v2_settings
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::ostream & operator<<(std::ostream &s, const AVXAbsRunSumProcessor &obj)
std::vector< constDaphneConf * >::const_iterator DaphneConfIterator
Including Qt Headers.