CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MessageSender.h
Go to the documentation of this file.
1 #ifndef FWCore_MessageLogger_MessageSender_h
2 #define FWCore_MessageLogger_MessageSender_h
3 
7 
8 #include <memory>
9 
10 #include <map>
11 
12 // Change log
13 //
14 // 1 mf 8/25/08 error summary information for LoggedErrorsSummary()
15 //
16 // 2 mf 6/22/09 add severity to LoggedErrorsSummary by using
17 // ErrorSummaryEntry as map key
18 //
19 // 3 wmtan 6/22/11 Hold the ErrorObj with a shared pointer with a custom deleter.
20 // The custom deleter takes over the function of the message sending from the MessageSender destructor.
21 // This allows MessageSender to be copyable, which fixes the clang compilation errors.
22 
23 
24 namespace edm
25 {
26 
28 {
29  struct ErrorObjDeleter {
31  void operator()(ErrorObj * errorObjPtr);
32  };
33 
34 public:
35  // --- birth/death:
37  MessageSender( ELseverityLevel const & sev,
38  ELstring const & id,
39  bool verbatim = false, bool suppressed = false );
41 
42  // --- stream out the next part of a message:
43  template< class T >
45  operator<< ( T const & t )
46  {
47 #ifndef __GCCXML__
48  if (valid()) (*errorobj_p) << t;
49 #endif
50  return *this;
51  }
52 
53  bool valid() {
54  return errorobj_p != 0;
55  }
56 
57 private:
58  // data:
59  std::shared_ptr<ErrorObj> errorobj_p;
60 
61 }; // MessageSender
62 
63 
64 } // namespace edm
65 
66 
67 #endif // FWCore_MessageLogger_MessageSender_h
tuple t
Definition: tree.py:139
MessageSender & operator<<(T const &t)
Definition: MessageSender.h:45
std::shared_ptr< ErrorObj > errorobj_p
Definition: MessageSender.h:59
void operator()(ErrorObj *errorObjPtr)
long double T
std::string ELstring
Definition: ELstring.h:26