DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
CIBoardConf.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _CIBoardConf_0_dunedaq__appmodel_0_appmodel_H_
4#define _CIBoardConf_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 confmodel {
24 class GeoId;
25 class Session;
26 }
27}
28
29
30 // prologue of method CIBoardConf::get_cib_json()
31
32#include "nlohmann/json.hpp"
33#include <optional>
34
35namespace dunedaq {
36 namespace appmodel {
37
42 class CIBoardConf : public dunedaq::confmodel::Resource {
43
45 friend class conffwk::DalObject;
46 friend class conffwk::DalFactory;
48
49 protected:
50
52 virtual ~CIBoardConf() noexcept;
53 virtual void init(bool init_children);
54
55 public:
56
59 static const std::string& s_class_name;
60
61
71 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
72
73
83 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
84
85
86 protected:
87
88 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
89
90
91 private:
92
95 const dunedaq::confmodel::GeoId* m_geo_id;
96
97
98 public:
99
100 // attribute names
101
102 inline static const std::string s_receiver_host = "receiver_host";
103 inline static const std::string s_receiver_port = "receiver_port";
104
105 static const std::string& __get_receiver_host_str() noexcept { return s_receiver_host; }
106 static const std::string& __get_receiver_port_str() noexcept { return s_receiver_port; }
107
108
115 const std::string&
117 {
118 std::lock_guard scoped_lock(m_mutex);
119 check();
120 check_init();
121 return m_receiver_host;
122 }
123
130 void
131 set_receiver_host(const std::string& value)
132 {
133 std::lock_guard scoped_lock(m_mutex);
134 check();
135 clear();
137 }
138
139
146 uint16_t
148 {
149 std::lock_guard scoped_lock(m_mutex);
150 check();
151 check_init();
152 return m_receiver_port;
153 }
154
161 void
162 set_receiver_port(uint16_t value)
163 {
164 std::lock_guard scoped_lock(m_mutex);
165 check();
166 clear();
168 }
169
170
171 // relationship names
172
173 inline static const std::string s_geo_id = "geo_id";
174
175 static const std::string& __get_geo_id_str() noexcept { return s_geo_id; }
176
177
186 {
187 std::lock_guard scoped_lock(m_mutex);
188 check();
189 check_init();
190 if (!m_geo_id)
191 {
192 std::ostringstream text;
193 text << "relationship \"" << s_geo_id << "\" of object " << this << " is not set";
194 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
195 }
196 return m_geo_id;
197 }
198
199
206 void
208
209
210 public:
211
212 // user-defined algorithms
213
218 nlohmann::json get_cib_json(const dunedaq::confmodel::Session& session, std::optional<std::string> socket_host = std::nullopt, std::optional<uint16_t> socket_port = std::nullopt ) const;
219 };
220
221 // out stream operator
222
223 inline std::ostream& operator<<(std::ostream& s, const CIBoardConf& obj)
224 {
225 return obj.print_object(s);
226 }
227
228 typedef std::vector<const CIBoardConf*>::const_iterator CIBoardConfIterator;
229
230 }
231}
232
233#endif
#define ERS_HERE
static const std::string & __get_receiver_port_str() noexcept
uint16_t get_receiver_port() const
Get "receiver_port" attribute value.
nlohmann::json get_cib_json(const dunedaq::confmodel::Session &session, std::optional< std::string > socket_host=std::nullopt, std::optional< uint16_t > socket_port=std::nullopt) const
static const std::string s_geo_id
void set_geo_id(const dunedaq::confmodel::GeoId *value)
Set "geo_id" relationship value.
const dunedaq::confmodel::GeoId * m_geo_id
static const std::string s_receiver_port
virtual ~CIBoardConf() noexcept
void set_receiver_port(uint16_t value)
Set "receiver_port" attribute value.
static const std::string & s_class_name
void set_receiver_host(const std::string &value)
Set "receiver_host" attribute value.
static const std::string & __get_geo_id_str() noexcept
friend class conffwk::DalFactory
CIBoardConf(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) 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...
const dunedaq::confmodel::GeoId * get_geo_id() const
Get "geo_id" relationship value.
const std::string & get_receiver_host() const
Get "receiver_host" attribute value.
friend class conffwk::DalObject
static const std::string & __get_receiver_host_str() noexcept
virtual void init(bool init_children)
static const std::string s_receiver_host
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< constCIBoardConf * >::const_iterator CIBoardConfIterator
std::ostream & operator<<(std::ostream &s, const AVXAbsRunSumProcessor &obj)
Including Qt Headers.
msgpack::object obj