CMS 3D CMS Logo

MessageSender.h
Go to the documentation of this file.
1 #ifndef FWCore_MessageLogger_MessageSender_h
2 #define FWCore_MessageLogger_MessageSender_h
3 
6 
7 #include <memory>
8 
9 #include <map>
10 
11 namespace edm {
12 
13  class MessageSender {
14  struct ErrorObjDeleter {
16  void operator()(ErrorObj* errorObjPtr);
17  };
18 
19  public:
20  // --- birth/death:
21  MessageSender() = default;
23  std::string_view id,
24  bool verbatim = false,
25  bool suppressed = false);
26  MessageSender(MessageSender&&) = default;
27  MessageSender(MessageSender const&) = default;
29  MessageSender& operator=(MessageSender const&) = default;
31 
32  // --- stream out the next part of a message:
33  template <class T>
35  if (valid())
36  (*errorobj_p) << t;
37  return *this;
38  }
39 
40  template <typename... Args>
41  MessageSender& format(std::string_view fmt, Args const&... args) {
42  if (valid())
43  errorobj_p->format(fmt, args...);
44  return *this;
45  }
46 
47  bool valid() const noexcept { return errorobj_p != nullptr; }
48 
49  private:
50  // data:
51  std::shared_ptr<ErrorObj> errorobj_p;
52 
53  }; // MessageSender
54 
55 } // namespace edm
56 
57 #endif // FWCore_MessageLogger_MessageSender_h
writedatasetfile.args
args
Definition: writedatasetfile.py:18
edm::MessageSender::format
MessageSender & format(std::string_view fmt, Args const &... args)
Definition: MessageSender.h:41
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ErrorObj
Definition: ErrorObj.h:43
edm::MessageSender::operator<<
MessageSender & operator<<(T const &t)
Definition: MessageSender.h:34
ELseverityLevel.h
edm::MessageSender::valid
bool valid() const noexcept
Definition: MessageSender.h:47
ErrorObj.h
watchdog.const
const
Definition: watchdog.py:83
edm::MessageSender::~MessageSender
~MessageSender()
Definition: MessageSender.cc:140
edm::MessageSender::ErrorObjDeleter::operator()
void operator()(ErrorObj *errorObjPtr)
Definition: MessageSender.cc:94
edm::MessageSender::ErrorObjDeleter::ErrorObjDeleter
ErrorObjDeleter()
Definition: MessageSender.h:15
edm::MessageSender::ErrorObjDeleter
Definition: MessageSender.h:14
edm::MessageSender
Definition: MessageSender.h:13
edm::MessageSender::operator=
MessageSender & operator=(MessageSender &&)=default
T
long double T
Definition: Basic3DVectorLD.h:48
edm::messagelogger::ELseverityLevel
Definition: ELseverityLevel.h:26
edm::MessageSender::MessageSender
MessageSender()=default
edm::MessageSender::errorobj_p
std::shared_ptr< ErrorObj > errorobj_p
Definition: MessageSender.h:51
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644