DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
RCBroadcaster.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _RCBroadcaster_0_dunedaq__confmodel_0_confmodel_H_
4#define _RCBroadcaster_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
21
22 friend class conffwk::Configuration;
23 friend class conffwk::DalObject;
24 friend class conffwk::DalFactory;
25 friend class conffwk::DalRegistry;
26
27 protected:
28
30 virtual ~RCBroadcaster() 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
71 std::string m_type;
72 std::string m_address;
73 uint32_t m_publish_timeout;
74
75
76 public:
77
78 // attribute names
79
80 inline static const std::string s_type = "type";
81 inline static const std::string s_address = "address";
82 inline static const std::string s_publish_timeout = "publish_timeout";
83
84 static const std::string& __get_type_str() noexcept { return s_type; }
85 static const std::string& __get_address_str() noexcept { return s_address; }
86 static const std::string& __get_publish_timeout_str() noexcept { return s_publish_timeout; }
87
88
93 struct Type {
94 inline static const std::string Kafka = "kafka";
95 inline static const std::string Undefined = "undefined";
96 };
97
104 const std::string&
105 get_type() const
106 {
107 std::lock_guard scoped_lock(m_mutex);
108 check();
109 check_init();
110 return m_type;
111 }
112
119 void
120 set_type(const std::string& value)
121 {
122 std::lock_guard scoped_lock(m_mutex);
123 check();
124 clear();
125 p_obj.set_enum(s_type, value);
126 }
127
128
135 const std::string&
137 {
138 std::lock_guard scoped_lock(m_mutex);
139 check();
140 check_init();
141 return m_address;
142 }
143
150 void
151 set_address(const std::string& value)
152 {
153 std::lock_guard scoped_lock(m_mutex);
154 check();
155 clear();
156 p_obj.set_by_ref(s_address, value);
157 }
158
159
166 uint32_t
168 {
169 std::lock_guard scoped_lock(m_mutex);
170 check();
171 check_init();
172 return m_publish_timeout;
173 }
174
181 void
182 set_publish_timeout(uint32_t value)
183 {
184 std::lock_guard scoped_lock(m_mutex);
185 check();
186 clear();
188 }
189
190
191 };
192
193 // out stream operator
194
195 inline std::ostream& operator<<(std::ostream& s, const RCBroadcaster& obj)
196 {
197 return obj.print_object(s);
198 }
199
200 typedef std::vector<const RCBroadcaster*>::const_iterator RCBroadcasterIterator;
201
202 }
203}
204
205#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 & s_class_name
virtual void init(bool init_children)
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 ~RCBroadcaster() noexcept
uint32_t get_publish_timeout() const
Get "publish_timeout" attribute value.
static const std::string & __get_address_str() noexcept
const std::string & get_address() const
Get "address" attribute value.
void set_type(const std::string &value)
Set "type" attribute value.
void set_publish_timeout(uint32_t value)
Set "publish_timeout" attribute value.
const std::string & get_type() const
Get "type" attribute value.
RCBroadcaster(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
static const std::string & __get_type_str() noexcept
static const std::string s_publish_timeout
static const std::string s_address
static const std::string s_type
static const std::string & __get_publish_timeout_str() noexcept
void set_address(const std::string &value)
Set "address" attribute value.
conffwk entry point
double offset
std::vector< constRCBroadcaster * >::const_iterator RCBroadcasterIterator
std::ostream & operator<<(std::ostream &s, const ActionPlan &obj)
Including Qt Headers.