CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::ErrorObj Class Reference

#include <ErrorObj.h>

Public Member Functions

virtual void clear ()
 
ELstring context () const
 
virtual ErrorObjemitToken (const ELstring &txt)
 
 ErrorObj (const ELseverityLevel &sev, const ELstring &id, bool verbatim=false)
 
 ErrorObj (const ErrorObj &orig)
 
ELstring fullText () const
 
const ELstringidOverflow () const
 
bool is_verbatim () const
 
const ELlist_stringitems () const
 
ErrorObjoperator<< (std::ostream &(*f)(std::ostream &))
 
ErrorObjoperator<< (std::ios_base &(*f)(std::ios_base &))
 
ErrorObjoperator= (const ErrorObj &other)
 
template<class T >
ErrorObjopltlt (const T &t)
 
ErrorObjopltlt (const char s[])
 
bool reactedTo () const
 
int serial () const
 
virtual void set (const ELseverityLevel &sev, const ELstring &id)
 
virtual void setContext (const ELstring &context)
 
virtual void setID (const ELstring &ID)
 
virtual void setModule (const ELstring &module)
 
virtual void setReactedTo (bool r)
 
virtual void setSeverity (const ELseverityLevel &sev)
 
virtual void setSubroutine (const ELstring &subroutine)
 
void swap (ErrorObj &other)
 
time_t timestamp () const
 
const ELextendedIDxid () const
 
virtual ~ErrorObj ()
 

Private Attributes

std::string emptyString
 
ELstring myContext
 
ELstring myIdOverflow
 
ELlist_string myItems
 
std::ostringstream myOs
 
bool myReactedTo
 
int mySerial
 
time_t myTimestamp
 
ELextendedID myXid
 
bool verbatim
 

Detailed Description

Definition at line 44 of file ErrorObj.h.

Constructor & Destructor Documentation

edm::ErrorObj::ErrorObj ( const ELseverityLevel sev,
const ELstring id,
bool  verbatim = false 
)

Definition at line 74 of file ErrorObj.cc.

References MessageLogger_cfi::cerr, clear(), and triggerObjects_cff::id.

74  : verbatim(verbat) {
75 #ifdef ErrorObjCONSTRUCTOR_TRACE
76  std::cerr << "Constructor for ErrorObj\n";
77 #endif
78 
79  clear();
80  set(sev, id);
81 
82  } // ErrorObj()
virtual void clear()
Definition: ErrorObj.cc:218
bool verbatim
Definition: ErrorObj.h:102
edm::ErrorObj::ErrorObj ( const ErrorObj orig)

Definition at line 84 of file ErrorObj.cc.

References MessageLogger_cfi::cerr.

85  : mySerial(orig.mySerial),
86  myXid(orig.myXid),
87  myIdOverflow(orig.myIdOverflow),
88  myTimestamp(orig.myTimestamp),
89  myItems(orig.myItems),
90  myReactedTo(orig.myReactedTo),
91  myOs(),
92  emptyString(),
93  verbatim(orig.verbatim) {
94 #ifdef ErrorObjCONSTRUCTOR_TRACE
95  std::cerr << "Copy Constructor for ErrorObj\n";
96 #endif
97 
98  } // ErrorObj(ErrorObj)
std::string emptyString
Definition: ErrorObj.h:101
time_t myTimestamp
Definition: ErrorObj.h:96
ELstring myIdOverflow
Definition: ErrorObj.h:95
ELlist_string myItems
Definition: ErrorObj.h:97
ELextendedID myXid
Definition: ErrorObj.h:94
std::ostringstream myOs
Definition: ErrorObj.h:100
bool verbatim
Definition: ErrorObj.h:102
bool myReactedTo
Definition: ErrorObj.h:98
int mySerial
Definition: ErrorObj.h:93
edm::ErrorObj::~ErrorObj ( )
virtual

Definition at line 100 of file ErrorObj.cc.

References MessageLogger_cfi::cerr.

100  {
101 #ifdef ErrorObjCONSTRUCTOR_TRACE
102  std::cerr << "Destructor for ErrorObj\n";
103 #endif
104 
105  } // ~ErrorObj()

Member Function Documentation

void edm::ErrorObj::clear ( void  )
virtual

Definition at line 218 of file ErrorObj.cc.

References edm::ELextendedID::clear(), myIdOverflow, myItems, myReactedTo, mySerial, myTimestamp, and myXid.

Referenced by ErrorObj(), edm::service::ThreadSafeLogMessageLoggerScribe::log(), and set().

218  {
219  mySerial = 0;
220  myXid.clear();
221  myIdOverflow = "";
222  myTimestamp = 0;
223  myItems.erase(myItems.begin(), myItems.end()); // myItems.clear();
224  myReactedTo = false;
225 
226  } // clear()
time_t myTimestamp
Definition: ErrorObj.h:96
ELstring myIdOverflow
Definition: ErrorObj.h:95
ELlist_string myItems
Definition: ErrorObj.h:97
ELextendedID myXid
Definition: ErrorObj.h:94
bool myReactedTo
Definition: ErrorObj.h:98
int mySerial
Definition: ErrorObj.h:93
ELstring edm::ErrorObj::context ( ) const

Definition at line 140 of file ErrorObj.cc.

References myContext.

Referenced by edm::service::ELoutput::log(), and edm::service::ELstatistics::log().

140 { return myContext; }
ELstring myContext
Definition: ErrorObj.h:99
ErrorObj & edm::ErrorObj::emitToken ( const ELstring txt)
virtual

Definition at line 182 of file ErrorObj.cc.

References MessageLogger_cfi::cerr, edm::eq_nocase(), myItems, and setSubroutine().

Referenced by opltlt().

182  {
183 #ifdef ErrorObj_EMIT_TRACE
184  std::cerr << "=:=:=: ErrorObj::emitToken( " << s << " )\n";
185 #endif
186 
187 #ifdef ErrorObj_SUB_TRACE
188  if (subN > 0) {
189  std::cerr << "=:=:=: subN ErrorObj::emitToken( " << s << " )\n";
190  subN--;
191  }
192 #endif
193 
194  if (eq_nocase(s.substr(0, 5), "@SUB=")) {
195 #ifdef ErrorObj_SUB_TRACE
196  std::cerr << "=:=:=: ErrorObj::@SUB s.substr(5) is: " << s.substr(5) << '\n';
197 #endif
198  setSubroutine(s.substr(5));
199  } else {
200  myItems.push_back(s);
201  }
202 
203  return *this;
204 
205  } // emitToken()
virtual void setSubroutine(const ELstring &subroutine)
Definition: ErrorObj.cc:169
ELlist_string myItems
Definition: ErrorObj.h:97
bool eq_nocase(const ELstring &s1, const char s2[])
Definition: ELstring.cc:21
ELstring edm::ErrorObj::fullText ( ) const

Definition at line 142 of file ErrorObj.cc.

References myItems, and mps_fire::result.

142  {
144  for (ELlist_string::const_iterator it = myItems.begin(); it != myItems.end(); ++it)
145  result += *it;
146  return result;
147 
148  } // fullText()
ELlist_string myItems
Definition: ErrorObj.h:97
std::string ELstring
Definition: ELstring.h:21
const ELstring & edm::ErrorObj::idOverflow ( ) const

Definition at line 134 of file ErrorObj.cc.

References myIdOverflow.

Referenced by edm::service::ELoutput::log().

134 { return myIdOverflow; }
ELstring myIdOverflow
Definition: ErrorObj.h:95
bool edm::ErrorObj::is_verbatim ( ) const

Definition at line 138 of file ErrorObj.cc.

References verbatim.

Referenced by edm::service::ELoutput::log().

138 { return verbatim; }
bool verbatim
Definition: ErrorObj.h:102
const ELlist_string & edm::ErrorObj::items ( ) const
ErrorObj& edm::ErrorObj::operator<< ( std::ostream &(*)(std::ostream &)  f)
inline
ErrorObj& edm::ErrorObj::operator<< ( std::ios_base &(*)(std::ios_base &)  f)
inline
ErrorObj & edm::ErrorObj::operator= ( const ErrorObj other)

Definition at line 107 of file ErrorObj.cc.

References swap(), and groupFilesInBlocks::temp.

107  {
109  this->swap(temp);
110  return *this;
111  }
ErrorObj(const ELseverityLevel &sev, const ELstring &id, bool verbatim=false)
Definition: ErrorObj.cc:74
void swap(ErrorObj &other)
Definition: ErrorObj.cc:113
template<class T >
ErrorObj& edm::ErrorObj::opltlt ( const T t)
inline

Referenced by edm::operator<<().

ErrorObj & edm::ErrorObj::opltlt ( const char  s[])

Definition at line 228 of file ErrorObj.cc.

References emitToken(), emptyString, myOs, alignCSCRings::s, and verbatim.

228  {
229  // Exactly equivalent to the general template.
230  // If this is not provided explicitly, then the template will
231  // be instantiated once for each length of string ever used.
232  myOs.str(emptyString);
233  myOs << s;
234 #ifdef OLD_STYLE_AUTOMATIC_SPACES
235  if (!myOs.str().empty()) {
236  if (!verbatim) {
237  emitToken(myOs.str() + ' ');
238  } else {
239  emitToken(myOs.str());
240  }
241  }
242 #else
243  if (!myOs.str().empty())
244  emitToken(myOs.str());
245 #endif
246  return *this;
247  }
std::string emptyString
Definition: ErrorObj.h:101
virtual ErrorObj & emitToken(const ELstring &txt)
Definition: ErrorObj.cc:182
std::ostringstream myOs
Definition: ErrorObj.h:100
bool verbatim
Definition: ErrorObj.h:102
bool edm::ErrorObj::reactedTo ( ) const

Definition at line 137 of file ErrorObj.cc.

References myReactedTo.

Referenced by edm::service::ELstatistics::log().

137 { return myReactedTo; }
bool myReactedTo
Definition: ErrorObj.h:98
int edm::ErrorObj::serial ( ) const

Definition at line 132 of file ErrorObj.cc.

References mySerial.

Referenced by edm::service::ELoutput::log().

132 { return mySerial; }
int mySerial
Definition: ErrorObj.h:93
void edm::ErrorObj::set ( const ELseverityLevel sev,
const ELstring id 
)
virtual

Definition at line 207 of file ErrorObj.cc.

References clear(), mySerial, myTimestamp, edm::ourSerial(), setID(), setSeverity(), and protons_cff::time.

207  {
208  clear();
209 
210  myTimestamp = time(nullptr);
211  mySerial = ++ourSerial;
212 
213  setID(id);
214  setSeverity(sev);
215 
216  } // set()
time_t myTimestamp
Definition: ErrorObj.h:96
virtual void setSeverity(const ELseverityLevel &sev)
Definition: ErrorObj.cc:154
virtual void clear()
Definition: ErrorObj.cc:218
static std::atomic< int > ourSerial(0)
virtual void setID(const ELstring &ID)
Definition: ErrorObj.cc:159
int mySerial
Definition: ErrorObj.h:93
void edm::ErrorObj::setContext ( const ELstring context)
virtual

Definition at line 167 of file ErrorObj.cc.

References EnergyCorrector::c, and myContext.

Referenced by edm::MessageSender::ErrorObjDeleter::operator()().

167 { myContext = c; }
ELstring myContext
Definition: ErrorObj.h:99
void edm::ErrorObj::setID ( const ELstring ID)
virtual

Definition at line 159 of file ErrorObj.cc.

References edm::ELextendedID::id, edm::maxIDlength(), myIdOverflow, and myXid.

Referenced by edm::service::ThreadSafeLogMessageLoggerScribe::log(), edm::service::MessageLoggerScribe::log(), set(), and edm::service::ThreadSafeLogMessageLoggerScribe::~ThreadSafeLogMessageLoggerScribe().

159  {
160  myXid.id = ELstring(id, 0, maxIDlength);
161  if (id.length() > maxIDlength)
162  myIdOverflow = ELstring(id, maxIDlength, id.length() - maxIDlength);
163  }
ELstring myIdOverflow
Definition: ErrorObj.h:95
ELextendedID myXid
Definition: ErrorObj.h:94
const unsigned int maxIDlength(200)
std::string ELstring
Definition: ELstring.h:21
void edm::ErrorObj::setModule ( const ELstring module)
virtual

Definition at line 165 of file ErrorObj.cc.

References edm::ELextendedID::module, and myXid.

Referenced by edm::MessageSender::ErrorObjDeleter::operator()().

165 { myXid.module = module; }
ELextendedID myXid
Definition: ErrorObj.h:94
Definition: vlib.h:208
void edm::ErrorObj::setReactedTo ( bool  r)
virtual

Definition at line 176 of file ErrorObj.cc.

References myReactedTo, and alignCSCRings::r.

Referenced by edm::service::ELadministrator::log().

176 { myReactedTo = r; }
bool myReactedTo
Definition: ErrorObj.h:98
void edm::ErrorObj::setSeverity ( const ELseverityLevel sev)
virtual

Definition at line 154 of file ErrorObj.cc.

References edm::ELdebug, edm::ELhighestSeverity, edm::ELsevere, edm::ELzeroSeverity, myXid, and edm::ELextendedID::severity.

Referenced by set().

154  {
155  myXid.severity = (sev <= ELzeroSeverity) ? (ELseverityLevel)ELdebug
156  : (sev >= ELhighestSeverity) ? (ELseverityLevel)ELsevere : sev;
157  }
ELslProxy< ELdebugGen > const ELdebug
ELseverityLevel severity
Definition: ELextendedID.h:29
ELslProxy< ELhighestSeverityGen > const ELhighestSeverity
ELextendedID myXid
Definition: ErrorObj.h:94
ELslProxy< ELzeroSeverityGen > const ELzeroSeverity
ELslProxy< ELsevereGen > const ELsevere
void edm::ErrorObj::setSubroutine ( const ELstring subroutine)
virtual

Definition at line 169 of file ErrorObj.cc.

References MessageLogger_cfi::cerr, myXid, and edm::ELextendedID::subroutine.

Referenced by emitToken().

169  {
170 #ifdef ErrorObj_SUB_TRACE
171  std::cerr << "=:=:=: ErrorObj::setSubroutine(" << subroutine << ")\n";
172 #endif
173  myXid.subroutine = (subroutine[0] == ' ') ? subroutine.substr(1) : subroutine;
174  }
ELextendedID myXid
Definition: ErrorObj.h:94
ELstring subroutine
Definition: ELextendedID.h:31
void edm::ErrorObj::swap ( ErrorObj other)

Definition at line 113 of file ErrorObj.cc.

References emptyString, myContext, myIdOverflow, myItems, myOs, myReactedTo, mySerial, myTimestamp, myXid, AlCaHLTBitMon_QueryRunRegistry::string, std::swap(), groupFilesInBlocks::temp, and verbatim.

Referenced by operator=(), and edm::swap().

113  {
114  std::swap(mySerial, other.mySerial);
115  std::swap(myXid, other.myXid);
116  myIdOverflow.swap(other.myIdOverflow);
117  std::swap(myTimestamp, other.myTimestamp);
118  myItems.swap(other.myItems);
119  std::swap(myReactedTo, other.myReactedTo);
120  myContext.swap(other.myContext);
121  std::string temp(other.myOs.str());
122  other.myOs.str(myOs.str());
123  myOs.str(temp);
124  emptyString.swap(other.emptyString);
125  std::swap(verbatim, other.verbatim);
126  }
std::string emptyString
Definition: ErrorObj.h:101
time_t myTimestamp
Definition: ErrorObj.h:96
ELstring myIdOverflow
Definition: ErrorObj.h:95
ELlist_string myItems
Definition: ErrorObj.h:97
ELextendedID myXid
Definition: ErrorObj.h:94
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::ostringstream myOs
Definition: ErrorObj.h:100
bool verbatim
Definition: ErrorObj.h:102
ELstring myContext
Definition: ErrorObj.h:99
bool myReactedTo
Definition: ErrorObj.h:98
int mySerial
Definition: ErrorObj.h:93
time_t edm::ErrorObj::timestamp ( ) const

Definition at line 135 of file ErrorObj.cc.

References myTimestamp.

Referenced by edm::service::ELoutput::log().

135 { return myTimestamp; }
time_t myTimestamp
Definition: ErrorObj.h:96
const ELextendedID & edm::ErrorObj::xid ( ) const

Member Data Documentation

std::string edm::ErrorObj::emptyString
private

Definition at line 101 of file ErrorObj.h.

Referenced by opltlt(), and swap().

ELstring edm::ErrorObj::myContext
private

Definition at line 99 of file ErrorObj.h.

Referenced by context(), setContext(), and swap().

ELstring edm::ErrorObj::myIdOverflow
private

Definition at line 95 of file ErrorObj.h.

Referenced by clear(), idOverflow(), setID(), and swap().

ELlist_string edm::ErrorObj::myItems
private

Definition at line 97 of file ErrorObj.h.

Referenced by clear(), emitToken(), fullText(), items(), and swap().

std::ostringstream edm::ErrorObj::myOs
private

Definition at line 100 of file ErrorObj.h.

Referenced by opltlt(), and swap().

bool edm::ErrorObj::myReactedTo
private

Definition at line 98 of file ErrorObj.h.

Referenced by clear(), reactedTo(), setReactedTo(), and swap().

int edm::ErrorObj::mySerial
private

Definition at line 93 of file ErrorObj.h.

Referenced by clear(), serial(), set(), and swap().

time_t edm::ErrorObj::myTimestamp
private

Definition at line 96 of file ErrorObj.h.

Referenced by clear(), set(), swap(), and timestamp().

ELextendedID edm::ErrorObj::myXid
private

Definition at line 94 of file ErrorObj.h.

Referenced by clear(), setID(), setModule(), setSeverity(), setSubroutine(), swap(), and xid().

bool edm::ErrorObj::verbatim
private

Definition at line 102 of file ErrorObj.h.

Referenced by is_verbatim(), opltlt(), and swap().