DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DummyD2D.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _DummyD2D_0_dunedaq__confmodel_0_confmodel_H_
4#define _DummyD2D_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 DetDataReceiver;
25 class DetDataSender;
26 class DummyReceiver;
27 class DummySender;
28 }
29}
30
31
32namespace dunedaq {
33 namespace confmodel {
34
36
37 friend class conffwk::Configuration;
38 friend class conffwk::DalObject;
39 friend class conffwk::DalFactory;
40 friend class conffwk::DalRegistry;
41
42 protected:
43
45 virtual ~DummyD2D() noexcept;
46 virtual void init(bool init_children);
47
48 public:
49
52 static const std::string& s_class_name;
53
54
64 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
65
66
76 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
77
78
79 protected:
80
81 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
82
83
84 private:
85
88
89
90 public:
91
92 // relationship names
93
94 inline static const std::string s_dummy_senders = "dummy_senders";
95 inline static const std::string s_dummy_receiver = "dummy_receiver";
96
97 static const std::string& __get_dummy_senders_str() noexcept { return s_dummy_senders; }
98 static const std::string& __get_dummy_receiver_str() noexcept { return s_dummy_receiver; }
99
100
107 const std::vector<const dunedaq::confmodel::DummySender*>&
109 {
110 std::lock_guard scoped_lock(m_mutex);
111 check();
112 check_init();
113 if (m_dummy_senders.empty())
114 {
115 std::ostringstream text;
116 text << "relationship \"" << s_dummy_senders << "\" of object " << this << " is empty";
117 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
118 }
119 return m_dummy_senders;
120 }
121
122
129 void
130 set_dummy_senders(const std::vector<const dunedaq::confmodel::DummySender*>& value);
131
140 {
141 std::lock_guard scoped_lock(m_mutex);
142 check();
143 check_init();
144 if (!m_dummy_receiver)
145 {
146 std::ostringstream text;
147 text << "relationship \"" << s_dummy_receiver << "\" of object " << this << " is not set";
148 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
149 }
150 return m_dummy_receiver;
151 }
152
153
160 void
162
163
164 public:
165
166 // user-defined algorithms
167
168 virtual std::vector<const DetDataSender*> senders() const override;
169
170
171 const confmodel::DetDataReceiver* receiver() const override;
172 };
173
174 // out stream operator
175
176 inline std::ostream& operator<<(std::ostream& s, const DummyD2D& obj)
177 {
178 return obj.print_object(s);
179 }
180
181 typedef std::vector<const DummyD2D*>::const_iterator DummyD2DIterator;
182
183 }
184}
185
186#endif
#define ERS_HERE
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.
std::vector< const dunedaq::confmodel::DummySender * > m_dummy_senders
Definition DummyD2D.hpp:86
void set_dummy_receiver(const dunedaq::confmodel::DummyReceiver *value)
Set "dummy_receiver" relationship value.
static const std::string & __get_dummy_receiver_str() noexcept
Definition DummyD2D.hpp:98
void set_dummy_senders(const std::vector< const dunedaq::confmodel::DummySender * > &value)
Set "dummy_senders" relationship value.
const confmodel::DetDataReceiver * receiver() const override
const std::vector< const dunedaq::confmodel::DummySender * > & get_dummy_senders() const
Get "dummy_senders" relationship value.
Definition DummyD2D.hpp:108
virtual void init(bool init_children)
Definition DummyD2D.cpp:69
static const std::string s_dummy_receiver
Definition DummyD2D.hpp:95
const dunedaq::confmodel::DummyReceiver * get_dummy_receiver() const
Get "dummy_receiver" relationship value.
Definition DummyD2D.hpp:139
friend class conffwk::DalFactory
Definition DummyD2D.hpp:39
static const std::string & __get_dummy_senders_str() noexcept
Definition DummyD2D.hpp:97
virtual std::vector< const DetDataSender * > senders() const override
static const std::string s_dummy_senders
Definition DummyD2D.hpp:94
virtual ~DummyD2D() noexcept
const dunedaq::confmodel::DummyReceiver * m_dummy_receiver
Definition DummyD2D.hpp:87
friend class conffwk::DalObject
Definition DummyD2D.hpp:38
DummyD2D(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
static const std::string & s_class_name
Definition DummyD2D.hpp:52
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...
Definition DummyD2D.cpp:88
conffwk entry point
double offset
std::vector< constDummyD2D * >::const_iterator DummyD2DIterator
Definition DummyD2D.hpp:181
std::ostream & operator<<(std::ostream &s, const ActionPlan &obj)
The DUNE-DAQ namespace.
Definition DataStore.hpp:57
msgpack::object obj