DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DaphneMapEntry.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _DaphneMapEntry_0_dunedaq__appmodel_0_appmodel_H_
4#define _DaphneMapEntry_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 DaphneV2BoardConf;
22 }
23}
24
25
26namespace dunedaq {
27 namespace appmodel {
28
30
31 friend class conffwk::Configuration;
32 friend class conffwk::DalObject;
33 friend class conffwk::DalFactory;
34 friend class conffwk::DalRegistry;
35
36 protected:
37
39 virtual ~DaphneMapEntry() 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_key;
81 const dunedaq::appmodel::DaphneV2BoardConf* m_conf;
82
83
84 public:
85
86 // attribute names
87
88 inline static const std::string s_key = "key";
89
90 static const std::string& __get_key_str() noexcept { return s_key; }
91
92
100 const std::string&
101 get_key() const
102 {
103 std::lock_guard scoped_lock(m_mutex);
104 check();
105 check_init();
106 return m_key;
107 }
108
116 void
117 set_key(const std::string& value)
118 {
119 std::lock_guard scoped_lock(m_mutex);
120 check();
121 clear();
122 p_obj.set_by_ref(s_key, value);
123 }
124
125
126 // relationship names
127
128 inline static const std::string s_conf = "conf";
129
130 static const std::string& __get_conf_str() noexcept { return s_conf; }
131
132
140 get_conf() const
141 {
142 std::lock_guard scoped_lock(m_mutex);
143 check();
144 check_init();
145 if (!m_conf)
146 {
147 std::ostringstream text;
148 text << "relationship \"" << s_conf << "\" of object " << this << " is not set";
149 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
150 }
151 return m_conf;
152 }
153
154
161 void
163
164 };
165
166 // out stream operator
167
168 inline std::ostream& operator<<(std::ostream& s, const DaphneMapEntry& obj)
169 {
170 return obj.print_object(s);
171 }
172
173 typedef std::vector<const DaphneMapEntry*>::const_iterator DaphneMapEntryIterator;
174
175 }
176}
177
178#endif
#define ERS_HERE
const dunedaq::appmodel::DaphneV2BoardConf * get_conf() const
Get "conf" relationship value.
const std::string & get_key() const
Get "key" attribute value. Id of the board in the form of {det_id},{crate_id},{slot_id}...
void set_conf(const dunedaq::appmodel::DaphneV2BoardConf *value)
Set "conf" relationship value.
virtual void init(bool init_children)
static const std::string & s_class_name
static const std::string s_conf
DaphneMapEntry(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
virtual ~DaphneMapEntry() noexcept
static const std::string & __get_conf_str() noexcept
void set_key(const std::string &value)
Set "key" attribute value. Id of the board in the form of {det_id},{crate_id},{slot_id}...
const dunedaq::appmodel::DaphneV2BoardConf * m_conf
static const std::string s_key
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 & __get_key_str() noexcept
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< constDaphneMapEntry * >::const_iterator DaphneMapEntryIterator
The DUNE-DAQ namespace.
msgpack::object obj