DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
SocketDataSender.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _SocketDataSender_0_dunedaq__appmodel_0_appmodel_H_
4#define _SocketDataSender_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
20namespace dunedaq {
21 namespace appmodel {
22
24
26 friend class conffwk::DalObject;
27 friend class conffwk::DalFactory;
29
30 protected:
31
33 virtual ~SocketDataSender() noexcept;
34 virtual void init(bool init_children);
35
36 public:
37
39
40 static const std::string& s_class_name;
41
42
51
52 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
53
54
63
64 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
65
66
67 protected:
68
69 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
70
71
72 private:
73
75 uint32_t m_local_port;
76 uint32_t m_remote_port;
77
78
79 public:
80
81 // attribute names
82
83 inline static const std::string s_socket_type = "socket_type";
84 inline static const std::string s_local_port = "local_port";
85 inline static const std::string s_remote_port = "remote_port";
86
87 static const std::string& __get_socket_type_str() noexcept { return s_socket_type; }
88 static const std::string& __get_local_port_str() noexcept { return s_local_port; }
89 static const std::string& __get_remote_port_str() noexcept { return s_remote_port; }
90
91
95
96 struct Socket_type {
97 inline static const std::string TCP = "TCP";
98 inline static const std::string UDP = "UDP";
99 };
100
107
108 const std::string&
110 {
111 std::lock_guard scoped_lock(m_mutex);
112 check();
113 check_init();
114 return m_socket_type;
115 }
116
123
124 void
125 set_socket_type(const std::string& value)
126 {
127 std::lock_guard scoped_lock(m_mutex);
128 check();
129 clear();
130 p_obj.set_enum(s_socket_type, value);
131 }
132
133
139
140 uint32_t
142 {
143 std::lock_guard scoped_lock(m_mutex);
144 check();
145 check_init();
146 return m_local_port;
147 }
148
154
155 void
156 set_local_port(uint32_t value)
157 {
158 std::lock_guard scoped_lock(m_mutex);
159 check();
160 clear();
161 p_obj.set_by_val(s_local_port, value);
162 }
163
164
170
171 uint32_t
173 {
174 std::lock_guard scoped_lock(m_mutex);
175 check();
176 check_init();
177 return m_remote_port;
178 }
179
185
186 void
187 set_remote_port(uint32_t value)
188 {
189 std::lock_guard scoped_lock(m_mutex);
190 check();
191 clear();
192 p_obj.set_by_val(s_remote_port, value);
193 }
194
195
196 };
197
198 // out stream operator
199
200 inline std::ostream& operator<<(std::ostream& s, const SocketDataSender& obj)
201 {
202 return obj.print_object(s);
203 }
204
205 typedef std::vector<const SocketDataSender*>::const_iterator SocketDataSenderIterator;
206
207 }
208}
209
210#endif
static const std::string s_remote_port
uint32_t get_local_port() const
Get "local_port" attribute value.
static const std::string & __get_socket_type_str() noexcept
static const std::string & __get_local_port_str() noexcept
virtual void init(bool init_children)
uint32_t get_remote_port() const
Get "remote_port" attribute value.
static const std::string s_socket_type
void set_socket_type(const std::string &value)
Set "socket_type" attribute value. Socket type.
static const std::string & __get_remote_port_str() noexcept
void set_remote_port(uint32_t value)
Set "remote_port" attribute value.
SocketDataSender(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
const std::string & get_socket_type() const
Get "socket_type" attribute value. Socket type.
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...
virtual void print(unsigned int offset, bool print_header, std::ostream &s) const
Print details of the SocketDataSender object.
static const std::string s_local_port
void set_local_port(uint32_t value)
Set "local_port" attribute value.
static const std::string & s_class_name
The base class for any generated DAL object.
Definition DalObject.hpp:52
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...
conffwk entry point
double offset
std::ostream & operator<<(std::ostream &s, const AVXAbsRunSumProcessor &obj)
std::vector< constSocketDataSender * >::const_iterator SocketDataSenderIterator
Including Qt Headers.
Definition module.cpp:16
msgpack::object obj