CMS 3D CMS Logo

List of all members | Public Member Functions
edm::MessageSender::ErrorObjDeleter Struct Reference

Public Member Functions

 ErrorObjDeleter ()
 
void operator() (ErrorObj *errorObjPtr)
 

Detailed Description

Definition at line 26 of file MessageSender.h.

Constructor & Destructor Documentation

edm::MessageSender::ErrorObjDeleter::ErrorObjDeleter ( )
inline

Definition at line 27 of file MessageSender.h.

References operator()().

27 {}

Member Function Documentation

void MessageSender::ErrorObjDeleter::operator() ( ErrorObj errorObjPtr)

Definition at line 93 of file MessageSender.cc.

References MessageLogger_cfi::cerr, drop, edm::ELwarning, errorSummaryIsBeingKept, errorSummaryMaps, mps_fire::i, edm::ELextendedID::id, edm::MessageDrop::instance(), crabWrapper::key, SiStripPI::max, edm::MessageLoggerQ::MLqLOG(), edm::ELextendedID::module, edm::MessageDrop::moduleContext(), edm::MessageDrop::runEvent, edm::ErrorObj::setContext(), edm::ErrorObj::setModule(), edm::ELextendedID::severity, edm::MessageDrop::streamID, and edm::ErrorObj::xid().

Referenced by ErrorObjDeleter().

93  {
94  if (errorObjPtr == nullptr) {
95  return;
96  }
97  try {
98  //std::cout << "MessageSender dtor; ErrorObj at: " << errorobj_p << '\n';
99 
100  // surrender ownership of our ErrorObj, transferring ownership
101  // (via the intermediate MessageLoggerQ) to the MessageLoggerScribe
102  // that will (a) route the message text to its destination(s)
103  // and will then (b) dispose of the ErrorObj
104 
106  if (drop) {
107  errorObjPtr->setModule(drop->moduleContext()); // change log
108  errorObjPtr->setContext(drop->runEvent);
109  }
110 #ifdef TRACE_DROP
111  if (!drop)
112  std::cerr << "MessageSender::~MessageSender() - Null drop pointer \n";
113 #endif
114  // change log 1
115  if (errorSummaryIsBeingKept.load(std::memory_order_acquire) && errorObjPtr->xid().severity >= ELwarning && drop &&
117  auto& errorSummaryMap = errorSummaryMaps[drop->streamID];
118 
119  ELextendedID const& xid = errorObjPtr->xid();
120  ErrorSummaryMapKey key{xid.id, xid.module, xid.severity};
121  auto i = errorSummaryMap.find(key);
122  if (i != errorSummaryMap.end()) {
123  i->second.value().fetch_add(1, std::memory_order_acq_rel); // same as ++errorSummaryMap[key]
124  } else {
125  errorSummaryMap[key].value().store(1, std::memory_order_release);
126  }
127  }
128 
129  MessageLoggerQ::MLqLOG(errorObjPtr);
130  } catch (...) {
131  // nothing to do
132 
133  // for test that removal of thread-involved static works,
134  // simply throw here, then run in trivial_main in totalview
135  // and Next or Step so that the exception would be detected.
136  // That test has been done 12/14/07.
137  }
138 }
static std::vector< tbb::concurrent_unordered_map< ErrorSummaryMapKey, AtomicUnsignedInt, ErrorSummaryMapKey::key_hash > > errorSummaryMaps
ELseverityLevel severity
Definition: ELextendedID.h:29
static MessageDrop * instance()
Definition: MessageDrop.cc:59
ELslProxy< ELwarningGen > const ELwarning
virtual void setContext(const ELstring &context)
Definition: ErrorObj.cc:167
const ELextendedID & xid() const
Definition: ErrorObj.cc:133
unsigned int streamID
Definition: MessageDrop.h:101
std::string moduleContext()
Definition: MessageDrop.cc:195
const int drop
static std::atomic< bool > errorSummaryIsBeingKept
static void MLqLOG(ErrorObj *p)
std::string runEvent
Definition: MessageDrop.h:100
virtual void setModule(const ELstring &module)
Definition: ErrorObj.cc:165