DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
NetworkInterface.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _NetworkInterface_0_dunedaq__confmodel_0_confmodel_H_
4#define _NetworkInterface_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 NetworkInterface : public virtual dunedaq::conffwk::DalObject {
21
23 friend class conffwk::DalObject;
24 friend class conffwk::DalFactory;
26
27 protected:
28
30 virtual ~NetworkInterface() 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
72 std::vector<std::string> m_ip_address;
76
77
78 public:
79
80 // attribute names
81
82 inline static const std::string s_mac_address = "mac_address";
83 inline static const std::string s_ip_address = "ip_address";
84 inline static const std::string s_interface_name = "interface_name";
85 inline static const std::string s_network_mask = "network_mask";
86 inline static const std::string s_network_name = "network_name";
87
88 static const std::string& __get_mac_address_str() noexcept { return s_mac_address; }
89 static const std::string& __get_ip_address_str() noexcept { return s_ip_address; }
90 static const std::string& __get_interface_name_str() noexcept { return s_interface_name; }
91 static const std::string& __get_network_mask_str() noexcept { return s_network_mask; }
92 static const std::string& __get_network_name_str() noexcept { return s_network_name; }
93
94
102 const std::string&
104 {
105 std::lock_guard scoped_lock(m_mutex);
106 check();
107 check_init();
108 return m_mac_address;
109 }
110
118 void
119 set_mac_address(const std::string& value)
120 {
121 std::lock_guard scoped_lock(m_mutex);
122 check();
123 clear();
125 }
126
127
135 const std::vector<std::string>&
137 {
138 std::lock_guard scoped_lock(m_mutex);
139 check();
140 check_init();
141 return m_ip_address;
142 }
143
151 void
152 set_ip_address(const std::vector<std::string>& value)
153 {
154 std::lock_guard scoped_lock(m_mutex);
155 check();
156 clear();
158 }
159
160
168 const std::string&
170 {
171 std::lock_guard scoped_lock(m_mutex);
172 check();
173 check_init();
174 return m_interface_name;
175 }
176
184 void
185 set_interface_name(const std::string& value)
186 {
187 std::lock_guard scoped_lock(m_mutex);
188 check();
189 clear();
191 }
192
193
201 const std::string&
203 {
204 std::lock_guard scoped_lock(m_mutex);
205 check();
206 check_init();
207 return m_network_mask;
208 }
209
217 void
218 set_network_mask(const std::string& value)
219 {
220 std::lock_guard scoped_lock(m_mutex);
221 check();
222 clear();
224 }
225
226
231 struct Network_name {
232 inline static const std::string Control = "Control";
233 inline static const std::string Data = "Data";
234 };
235
243 const std::string&
245 {
246 std::lock_guard scoped_lock(m_mutex);
247 check();
248 check_init();
249 return m_network_name;
250 }
251
259 void
260 set_network_name(const std::string& value)
261 {
262 std::lock_guard scoped_lock(m_mutex);
263 check();
264 clear();
266 }
267
268
269 };
270
271 // out stream operator
272
273 inline std::ostream& operator<<(std::ostream& s, const NetworkInterface& obj)
274 {
275 return obj.print_object(s);
276 }
277
278 typedef std::vector<const NetworkInterface*>::const_iterator NetworkInterfaceIterator;
279
280 }
281}
282
283#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.
void set_enum(const std::string &name, const std::string &value)
Set attribute enumeration 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...
static const std::string & __get_mac_address_str() noexcept
void set_ip_address(const std::vector< std::string > &value)
Set "ip_address" attribute value. IP address in form a.b.c.d.
static const std::string s_interface_name
static const std::string s_network_mask
std::vector< std::string > m_ip_address
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_class_name
static const std::string & __get_network_name_str() noexcept
static const std::string s_network_name
void set_interface_name(const std::string &value)
Set "interface_name" attribute value. Name of interface e.g. eth0 or eno1.
void set_network_mask(const std::string &value)
Set "network_mask" attribute value. Network mask in for a.b.c.d.
const std::string & get_network_name() const
Get "network_name" attribute value. Name of network on this interface Control or Data.
NetworkInterface(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
static const std::string & __get_interface_name_str() noexcept
const std::string & get_interface_name() const
Get "interface_name" attribute value. Name of interface e.g. eth0 or eno1.
virtual void init(bool init_children)
static const std::string & __get_network_mask_str() noexcept
void set_mac_address(const std::string &value)
Set "mac_address" attribute value. Destination MAC address on readout host.
static const std::string & __get_ip_address_str() noexcept
const std::string & get_network_mask() const
Get "network_mask" attribute value. Network mask in for a.b.c.d.
void set_network_name(const std::string &value)
Set "network_name" attribute value. Name of network on this interface Control or Data.
const std::vector< std::string > & get_ip_address() const
Get "ip_address" attribute value. IP address in form a.b.c.d.
const std::string & get_mac_address() const
Get "mac_address" attribute value. Destination MAC address on readout host.
conffwk entry point
double offset
std::vector< constNetworkInterface * >::const_iterator NetworkInterfaceIterator
std::ostream & operator<<(std::ostream &s, const ActionPlan &obj)
Including Qt Headers.