DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
disabled-components.hpp
Go to the documentation of this file.
1#ifndef DUNEDAQDAL_DISABLED_COMPONENTS_H
2#define DUNEDAQDAL_DISABLED_COMPONENTS_H
3
4#include <string>
5#include <vector>
6
9
11
13
14 class Session;
15 class ResourceSet;
16 // class Segment;
17
19 {
20
21 friend class Session;
22 friend class Component;
23
24 private:
25
27 {
28 bool
29 operator()(const std::string * s1, const std::string * s2) const
30 {
31 return (*s1 < *s2);
32 }
33 };
34
37
40
41 std::set<const std::string *, SortStringPtr> m_disabled;
42 std::set<const dunedaq::confmodel::Component *> m_user_disabled;
43 std::set<const dunedaq::confmodel::Component *> m_user_enabled;
44
45 void
46 __clear() noexcept
47 {
48 m_disabled.clear();
49 m_user_disabled.clear();
50 m_user_enabled.clear();
53 }
54
55 public:
56
58
59 virtual
61
62 void
63 notify(std::vector<dunedaq::conffwk::ConfigurationChange *>& /*changes*/) noexcept;
64
65 void
66 load() noexcept;
67
68 void
69 unload() noexcept;
70
71 void
72 update(const dunedaq::conffwk::ConfigObject& obj, const std::string& name) noexcept;
73
74 void
75 reset() noexcept;
76
77 size_t
78 size() noexcept
79 {
80 return m_disabled.size();
81 }
82
83 void
85 {
86 m_disabled.insert(&c.UID());
87 }
88
89 bool
91 return (m_disabled.find(&c->UID()) == m_disabled.end());
92 }
93
94 void
96
97 void
99
100 static unsigned long
102
103 };
104} // namespace dunedaq::confmodel
105
106#endif // DUNEDAQDAL_DISABLED_COMPONENTS_H
Defines base class for cache of template objects.
std::set< const std::string *, SortStringPtr > m_disabled
dunedaq::conffwk::Configuration & m_db
DisabledComponents(dunedaq::conffwk::Configuration &db, Session *session)
void load() noexcept
Call action on database file(s) load.
void unload() noexcept
Call action on database file(s) unload.
void disable_children(const dunedaq::confmodel::ResourceSet &)
std::set< const dunedaq::confmodel::Component * > m_user_enabled
void update(const dunedaq::conffwk::ConfigObject &obj, const std::string &name) noexcept
Call action on database object modification by user's code.
void notify(std::vector< dunedaq::conffwk::ConfigurationChange * > &) noexcept
Call action on database changes.
static unsigned long get_num_of_slr_resources(const dunedaq::confmodel::Session &p)
std::set< const dunedaq::confmodel::Component * > m_user_disabled
bool is_enabled(const dunedaq::confmodel::Component *c)
void disable(const dunedaq::confmodel::Component &c)
conffwk entry point
Including Qt Headers.
bool operator()(const std::string *s1, const std::string *s2) const