DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
ConnectivityService.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _ConnectivityService_0_dunedaq__confmodel_0_confmodel_H_
4#define _ConnectivityService_0_dunedaq__confmodel_0_confmodel_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 confmodel {
21 class Service;
22 }
23}
24
25
26namespace dunedaq {
27 namespace confmodel {
28
30
31 friend class conffwk::Configuration;
32 friend class conffwk::DalObject;
33 friend class conffwk::DalFactory;
34 friend class conffwk::DalRegistry;
35
36 protected:
37
39 virtual ~ConnectivityService() noexcept;
40 virtual void init(bool init_children);
41
42 public:
43
46 static const std::string& s_class_name;
47
48
58 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
59
60
70 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
71
72
73 protected:
74
75 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
76
77
78 private:
79
80 uint32_t m_interval_ms;
81 std::string m_host;
83
84
85 public:
86
87 // attribute names
88
89 inline static const std::string s_interval_ms = "interval_ms";
90 inline static const std::string s_host = "host";
91
92 static const std::string& __get_interval_ms_str() noexcept { return s_interval_ms; }
93 static const std::string& __get_host_str() noexcept { return s_host; }
94
95
103 uint32_t
105 {
106 std::lock_guard scoped_lock(m_mutex);
107 check();
108 check_init();
109 return m_interval_ms;
110 }
111
119 void
120 set_interval_ms(uint32_t value)
121 {
122 std::lock_guard scoped_lock(m_mutex);
123 check();
124 clear();
126 }
127
128
136 const std::string&
137 get_host() const
138 {
139 std::lock_guard scoped_lock(m_mutex);
140 check();
141 check_init();
142 return m_host;
143 }
144
152 void
153 set_host(const std::string& value)
154 {
155 std::lock_guard scoped_lock(m_mutex);
156 check();
157 clear();
158 p_obj.set_by_ref(s_host, value);
159 }
160
161
162 // relationship names
163
164 inline static const std::string s_service = "service";
165
166 static const std::string& __get_service_str() noexcept { return s_service; }
167
168
178 {
179 std::lock_guard scoped_lock(m_mutex);
180 check();
181 check_init();
182 if (!m_service)
183 {
184 std::ostringstream text;
185 text << "relationship \"" << s_service << "\" of object " << this << " is not set";
186 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
187 }
188 return m_service;
189 }
190
191
199 void
201
202 };
203
204 // out stream operator
205
206 inline std::ostream& operator<<(std::ostream& s, const ConnectivityService& obj)
207 {
208 return obj.print_object(s);
209 }
210
211 typedef std::vector<const ConnectivityService*>::const_iterator ConnectivityServiceIterator;
212
213 }
214}
215
216#endif
#define ERS_HERE
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.
static const std::string & __get_host_str() noexcept
void set_service(const dunedaq::confmodel::Service *value)
Set "service" relationship value. Connectivity service Service definition.
void set_interval_ms(uint32_t value)
Set "interval_ms" attribute value. Interval between publishes and polls of connectivity service infor...
ConnectivityService(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
uint32_t get_interval_ms() const
Get "interval_ms" attribute value. Interval between publishes and polls of connectivity service infor...
void set_host(const std::string &value)
Set "host" attribute value. Connectivity service Host.
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 & __get_service_str() noexcept
const dunedaq::confmodel::Service * get_service() const
Get "service" relationship value. Connectivity service Service definition.
const dunedaq::confmodel::Service * m_service
static const std::string & __get_interval_ms_str() noexcept
const std::string & get_host() const
Get "host" attribute value. Connectivity service Host.
virtual void init(bool init_children)
conffwk entry point
double offset
std::vector< constConnectivityService * >::const_iterator ConnectivityServiceIterator
std::ostream & operator<<(std::ostream &s, const ActionPlan &obj)
Including Qt Headers.