DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DaphneV2ControllerModule.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _DaphneV2ControllerModule_0_dunedaq__appmodel_0_appmodel_H_
4#define _DaphneV2ControllerModule_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 // 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 appmodel {
24 class DaphneConf;
25 class DaphneV2BoardConf;
26 }
27}
28
29
30 // prologue of method DaphneV2ControllerModule::get_slot()
31
33
34namespace dunedaq {
35 namespace appmodel {
36
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 ~DaphneV2ControllerModule() 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::string m_address;
91
92
93 public:
94
95 // attribute names
96
97 inline static const std::string s_address = "address";
98
99 static const std::string& __get_address_str() noexcept { return s_address; }
100
101
109 const std::string&
111 {
112 std::lock_guard scoped_lock(m_mutex);
113 check();
114 check_init();
115 return m_address;
116 }
117
125 void
126 set_address(const std::string& value)
127 {
128 std::lock_guard scoped_lock(m_mutex);
129 check();
130 clear();
131 p_obj.set_by_ref(s_address, value);
132 }
133
134
135 // relationship names
136
137 inline static const std::string s_daphne_conf = "daphne_conf";
138 inline static const std::string s_board_conf = "board_conf";
139
140 static const std::string& __get_daphne_conf_str() noexcept { return s_daphne_conf; }
141 static const std::string& __get_board_conf_str() noexcept { return s_board_conf; }
142
143
152 {
153 std::lock_guard scoped_lock(m_mutex);
154 check();
155 check_init();
156 if (!m_daphne_conf)
157 {
158 std::ostringstream text;
159 text << "relationship \"" << s_daphne_conf << "\" of object " << this << " is not set";
160 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
161 }
162 return m_daphne_conf;
163 }
164
165
172 void
174
183 {
184 std::lock_guard scoped_lock(m_mutex);
185 check();
186 check_init();
187 if (!m_board_conf)
188 {
189 std::ostringstream text;
190 text << "relationship \"" << s_board_conf << "\" of object " << this << " is not set";
191 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
192 }
193 return m_board_conf;
194 }
195
196
203 void
205
206
207 public:
208
209 // user-defined algorithms
210
211 auto get_slot() const { return get_board_conf()->get_slot_id(); };
212 };
213
214 // out stream operator
215
216 inline std::ostream& operator<<(std::ostream& s, const DaphneV2ControllerModule& obj)
217 {
218 return obj.print_object(s);
219 }
220
221 typedef std::vector<const DaphneV2ControllerModule*>::const_iterator DaphneV2ControllerModuleIterator;
222
223 }
224}
225
226#endif
#define ERS_HERE
uint16_t get_slot_id() const
Get "slot_id" attribute value.
const dunedaq::appmodel::DaphneConf * get_daphne_conf() const
Get "daphne_conf" relationship value.
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...
void set_address(const std::string &value)
Set "address" attribute value. ip address of the board.
static const std::string & __get_board_conf_str() noexcept
const dunedaq::appmodel::DaphneV2BoardConf * get_board_conf() const
Get "board_conf" relationship value.
const std::string & get_address() const
Get "address" attribute value. ip address of the board.
DaphneV2ControllerModule(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
const dunedaq::appmodel::DaphneV2BoardConf * m_board_conf
static const std::string & __get_daphne_conf_str() noexcept
static const std::string & __get_address_str() noexcept
void set_daphne_conf(const dunedaq::appmodel::DaphneConf *value)
Set "daphne_conf" relationship value.
void set_board_conf(const dunedaq::appmodel::DaphneV2BoardConf *value)
Set "board_conf" relationship value.
const dunedaq::appmodel::DaphneConf * m_daphne_conf
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< constDaphneV2ControllerModule * >::const_iterator DaphneV2ControllerModuleIterator
Including Qt Headers.