DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
SubscriptionCriteria.cpp
Go to the documentation of this file.
1//
2// DUNE DAQ modification notice:
3// This file has been modified from the original ATLAS config source for the DUNE DAQ project.
4// Fork baseline commit: 67a24e731 (2022-10-27).
5// Renamed since fork: no.
6//
7
10
11namespace dunedaq {
12namespace conffwk {
13
14void
15ConfigurationSubscriptionCriteria::add(const std::string& class_name)
16{
17 m_classes_subscription.insert(class_name);
18}
19
20void
21ConfigurationSubscriptionCriteria::add(const std::string& class_name, const std::string& object_id)
22{
23 m_objects_subscription[class_name].insert(object_id);
24}
25
26void
28{
29 add(object.class_name(), object.UID());
30}
31
32void
33ConfigurationSubscriptionCriteria::remove(const std::string& class_name)
34{
35 m_classes_subscription.erase(class_name);
36}
37
38void
39ConfigurationSubscriptionCriteria::remove(const std::string& class_name, const std::string& object_id)
40{
41 ObjectMap::iterator i = m_objects_subscription.find(class_name);
42 if (i != m_objects_subscription.end())
43 {
44 i->second.erase(object_id);
45 if (i->second.empty())
46 {
48 }
49 }
50}
51
52void
54{
55 remove(object.class_name(), object.UID());
56}
57
58std::ostream&
59operator<<(std::ostream& s, const ConfigurationSubscriptionCriteria& criteria)
60{
61 s << "Subscription criteria:\n";
62
63 // print out classes subscription
64 s << " classes subscription: ";
65
66 if (criteria.get_classes_subscription().empty())
67 {
68 s << "(null)\n";
69 }
70 else
71 {
72 s << std::endl;
73 for (const auto& i : criteria.get_classes_subscription())
74 {
75 s << " \"" << i << "\"\n";
76 }
77 }
78
79 // print out objects subscription
80 s << " objects subscription: ";
81
82 if (criteria.get_objects_subscription().empty())
83 {
84 s << "(null)\n";
85 }
86 else
87 {
88 s << std::endl;
89 for (const auto& i : criteria.get_objects_subscription())
90 {
91 s << " objects of class \"" << i.first << "\":\n";
92 for (const auto& j : i.second)
93 {
94 s << " \"" << j << "\":\n";
95 }
96 }
97 }
98
99 return s;
100}
101} // namespace conffwk
102} // namespace dunedaq
void add(const std::string &class_name)
Add subscribtion on class changes.
const std::set< std::string > & get_classes_subscription() const
void remove(const std::string &class_name)
Remove subscribtion on class changes.
The base class for any generated DAL object.
Definition DalObject.hpp:52
std::ostream & operator<<(std::ostream &, const ConfigurationChange &)
Including Qt Headers.
Definition module.cpp:16