DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
NetworkConnection.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _NetworkConnection_0_dunedaq__confmodel_0_confmodel_H_
4#define _NetworkConnection_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 // include files for classes used in inheritance hierarchy
17
19
20 // forward declaration for classes used in relationships and algorithms
21
22namespace dunedaq {
23 namespace confmodel {
24 class Service;
25 }
26}
27
28
29namespace dunedaq {
30 namespace confmodel {
31
33
34 friend class conffwk::Configuration;
35 friend class conffwk::DalObject;
36 friend class conffwk::DalFactory;
37 friend class conffwk::DalRegistry;
38
39 protected:
40
42 virtual ~NetworkConnection() noexcept;
43 virtual void init(bool init_children);
44
45 public:
46
49 static const std::string& s_class_name;
50
51
61 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
62
63
73 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
74
75
76 protected:
77
78 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
79
80
81 private:
82
83 std::string m_connection_type;
85
86
87 public:
88
89 // attribute names
90
91 inline static const std::string s_connection_type = "connection_type";
92
93 static const std::string& __get_connection_type_str() noexcept { return s_connection_type; }
94
95
101 inline static const std::string KSendRecv = "kSendRecv";
102 inline static const std::string KPubSub = "kPubSub";
103 };
104
112 const std::string&
114 {
115 std::lock_guard scoped_lock(m_mutex);
116 check();
117 check_init();
118 return m_connection_type;
119 }
120
128 void
129 set_connection_type(const std::string& value)
130 {
131 std::lock_guard scoped_lock(m_mutex);
132 check();
133 clear();
135 }
136
137
138 // relationship names
139
140 inline static const std::string s_associated_service = "associated_service";
141
142 static const std::string& __get_associated_service_str() noexcept { return s_associated_service; }
143
144
154 {
155 std::lock_guard scoped_lock(m_mutex);
156 check();
157 check_init();
159 {
160 std::ostringstream text;
161 text << "relationship \"" << s_associated_service << "\" of object " << this << " is not set";
162 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
163 }
165 }
166
167
175 void
177
178 };
179
180 // out stream operator
181
182 inline std::ostream& operator<<(std::ostream& s, const NetworkConnection& obj)
183 {
184 return obj.print_object(s);
185 }
186
187 typedef std::vector<const NetworkConnection*>::const_iterator NetworkConnectionIterator;
188
189 }
190}
191
192#endif
#define ERS_HERE
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.
const dunedaq::confmodel::Service * m_associated_service
const std::string & get_connection_type() const
Get "connection_type" attribute value. Type of the network connection.
static const std::string & __get_connection_type_str() noexcept
void set_connection_type(const std::string &value)
Set "connection_type" attribute value. Type of the network connection.
void set_associated_service(const dunedaq::confmodel::Service *value)
Set "associated_service" relationship value. Service provided by this connection.
static const std::string s_associated_service
const dunedaq::confmodel::Service * get_associated_service() const
Get "associated_service" relationship value. Service provided by this connection.
static const std::string & s_class_name
static const std::string & __get_associated_service_str() noexcept
virtual void init(bool init_children)
NetworkConnection(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
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...
conffwk entry point
double offset
std::vector< constNetworkConnection * >::const_iterator NetworkConnectionIterator
std::ostream & operator<<(std::ostream &s, const ActionPlan &obj)
Including Qt Headers.