DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
OpMonConf.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _OpMonConf_0_dunedaq__confmodel_0_confmodel_H_
4#define _OpMonConf_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
17 // prologue of method OpMonConf::get_interval()
18
19#include <chrono>
20
21namespace dunedaq {
22 namespace confmodel {
23
24 class OpMonConf : public virtual dunedaq::conffwk::DalObject {
25
27 friend class conffwk::DalObject;
28 friend class conffwk::DalFactory;
30
31 protected:
32
34 virtual ~OpMonConf() noexcept;
35 virtual void init(bool init_children);
36
37 public:
38
41 static const std::string& s_class_name;
42
43
53 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
54
55
65 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
66
67
68 protected:
69
70 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
71
72
73 private:
74
75 uint32_t m_level;
76 uint32_t m_interval_s;
77
78
79 public:
80
81 // attribute names
82
83 inline static const std::string s_level = "level";
84 inline static const std::string s_interval_s = "interval_s";
85
86 static const std::string& __get_level_str() noexcept { return s_level; }
87 static const std::string& __get_interval_s_str() noexcept { return s_interval_s; }
88
89
97 uint32_t
98 get_level() const
99 {
100 std::lock_guard scoped_lock(m_mutex);
101 check();
102 check_init();
103 return m_level;
104 }
105
113 void
114 set_level(uint32_t value)
115 {
116 std::lock_guard scoped_lock(m_mutex);
117 check();
118 clear();
119 p_obj.set_by_val(s_level, value);
120 }
121
122
130 uint32_t
132 {
133 std::lock_guard scoped_lock(m_mutex);
134 check();
135 check_init();
136 return m_interval_s;
137 }
138
146 void
147 set_interval_s(uint32_t value)
148 {
149 std::lock_guard scoped_lock(m_mutex);
150 check();
151 clear();
153 }
154
155
156
157 public:
158
159 // user-defined algorithms
160
165 std::chrono::seconds get_interval() const ;
166 };
167
168 // out stream operator
169
170 inline std::ostream& operator<<(std::ostream& s, const OpMonConf& obj)
171 {
172 return obj.print_object(s);
173 }
174
175 typedef std::vector<const OpMonConf*>::const_iterator OpMonConfIterator;
176
177 }
178}
179
180#endif
void set_by_val(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...
void set_level(uint32_t value)
Set "level" attribute value. SystemOpMonLevel.
OpMonConf(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
Definition OpMonConf.cpp:26
static const std::string & __get_interval_s_str() noexcept
Definition OpMonConf.hpp:87
uint32_t get_level() const
Get "level" attribute value. SystemOpMonLevel.
Definition OpMonConf.hpp:98
static const std::string & s_class_name
Definition OpMonConf.hpp:41
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 OpMonConf.cpp:74
uint32_t get_interval_s() const
Get "interval_s" attribute value. interval in seconds between the collection of monitoring data in an...
friend class conffwk::DalFactory
Definition OpMonConf.hpp:28
static const std::string s_interval_s
Definition OpMonConf.hpp:84
std::chrono::seconds get_interval() const
void set_interval_s(uint32_t value)
Set "interval_s" attribute value. interval in seconds between the collection of monitoring data in an...
static const std::string & __get_level_str() noexcept
Definition OpMonConf.hpp:86
friend class conffwk::DalObject
Definition OpMonConf.hpp:27
virtual void init(bool init_children)
Definition OpMonConf.cpp:55
static const std::string s_level
Definition OpMonConf.hpp:83
virtual ~OpMonConf() noexcept
Definition OpMonConf.cpp:70
conffwk entry point
double offset
std::vector< constOpMonConf * >::const_iterator OpMonConfIterator
std::ostream & operator<<(std::ostream &s, const ActionPlan &obj)
Including Qt Headers.