DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
NetworkConnectionDescriptor.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _NetworkConnectionDescriptor_0_dunedaq__appmodel_0_appmodel_H_
4#define _NetworkConnectionDescriptor_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
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 appmodel {
28
29 class NetworkConnectionDescriptor : public virtual dunedaq::conffwk::DalObject {
30
32 friend class conffwk::DalObject;
33 friend class conffwk::DalFactory;
35
36 protected:
37
39 virtual ~NetworkConnectionDescriptor() 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 std::string m_uid_base;
82 uint32_t m_capacity;
85
86
87 public:
88
89 // attribute names
90
91 inline static const std::string s_uid_base = "uid_base";
92 inline static const std::string s_connection_type = "connection_type";
93 inline static const std::string s_capacity = "capacity";
94 inline static const std::string s_data_type = "data_type";
95
96 static const std::string& __get_uid_base_str() noexcept { return s_uid_base; }
97 static const std::string& __get_connection_type_str() noexcept { return s_connection_type; }
98 static const std::string& __get_capacity_str() noexcept { return s_capacity; }
99 static const std::string& __get_data_type_str() noexcept { return s_data_type; }
100
101
109 const std::string&
111 {
112 std::lock_guard scoped_lock(m_mutex);
113 check();
114 check_init();
115 return m_uid_base;
116 }
117
125 void
126 set_uid_base(const std::string& value)
127 {
128 std::lock_guard scoped_lock(m_mutex);
129 check();
130 clear();
132 }
133
134
139 struct Connection_type {
140 inline static const std::string KSendRecv = "kSendRecv";
141 inline static const std::string KPubSub = "kPubSub";
142 };
143
150 const std::string&
152 {
153 std::lock_guard scoped_lock(m_mutex);
154 check();
155 check_init();
156 return m_connection_type;
157 }
158
165 void
166 set_connection_type(const std::string& value)
167 {
168 std::lock_guard scoped_lock(m_mutex);
169 check();
170 clear();
172 }
173
174
181 uint32_t
183 {
184 std::lock_guard scoped_lock(m_mutex);
185 check();
186 check_init();
187 return m_capacity;
188 }
189
196 void
197 set_capacity(uint32_t value)
198 {
199 std::lock_guard scoped_lock(m_mutex);
200 check();
201 clear();
203 }
204
205
213 const std::string&
215 {
216 std::lock_guard scoped_lock(m_mutex);
217 check();
218 check_init();
219 return m_data_type;
220 }
221
229 void
230 set_data_type(const std::string& value)
231 {
232 std::lock_guard scoped_lock(m_mutex);
233 check();
234 clear();
236 }
237
238
239 // relationship names
240
241 inline static const std::string s_associated_service = "associated_service";
242
243 static const std::string& __get_associated_service_str() noexcept { return s_associated_service; }
244
245
255 {
256 std::lock_guard scoped_lock(m_mutex);
257 check();
258 check_init();
260 {
261 std::ostringstream text;
262 text << "relationship \"" << s_associated_service << "\" of object " << this << " is not set";
263 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
264 }
266 }
267
268
276 void
278
279 };
280
281 // out stream operator
282
283 inline std::ostream& operator<<(std::ostream& s, const NetworkConnectionDescriptor& obj)
284 {
285 return obj.print_object(s);
286 }
287
288 typedef std::vector<const NetworkConnectionDescriptor*>::const_iterator NetworkConnectionDescriptorIterator;
289
290 }
291}
292
293#endif
#define ERS_HERE
NetworkConnectionDescriptor(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
static const std::string & __get_data_type_str() noexcept
void set_capacity(uint32_t value)
Set "capacity" attribute value.
static const std::string & __get_uid_base_str() noexcept
static const std::string & __get_connection_type_str() noexcept
const std::string & get_connection_type() const
Get "connection_type" attribute value.
void set_associated_service(const dunedaq::confmodel::Service *value)
Set "associated_service" relationship value. Service provided by this connection.
const std::string & get_data_type() const
Get "data_type" attribute value. string identifying type of data transferred through this connection.
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...
uint32_t get_capacity() const
Get "capacity" attribute value.
static const std::string & __get_capacity_str() noexcept
const std::string & get_uid_base() const
Get "uid_base" attribute value. Base for UID string. To be combined with a source id.
void set_connection_type(const std::string &value)
Set "connection_type" attribute value.
static const std::string & __get_associated_service_str() noexcept
const dunedaq::confmodel::Service * get_associated_service() const
Get "associated_service" relationship value. Service provided by this connection.
void set_uid_base(const std::string &value)
Set "uid_base" attribute value. Base for UID string. To be combined with a source id.
void set_data_type(const std::string &value)
Set "data_type" attribute value. string identifying type of data transferred through this connection.
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...
Generic configuration exception.
conffwk entry point
double offset
std::ostream & operator<<(std::ostream &s, const AVXAbsRunSumProcessor &obj)
std::vector< constNetworkConnectionDescriptor * >::const_iterator NetworkConnectionDescriptorIterator
The DUNE-DAQ namespace.
Definition DataStore.hpp:57
msgpack::object obj