CMS 3D CMS Logo

RootHandlers.h
Go to the documentation of this file.
1 #ifndef FWCore_Utilities_RootHandlers_h
2 #define FWCore_Utilities_RootHandlers_h
3 
5 namespace edm {
6  class EventProcessor;
7  class RootHandlers {
8  public:
9  enum class SeverityLevel {
10  kInfo,
11  kWarning,
12  kError,
13  kSysError,
14  kFatal
15  };
16 
17  private:
18  struct WarningSentry {
19  WarningSentry(RootHandlers* iHandler, SeverityLevel level): m_handler(iHandler){
20  m_handler->ignoreWarnings_(level);
21  };
23  m_handler->enableWarnings_();
24  }
26  };
28  friend class edm::EventProcessor;
29 
30  public:
31  virtual ~RootHandlers () {}
32 
33  template<typename F>
35  WarningSentry sentry(this,level);
36  iFunc();
37  }
38 
39  private:
40  virtual void willBeUsingThreads() = 0;
41 
42  virtual void enableWarnings_() = 0;
43  virtual void ignoreWarnings_(SeverityLevel level) = 0;
44  };
45 } // end of namespace edm
46 
47 #endif // InitRootHandlers_H
virtual void ignoreWarnings_(SeverityLevel level)=0
virtual void willBeUsingThreads()=0
virtual void enableWarnings_()=0
edm::propagate_const< RootHandlers * > m_handler
Definition: RootHandlers.h:25
WarningSentry(RootHandlers *iHandler, SeverityLevel level)
Definition: RootHandlers.h:19
void ignoreWarningsWhileDoing(F iFunc, SeverityLevel level=SeverityLevel::kWarning)
Definition: RootHandlers.h:34
HLT enums.
virtual ~RootHandlers()
Definition: RootHandlers.h:31
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281