DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
HermesModule.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _HermesModule_0_dunedaq__appmodel_0_appmodel_H_
4#define _HermesModule_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 // include files for classes used in inheritance hierarchy
17
20
21 // forward declaration for classes used in relationships and algorithms
22
23namespace dunedaq {
24 namespace appmodel {
25 class HermesDataSender;
26 }
27 namespace confmodel {
28 class NetworkInterface;
29 }
30}
31
32
33namespace dunedaq {
34 namespace appmodel {
35
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 ~HermesModule() 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
88 const dunedaq::confmodel::NetworkInterface* m_destination;
89
90
91 public:
92
93 // relationship names
94
95 inline static const std::string s_links = "links";
96 inline static const std::string s_destination = "destination";
97
98 static const std::string& __get_links_str() noexcept { return s_links; }
99 static const std::string& __get_destination_str() noexcept { return s_destination; }
100
101
108 const std::vector<const dunedaq::appmodel::HermesDataSender*>&
109 get_links() const
110 {
111 std::lock_guard scoped_lock(m_mutex);
112 check();
113 check_init();
114 if (m_links.empty())
115 {
116 std::ostringstream text;
117 text << "relationship \"" << s_links << "\" of object " << this << " is empty";
118 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
119 }
120 return m_links;
121 }
122
123
130 void
131 set_links(const std::vector<const dunedaq::appmodel::HermesDataSender*>& value);
132
141 {
142 std::lock_guard scoped_lock(m_mutex);
143 check();
144 check_init();
145 if (!m_destination)
146 {
147 std::ostringstream text;
148 text << "relationship \"" << s_destination << "\" of object " << this << " is not set";
149 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
150 }
151 return m_destination;
152 }
153
154
161 void
163
164 };
165
166 // out stream operator
167
168 inline std::ostream& operator<<(std::ostream& s, const HermesModule& obj)
169 {
170 return obj.print_object(s);
171 }
172
173 typedef std::vector<const HermesModule*>::const_iterator HermesModuleIterator;
174
175 }
176}
177
178#endif
#define ERS_HERE
const dunedaq::confmodel::NetworkInterface * get_destination() const
Get "destination" relationship value.
const std::vector< const dunedaq::appmodel::HermesDataSender * > & get_links() const
Get "links" relationship value.
static const std::string s_links
void set_links(const std::vector< const dunedaq::appmodel::HermesDataSender * > &value)
Set "links" relationship value.
virtual void init(bool init_children)
HermesModule(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
friend class conffwk::DalFactory
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...
static const std::string s_destination
const dunedaq::confmodel::NetworkInterface * m_destination
std::vector< const dunedaq::appmodel::HermesDataSender * > m_links
friend class conffwk::DalObject
void set_destination(const dunedaq::confmodel::NetworkInterface *value)
Set "destination" relationship value.
virtual ~HermesModule() noexcept
static const std::string & s_class_name
static const std::string & __get_destination_str() noexcept
static const std::string & __get_links_str() noexcept
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::vector< constHermesModule * >::const_iterator HermesModuleIterator
std::ostream & operator<<(std::ostream &s, const AVXAbsRunSumProcessor &obj)
Including Qt Headers.