DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
IpbusDevice.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _IpbusDevice_0_dunedaq__appmodel_0_appmodel_H_
4#define _IpbusDevice_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 appmodel {
21 class IpbusAddressTable;
22 }
23}
24
25
26namespace dunedaq {
27 namespace appmodel {
28
29 class IpbusDevice : public virtual dunedaq::conffwk::DalObject {
30
32 friend class conffwk::DalObject;
33 friend class conffwk::DalFactory;
35
36 protected:
37
39 virtual ~IpbusDevice() 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_uri;
81 uint32_t m_timeout_ms;
83
84
85 public:
86
87 // attribute names
88
89 inline static const std::string s_uri = "uri";
90 inline static const std::string s_timeout_ms = "timeout_ms";
91
92 static const std::string& __get_uri_str() noexcept { return s_uri; }
93 static const std::string& __get_timeout_ms_str() noexcept { return s_timeout_ms; }
94
95
102 const std::string&
103 get_uri() const
104 {
105 std::lock_guard scoped_lock(m_mutex);
106 check();
107 check_init();
108 return m_uri;
109 }
110
117 void
118 set_uri(const std::string& value)
119 {
120 std::lock_guard scoped_lock(m_mutex);
121 check();
122 clear();
123 p_obj.set_by_ref(s_uri, value);
124 }
125
126
134 uint32_t
136 {
137 std::lock_guard scoped_lock(m_mutex);
138 check();
139 check_init();
140 return m_timeout_ms;
141 }
142
150 void
151 set_timeout_ms(uint32_t value)
152 {
153 std::lock_guard scoped_lock(m_mutex);
154 check();
155 clear();
157 }
158
159
160 // relationship names
161
162 inline static const std::string s_address_table = "address_table";
163
164 static const std::string& __get_address_table_str() noexcept { return s_address_table; }
165
166
175 {
176 std::lock_guard scoped_lock(m_mutex);
177 check();
178 check_init();
179 if (!m_address_table)
180 {
181 std::ostringstream text;
182 text << "relationship \"" << s_address_table << "\" of object " << this << " is not set";
183 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
184 }
185 return m_address_table;
186 }
187
188
195 void
197
198 };
199
200 // out stream operator
201
202 inline std::ostream& operator<<(std::ostream& s, const IpbusDevice& obj)
203 {
204 return obj.print_object(s);
205 }
206
207 typedef std::vector<const IpbusDevice*>::const_iterator IpbusDeviceIterator;
208
209 }
210}
211
212#endif
#define ERS_HERE
void set_timeout_ms(uint32_t value)
Set "timeout_ms" attribute value. IPBus device timeout.
static const std::string & s_class_name
static const std::string s_address_table
static const std::string s_uri
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 init(bool init_children)
const dunedaq::appmodel::IpbusAddressTable * get_address_table() const
Get "address_table" relationship value.
static const std::string s_timeout_ms
const std::string & get_uri() const
Get "uri" attribute value.
const dunedaq::appmodel::IpbusAddressTable * m_address_table
friend class conffwk::DalFactory
virtual ~IpbusDevice() noexcept
void set_uri(const std::string &value)
Set "uri" attribute value.
friend class conffwk::DalObject
void set_address_table(const dunedaq::appmodel::IpbusAddressTable *value)
Set "address_table" relationship value.
static const std::string & __get_address_table_str() noexcept
static const std::string & __get_uri_str() noexcept
uint32_t get_timeout_ms() const
Get "timeout_ms" attribute value. IPBus device timeout.
IpbusDevice(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
static const std::string & __get_timeout_ms_str() noexcept
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...
Generic configuration exception.
conffwk entry point
double offset
std::ostream & operator<<(std::ostream &s, const AVXAbsRunSumProcessor &obj)
std::vector< constIpbusDevice * >::const_iterator IpbusDeviceIterator
Including Qt Headers.
Unsupported std::string uri Execution of command std::string error Failed to create CommandFacility uri
Definition Issues.hpp:77