DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
Service.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _Service_0_dunedaq__confmodel_0_confmodel_H_
4#define _Service_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
17namespace dunedaq {
18 namespace confmodel {
19
20 class Service : public virtual dunedaq::conffwk::DalObject {
21
23 friend class conffwk::DalObject;
24 friend class conffwk::DalFactory;
26
27 protected:
28
29 Service(conffwk::DalRegistry& db, const conffwk::ConfigObject& obj) noexcept;
30 virtual ~Service() noexcept;
31 virtual void init(bool init_children);
32
33 public:
34
37 static const std::string& s_class_name;
38
39
49 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
50
51
61 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
62
63
64 protected:
65
66 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
67
68
69 private:
70
71 std::string m_protocol;
72 uint16_t m_port;
74 std::string m_path;
75
76
77 public:
78
79 // attribute names
80
81 inline static const std::string s_protocol = "protocol";
82 inline static const std::string s_port = "port";
83 inline static const std::string s_eth_device_name = "eth_device_name";
84 inline static const std::string s_path = "path";
85
86 static const std::string& __get_protocol_str() noexcept { return s_protocol; }
87 static const std::string& __get_port_str() noexcept { return s_port; }
88 static const std::string& __get_eth_device_name_str() noexcept { return s_eth_device_name; }
89 static const std::string& __get_path_str() noexcept { return s_path; }
90
91
98 const std::string&
100 {
101 std::lock_guard scoped_lock(m_mutex);
102 check();
103 check_init();
104 return m_protocol;
105 }
106
113 void
114 set_protocol(const std::string& value)
115 {
116 std::lock_guard scoped_lock(m_mutex);
117 check();
118 clear();
120 }
121
122
129 uint16_t
130 get_port() const
131 {
132 std::lock_guard scoped_lock(m_mutex);
133 check();
134 check_init();
135 return m_port;
136 }
137
144 void
145 set_port(uint16_t value)
146 {
147 std::lock_guard scoped_lock(m_mutex);
148 check();
149 clear();
150 p_obj.set_by_val(s_port, value);
151 }
152
153
160 const std::string&
162 {
163 std::lock_guard scoped_lock(m_mutex);
164 check();
165 check_init();
166 return m_eth_device_name;
167 }
168
175 void
176 set_eth_device_name(const std::string& value)
177 {
178 std::lock_guard scoped_lock(m_mutex);
179 check();
180 clear();
182 }
183
184
191 const std::string&
192 get_path() const
193 {
194 std::lock_guard scoped_lock(m_mutex);
195 check();
196 check_init();
197 return m_path;
198 }
199
206 void
207 set_path(const std::string& value)
208 {
209 std::lock_guard scoped_lock(m_mutex);
210 check();
211 clear();
212 p_obj.set_by_ref(s_path, value);
213 }
214
215
216 };
217
218 // out stream operator
219
220 inline std::ostream& operator<<(std::ostream& s, const Service& obj)
221 {
222 return obj.print_object(s);
223 }
224
225 typedef std::vector<const Service*>::const_iterator ServiceIterator;
226
227 }
228}
229
230#endif
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...
const std::string & get_eth_device_name() const
Get "eth_device_name" attribute value.
Definition Service.hpp:161
Service(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
Definition Service.cpp:26
static const std::string s_port
Definition Service.hpp:82
void set_protocol(const std::string &value)
Set "protocol" attribute value.
Definition Service.hpp:114
const std::string & get_protocol() const
Get "protocol" attribute value.
Definition Service.hpp:99
void set_path(const std::string &value)
Set "path" attribute value.
Definition Service.hpp:207
static const std::string & __get_eth_device_name_str() noexcept
Definition Service.hpp:88
static const std::string & __get_path_str() noexcept
Definition Service.hpp:89
static const std::string s_eth_device_name
Definition Service.hpp:83
virtual void init(bool init_children)
Definition Service.cpp:57
static const std::string & s_class_name
Definition Service.hpp:37
static const std::string & __get_protocol_str() noexcept
Definition Service.hpp:86
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...
Definition Service.cpp:78
std::string m_eth_device_name
Definition Service.hpp:73
friend class conffwk::DalFactory
Definition Service.hpp:24
static const std::string & __get_port_str() noexcept
Definition Service.hpp:87
static const std::string s_protocol
Definition Service.hpp:81
static const std::string s_path
Definition Service.hpp:84
friend class conffwk::DalObject
Definition Service.hpp:23
void set_eth_device_name(const std::string &value)
Set "eth_device_name" attribute value.
Definition Service.hpp:176
void set_port(uint16_t value)
Set "port" attribute value.
Definition Service.hpp:145
const std::string & get_path() const
Get "path" attribute value.
Definition Service.hpp:192
uint16_t get_port() const
Get "port" attribute value.
Definition Service.hpp:130
virtual ~Service() noexcept
Definition Service.cpp:74
conffwk entry point
double offset
std::vector< constService * >::const_iterator ServiceIterator
Definition Service.hpp:225
std::ostream & operator<<(std::ostream &s, const ActionPlan &obj)
Including Qt Headers.