DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
CTBSockets.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _CTBSockets_0_dunedaq__appmodel_0_appmodel_H_
4#define _CTBSockets_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 CTBMonitorSocket;
22 class CTBReceiverSocket;
23 class CTBStatisticsSocket;
24 }
25}
26
27
28 // prologue of method CTBSockets::get_ctb_json()
29
30#include "nlohmann/json.hpp"
31#include <optional>
32
33namespace dunedaq {
34 namespace appmodel {
35
36 class CTBSockets : public virtual dunedaq::conffwk::DalObject {
37
38 friend class conffwk::Configuration;
39 friend class conffwk::DalObject;
40 friend class conffwk::DalFactory;
41 friend class conffwk::DalRegistry;
42
43 protected:
44
46 virtual ~CTBSockets() noexcept;
47 virtual void init(bool init_children);
48
49 public:
50
53 static const std::string& s_class_name;
54
55
65 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
66
67
77 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
78
79
80 protected:
81
82 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
83
84
85 private:
86
90
91
92 public:
93
94 // relationship names
95
96 inline static const std::string s_receiver = "receiver";
97 inline static const std::string s_monitor = "monitor";
98 inline static const std::string s_statistics = "statistics";
99
100 static const std::string& __get_receiver_str() noexcept { return s_receiver; }
101 static const std::string& __get_monitor_str() noexcept { return s_monitor; }
102 static const std::string& __get_statistics_str() noexcept { return s_statistics; }
103
104
113 {
114 std::lock_guard scoped_lock(m_mutex);
115 check();
116 check_init();
117 if (!m_receiver)
118 {
119 std::ostringstream text;
120 text << "relationship \"" << s_receiver << "\" of object " << this << " is not set";
121 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
122 }
123 return m_receiver;
124 }
125
126
133 void
135
144 {
145 std::lock_guard scoped_lock(m_mutex);
146 check();
147 check_init();
148 return m_monitor;
149 }
150
151
158 void
160
169 {
170 std::lock_guard scoped_lock(m_mutex);
171 check();
172 check_init();
173 return m_statistics;
174 }
175
176
183 void
185
186
187 public:
188
189 // user-defined algorithms
190
191 nlohmann::json get_ctb_json(std::optional<std::string> socket_host = std::nullopt) const;
192 };
193
194 // out stream operator
195
196 inline std::ostream& operator<<(std::ostream& s, const CTBSockets& obj)
197 {
198 return obj.print_object(s);
199 }
200
201 typedef std::vector<const CTBSockets*>::const_iterator CTBSocketsIterator;
202
203 }
204}
205
206#endif
#define ERS_HERE
static const std::string s_monitor
static const std::string & __get_monitor_str() noexcept
static const std::string & s_class_name
static const std::string s_statistics
void set_monitor(const dunedaq::appmodel::CTBMonitorSocket *value)
Set "monitor" relationship value.
nlohmann::json get_ctb_json(std::optional< std::string > socket_host=std::nullopt) const
static const std::string & __get_receiver_str() noexcept
void set_receiver(const dunedaq::appmodel::CTBReceiverSocket *value)
Set "receiver" relationship value.
const dunedaq::appmodel::CTBStatisticsSocket * m_statistics
const dunedaq::appmodel::CTBReceiverSocket * get_receiver() const
Get "receiver" relationship value.
static const std::string & __get_statistics_str() noexcept
friend class conffwk::DalFactory
virtual ~CTBSockets() noexcept
const dunedaq::appmodel::CTBStatisticsSocket * get_statistics() const
Get "statistics" relationship value.
static const std::string s_receiver
const dunedaq::appmodel::CTBReceiverSocket * m_receiver
void set_statistics(const dunedaq::appmodel::CTBStatisticsSocket *value)
Set "statistics" relationship value.
const dunedaq::appmodel::CTBMonitorSocket * m_monitor
CTBSockets(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
friend class conffwk::DalObject
virtual void init(bool init_children)
const dunedaq::appmodel::CTBMonitorSocket * get_monitor() const
Get "monitor" relationship value.
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...
The base class for any generated DAL object.
Definition DalObject.hpp:45
std::mutex m_mutex
Used to protect changes of DAL 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< constCTBSockets * >::const_iterator CTBSocketsIterator
Including Qt Headers.