DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
Connection.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _Connection_0_dunedaq__confmodel_0_confmodel_H_
4#define _Connection_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 Connection : public virtual dunedaq::conffwk::DalObject {
21
23 friend class conffwk::DalObject;
24 friend class conffwk::DalFactory;
26
27 protected:
28
30 virtual ~Connection() 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 uint32_t m_capacity;
75
76
77 public:
78
79 // attribute names
80
81 inline static const std::string s_data_type = "data_type";
82 inline static const std::string s_capacity = "capacity";
83 inline static const std::string s_send_timeout_ms = "send_timeout_ms";
84 inline static const std::string s_recv_timeout_ms = "recv_timeout_ms";
85
86 static const std::string& __get_data_type_str() noexcept { return s_data_type; }
87 static const std::string& __get_capacity_str() noexcept { return s_capacity; }
88 static const std::string& __get_send_timeout_ms_str() noexcept { return s_send_timeout_ms; }
89 static const std::string& __get_recv_timeout_ms_str() noexcept { return s_recv_timeout_ms; }
90
91
99 const std::string&
101 {
102 std::lock_guard scoped_lock(m_mutex);
103 check();
104 check_init();
105 return m_data_type;
106 }
107
115 void
116 set_data_type(const std::string& value)
117 {
118 std::lock_guard scoped_lock(m_mutex);
119 check();
120 clear();
122 }
123
124
131 uint32_t
133 {
134 std::lock_guard scoped_lock(m_mutex);
135 check();
136 check_init();
137 return m_capacity;
138 }
139
146 void
147 set_capacity(uint32_t value)
148 {
149 std::lock_guard scoped_lock(m_mutex);
150 check();
151 clear();
153 }
154
155
163 uint32_t
165 {
166 std::lock_guard scoped_lock(m_mutex);
167 check();
168 check_init();
169 return m_send_timeout_ms;
170 }
171
179 void
180 set_send_timeout_ms(uint32_t value)
181 {
182 std::lock_guard scoped_lock(m_mutex);
183 check();
184 clear();
186 }
187
188
196 uint32_t
198 {
199 std::lock_guard scoped_lock(m_mutex);
200 check();
201 check_init();
202 return m_recv_timeout_ms;
203 }
204
212 void
213 set_recv_timeout_ms(uint32_t value)
214 {
215 std::lock_guard scoped_lock(m_mutex);
216 check();
217 clear();
219 }
220
221
222 };
223
224 // out stream operator
225
226 inline std::ostream& operator<<(std::ostream& s, const Connection& obj)
227 {
228 return obj.print_object(s);
229 }
230
231 typedef std::vector<const Connection*>::const_iterator ConnectionIterator;
232
233 }
234}
235
236#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...
static const std::string s_recv_timeout_ms
static const std::string & s_class_name
Connection(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
virtual void init(bool init_children)
uint32_t get_capacity() const
Get "capacity" attribute value.
virtual ~Connection() noexcept
static const std::string s_data_type
uint32_t get_recv_timeout_ms() const
Get "recv_timeout_ms" attribute value. Timeout in ms for receiving on this connection.
void set_capacity(uint32_t value)
Set "capacity" attribute value.
static const std::string & __get_recv_timeout_ms_str() noexcept
static const std::string s_capacity
friend class conffwk::DalFactory
void set_data_type(const std::string &value)
Set "data_type" attribute value. String identifying the data that travel through this connection....
static const std::string & __get_capacity_str() noexcept
static const std::string s_send_timeout_ms
const std::string & get_data_type() const
Get "data_type" attribute value. String identifying the data that travel through this connection....
uint32_t get_send_timeout_ms() const
Get "send_timeout_ms" attribute value. Timeout in ms for sending on this connection.
static const std::string & __get_data_type_str() noexcept
friend class conffwk::DalObject
static const std::string & __get_send_timeout_ms_str() noexcept
void set_send_timeout_ms(uint32_t value)
Set "send_timeout_ms" attribute value. Timeout in ms for sending on this connection.
void set_recv_timeout_ms(uint32_t value)
Set "recv_timeout_ms" attribute value. Timeout in ms for receiving on 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...
conffwk entry point
double offset
std::vector< constConnection * >::const_iterator ConnectionIterator
std::ostream & operator<<(std::ostream &s, const ActionPlan &obj)
The DUNE-DAQ namespace.
Definition DataStore.hpp:57
msgpack::object obj