CMS 3D CMS Logo

TestServiceTwo.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 #ifndef FWCore_Integration_TestServiceTwo_h
3 #define FWCore_Integration_TestServiceTwo_h
4 //
5 // Package: FWCore/Integration
6 // Class : TestServiceTwo
7 //
8 // Implementation:
9 // Service initially intended for testing behavior after exceptions.
10 // ExceptionThrowingProducer uses this and is in the same test plugin
11 // library and could be used to access the service if it was ever useful
12 // for debugging issues related to begin/end transitions.
13 //
14 // This is almost identical to TestServiceOne. It was initially used to
15 // test that after a signal all services get executed even if one of the
16 // service functions throws.
17 //
18 //
19 // Original Author: W. David Dagenhart
20 // Created: 13 March 2024
21 
25 
26 #include <atomic>
27 
28 namespace edmtest {
29 
31  public:
33 
35 
38 
43 
48 
53 
58 
61 
66 
71 
76 
81 
84 
85  unsigned int nPreStreamBeginLumi() const;
86  unsigned int nPostStreamBeginLumi() const;
87  unsigned int nPreStreamEndLumi() const;
88  unsigned int nPostStreamEndLumi() const;
89 
90  unsigned int nPreModuleStreamBeginLumi() const;
91  unsigned int nPostModuleStreamBeginLumi() const;
92  unsigned int nPreModuleStreamEndLumi() const;
93  unsigned int nPostModuleStreamEndLumi() const;
94 
95  unsigned int nPreGlobalBeginLumi() const;
96  unsigned int nPostGlobalBeginLumi() const;
97  unsigned int nPreGlobalEndLumi() const;
98  unsigned int nPostGlobalEndLumi() const;
99 
100  unsigned int nPreModuleGlobalBeginLumi() const;
101  unsigned int nPostModuleGlobalBeginLumi() const;
102  unsigned int nPreModuleGlobalEndLumi() const;
103  unsigned int nPostModuleGlobalEndLumi() const;
104 
105  unsigned int nPreGlobalWriteLumi() const;
106  unsigned int nPostGlobalWriteLumi() const;
107 
108  unsigned int nPreStreamBeginRun() const;
109  unsigned int nPostStreamBeginRun() const;
110  unsigned int nPreStreamEndRun() const;
111  unsigned int nPostStreamEndRun() const;
112 
113  unsigned int nPreModuleStreamBeginRun() const;
114  unsigned int nPostModuleStreamBeginRun() const;
115  unsigned int nPreModuleStreamEndRun() const;
116  unsigned int nPostModuleStreamEndRun() const;
117 
118  unsigned int nPreGlobalBeginRun() const;
119  unsigned int nPostGlobalBeginRun() const;
120  unsigned int nPreGlobalEndRun() const;
121  unsigned int nPostGlobalEndRun() const;
122 
123  unsigned int nPreModuleGlobalBeginRun() const;
124  unsigned int nPostModuleGlobalBeginRun() const;
125  unsigned int nPreModuleGlobalEndRun() const;
126  unsigned int nPostModuleGlobalEndRun() const;
127 
128  unsigned int nPreGlobalWriteRun() const;
129  unsigned int nPostGlobalWriteRun() const;
130 
131  private:
132  bool verbose_;
134 
135  std::atomic<unsigned int> nPreStreamBeginLumi_ = 0;
136  std::atomic<unsigned int> nPostStreamBeginLumi_ = 0;
137  std::atomic<unsigned int> nPreStreamEndLumi_ = 0;
138  std::atomic<unsigned int> nPostStreamEndLumi_ = 0;
139 
140  std::atomic<unsigned int> nPreModuleStreamBeginLumi_ = 0;
141  std::atomic<unsigned int> nPostModuleStreamBeginLumi_ = 0;
142  std::atomic<unsigned int> nPreModuleStreamEndLumi_ = 0;
143  std::atomic<unsigned int> nPostModuleStreamEndLumi_ = 0;
144 
145  std::atomic<unsigned int> nPreGlobalBeginLumi_ = 0;
146  std::atomic<unsigned int> nPostGlobalBeginLumi_ = 0;
147  std::atomic<unsigned int> nPreGlobalEndLumi_ = 0;
148  std::atomic<unsigned int> nPostGlobalEndLumi_ = 0;
149 
150  std::atomic<unsigned int> nPreModuleGlobalBeginLumi_ = 0;
151  std::atomic<unsigned int> nPostModuleGlobalBeginLumi_ = 0;
152  std::atomic<unsigned int> nPreModuleGlobalEndLumi_ = 0;
153  std::atomic<unsigned int> nPostModuleGlobalEndLumi_ = 0;
154 
155  std::atomic<unsigned int> nPreGlobalWriteLumi_ = 0;
156  std::atomic<unsigned int> nPostGlobalWriteLumi_ = 0;
157 
158  std::atomic<unsigned int> nPreStreamBeginRun_ = 0;
159  std::atomic<unsigned int> nPostStreamBeginRun_ = 0;
160  std::atomic<unsigned int> nPreStreamEndRun_ = 0;
161  std::atomic<unsigned int> nPostStreamEndRun_ = 0;
162 
163  std::atomic<unsigned int> nPreModuleStreamBeginRun_ = 0;
164  std::atomic<unsigned int> nPostModuleStreamBeginRun_ = 0;
165  std::atomic<unsigned int> nPreModuleStreamEndRun_ = 0;
166  std::atomic<unsigned int> nPostModuleStreamEndRun_ = 0;
167 
168  std::atomic<unsigned int> nPreGlobalBeginRun_ = 0;
169  std::atomic<unsigned int> nPostGlobalBeginRun_ = 0;
170  std::atomic<unsigned int> nPreGlobalEndRun_ = 0;
171  std::atomic<unsigned int> nPostGlobalEndRun_ = 0;
172 
173  std::atomic<unsigned int> nPreModuleGlobalBeginRun_ = 0;
174  std::atomic<unsigned int> nPostModuleGlobalBeginRun_ = 0;
175  std::atomic<unsigned int> nPreModuleGlobalEndRun_ = 0;
176  std::atomic<unsigned int> nPostModuleGlobalEndRun_ = 0;
177 
178  std::atomic<unsigned int> nPreGlobalWriteRun_ = 0;
179  std::atomic<unsigned int> nPostGlobalWriteRun_ = 0;
180  };
181 } // namespace edmtest
182 #endif
void postModuleGlobalEndRun(edm::GlobalContext const &, edm::ModuleCallingContext const &)
std::atomic< unsigned int > nPostGlobalEndRun_
void preStreamBeginLumi(edm::StreamContext const &)
void postGlobalEndRun(edm::GlobalContext const &)
void preStreamEndLumi(edm::StreamContext const &)
unsigned int nPreStreamBeginRun() const
std::atomic< unsigned int > nPreModuleGlobalBeginLumi_
void preGlobalBeginLumi(edm::GlobalContext const &)
void postModuleStreamBeginRun(edm::StreamContext const &, edm::ModuleCallingContext const &)
unsigned int nPreStreamBeginLumi() const
std::atomic< unsigned int > nPreStreamBeginLumi_
unsigned int nPreModuleStreamBeginLumi() const
void preEndProcessBlock(edm::GlobalContext const &)
void preGlobalBeginRun(edm::GlobalContext const &)
std::atomic< unsigned int > nPreStreamBeginRun_
std::atomic< unsigned int > nPostStreamEndLumi_
std::atomic< unsigned int > nPreGlobalEndRun_
unsigned int nPreModuleGlobalBeginLumi() const
std::atomic< unsigned int > nPostModuleStreamBeginLumi_
std::atomic< unsigned int > nPreGlobalEndLumi_
unsigned int nPostGlobalEndLumi() const
std::atomic< unsigned int > nPreStreamEndLumi_
std::atomic< unsigned int > nPreModuleStreamBeginRun_
std::atomic< unsigned int > nPreModuleGlobalEndLumi_
unsigned int nPostStreamBeginLumi() const
std::atomic< unsigned int > nPostGlobalWriteLumi_
void preGlobalWriteRun(edm::GlobalContext const &)
unsigned int nPreGlobalEndRun() const
void preModuleStreamEndRun(edm::StreamContext const &, edm::ModuleCallingContext const &)
void postStreamBeginLumi(edm::StreamContext const &)
unsigned int nPreGlobalBeginLumi() const
void preGlobalEndRun(edm::GlobalContext const &)
std::atomic< unsigned int > nPreModuleGlobalEndRun_
std::atomic< unsigned int > nPreModuleStreamEndLumi_
std::atomic< unsigned int > nPreGlobalBeginLumi_
unsigned int nPostGlobalBeginLumi() const
unsigned int nPostStreamBeginRun() const
void preStreamEndRun(edm::StreamContext const &)
std::atomic< unsigned int > nPostModuleStreamEndLumi_
void preModuleGlobalEndRun(edm::GlobalContext const &, edm::ModuleCallingContext const &)
std::atomic< unsigned int > nPostModuleGlobalBeginLumi_
void preModuleGlobalBeginLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
std::atomic< unsigned int > nPreStreamEndRun_
TestServiceTwo(const edm::ParameterSet &, edm::ActivityRegistry &)
void preModuleGlobalBeginRun(edm::GlobalContext const &, edm::ModuleCallingContext const &)
void preStreamBeginRun(edm::StreamContext const &)
void preGlobalWriteLumi(edm::GlobalContext const &)
unsigned int nPreGlobalWriteRun() const
void postGlobalBeginLumi(edm::GlobalContext const &)
unsigned int nPostGlobalBeginRun() const
unsigned int nPreModuleStreamBeginRun() const
void postModuleStreamEndLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
void postGlobalWriteLumi(edm::GlobalContext const &)
unsigned int nPreGlobalBeginRun() const
void postStreamEndRun(edm::StreamContext const &)
std::atomic< unsigned int > nPostGlobalEndLumi_
unsigned int nPreStreamEndLumi() const
unsigned int nPreModuleGlobalBeginRun() const
void preModuleStreamBeginLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
void preModuleStreamBeginRun(edm::StreamContext const &, edm::ModuleCallingContext const &)
std::atomic< unsigned int > nPreModuleStreamBeginLumi_
unsigned int nPostModuleGlobalBeginLumi() const
void preModuleStreamEndLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
unsigned int nPreModuleGlobalEndLumi() const
std::atomic< unsigned int > nPostModuleStreamEndRun_
std::atomic< unsigned int > nPostGlobalWriteRun_
std::atomic< unsigned int > nPostModuleGlobalBeginRun_
void preModuleGlobalEndLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
std::atomic< unsigned int > nPreModuleStreamEndRun_
static void fillDescriptions(edm::ConfigurationDescriptions &)
unsigned int nPostModuleGlobalEndLumi() const
unsigned int nPostModuleStreamEndLumi() const
std::atomic< unsigned int > nPostModuleGlobalEndRun_
std::atomic< unsigned int > nPostStreamBeginRun_
unsigned int nPostGlobalWriteLumi() const
std::atomic< unsigned int > nPreModuleGlobalBeginRun_
unsigned int nPreGlobalWriteLumi() const
void postModuleGlobalBeginLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
unsigned int nPostStreamEndLumi() const
unsigned int nPostModuleGlobalBeginRun() const
std::atomic< unsigned int > nPostStreamEndRun_
std::atomic< unsigned int > nPreGlobalBeginRun_
unsigned int nPostModuleGlobalEndRun() const
unsigned int nPreStreamEndRun() const
unsigned int nPreModuleStreamEndRun() const
std::atomic< unsigned int > nPostModuleStreamBeginRun_
void postModuleGlobalEndLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
void postModuleGlobalBeginRun(edm::GlobalContext const &, edm::ModuleCallingContext const &)
void preBeginProcessBlock(edm::GlobalContext const &)
unsigned int nPostModuleStreamEndRun() const
void postGlobalWriteRun(edm::GlobalContext const &)
void postGlobalBeginRun(edm::GlobalContext const &)
void postGlobalEndLumi(edm::GlobalContext const &)
std::atomic< unsigned int > nPostGlobalBeginLumi_
unsigned int nPostStreamEndRun() const
unsigned int nPostGlobalWriteRun() const
unsigned int nPreModuleStreamEndLumi() const
void postModuleStreamBeginLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
void postStreamBeginRun(edm::StreamContext const &)
unsigned int nPreModuleGlobalEndRun() const
unsigned int nPostGlobalEndRun() const
std::atomic< unsigned int > nPreGlobalWriteLumi_
void preGlobalEndLumi(edm::GlobalContext const &)
void postModuleStreamEndRun(edm::StreamContext const &, edm::ModuleCallingContext const &)
void postStreamEndLumi(edm::StreamContext const &)
std::atomic< unsigned int > nPostModuleGlobalEndLumi_
std::atomic< unsigned int > nPostStreamBeginLumi_
unsigned int nPostModuleStreamBeginRun() const
std::atomic< unsigned int > nPostGlobalBeginRun_
unsigned int nPostModuleStreamBeginLumi() const
std::atomic< unsigned int > nPreGlobalWriteRun_
unsigned int nPreGlobalEndLumi() const