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 48 of file ErrorObj.h.

Constructor & Destructor Documentation

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

Definition at line 81 of file ErrorObj.cc.

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

83  : verbatim(verbat) {
84 
85  #ifdef ErrorObjCONSTRUCTOR_TRACE
86  std::cerr << "Constructor for ErrorObj\n";
87  #endif
88 
89  clear();
90  set( sev, id );
91 
92 } // ErrorObj()
virtual void clear()
Definition: ErrorObj.cc:257
bool verbatim
Definition: ErrorObj.h:110
edm::ErrorObj::ErrorObj ( const ErrorObj orig)

Definition at line 95 of file ErrorObj.cc.

References MessageLogger_cfi::cerr.

95  :
96  mySerial ( orig.mySerial )
97  , myXid ( orig.myXid )
98  , myIdOverflow ( orig.myIdOverflow )
99  , myTimestamp ( orig.myTimestamp )
100  , myItems ( orig.myItems )
101  , myReactedTo ( orig.myReactedTo )
102  , myOs ( )
103  , emptyString ( )
104  , verbatim ( orig.verbatim )
105 {
106 
107  #ifdef ErrorObjCONSTRUCTOR_TRACE
108  std::cerr << "Copy Constructor for ErrorObj\n";
109  #endif
110 
111 } // ErrorObj(ErrorObj)
std::string emptyString
Definition: ErrorObj.h:109
time_t myTimestamp
Definition: ErrorObj.h:104
ELstring myIdOverflow
Definition: ErrorObj.h:103
ELlist_string myItems
Definition: ErrorObj.h:105
ELextendedID myXid
Definition: ErrorObj.h:102
std::ostringstream myOs
Definition: ErrorObj.h:108
bool verbatim
Definition: ErrorObj.h:110
bool myReactedTo
Definition: ErrorObj.h:106
edm::ErrorObj::~ErrorObj ( )
virtual

Definition at line 114 of file ErrorObj.cc.

References MessageLogger_cfi::cerr.

114  {
115 
116  #ifdef ErrorObjCONSTRUCTOR_TRACE
117  std::cerr << "Destructor for ErrorObj\n";
118  #endif
119 
120 } // ~ErrorObj()

Member Function Documentation

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

Definition at line 257 of file ErrorObj.cc.

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

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

257  {
258 
259  mySerial = 0;
260  myXid.clear();
261  myIdOverflow = "";
262  myTimestamp = 0;
263  myItems.erase( myItems.begin(), myItems.end() ); // myItems.clear();
264  myReactedTo = false;
265 
266 } // clear()
time_t myTimestamp
Definition: ErrorObj.h:104
ELstring myIdOverflow
Definition: ErrorObj.h:103
ELlist_string myItems
Definition: ErrorObj.h:105
ELextendedID myXid
Definition: ErrorObj.h:102
bool myReactedTo
Definition: ErrorObj.h:106
ELstring edm::ErrorObj::context ( ) const

Definition at line 155 of file ErrorObj.cc.

References myContext.

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

155  {
156  return myContext;
157 }
ELstring myContext
Definition: ErrorObj.h:107
ErrorObj & edm::ErrorObj::emitToken ( const ELstring txt)
virtual

Definition at line 215 of file ErrorObj.cc.

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

Referenced by opltlt().

215  {
216 
217  #ifdef ErrorObj_EMIT_TRACE
218  std::cerr << "=:=:=: ErrorObj::emitToken( " << s << " )\n";
219  #endif
220 
221  #ifdef ErrorObj_SUB_TRACE
222  if ( subN > 0 ) {
223  std::cerr << "=:=:=: subN ErrorObj::emitToken( " << s << " )\n";
224  subN--;
225  }
226  #endif
227 
228  if ( eq_nocase(s.substr(0,5), "@SUB=" ) ) {
229  #ifdef ErrorObj_SUB_TRACE
230  std::cerr << "=:=:=: ErrorObj::@SUB s.substr(5) is: " << s.substr(5)
231  << '\n';
232  #endif
233  setSubroutine(s.substr(5));
234  }
235  else {
236  myItems.push_back( s );
237  }
238 
239  return * this;
240 
241 } // emitToken()
virtual void setSubroutine(const ELstring &subroutine)
Definition: ErrorObj.cc:195
ELlist_string myItems
Definition: ErrorObj.h:105
bool eq_nocase(const ELstring &s1, const char s2[])
Definition: ELstring.cc:24
ELstring edm::ErrorObj::fullText ( ) const

Definition at line 159 of file ErrorObj.cc.

References myItems, and mps_fire::result.

159  {
160 
162  for ( ELlist_string::const_iterator it = myItems.begin();
163  it != myItems.end();
164  ++it )
165  result += *it;
166  return result;
167 
168 } // fullText()
ELlist_string myItems
Definition: ErrorObj.h:105
std::string ELstring
Definition: ELstring.h:26
const ELstring & edm::ErrorObj::idOverflow ( ) const

Definition at line 149 of file ErrorObj.cc.

References myIdOverflow.

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

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

Definition at line 153 of file ErrorObj.cc.

References verbatim.

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

153 { return verbatim; }
bool verbatim
Definition: ErrorObj.h:110
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 122 of file ErrorObj.cc.

References swap(), and groupFilesInBlocks::temp.

122  {
124  this->swap(temp);
125  return *this;
126 }
ErrorObj(const ELseverityLevel &sev, const ELstring &id, bool verbatim=false)
Definition: ErrorObj.cc:81
void swap(ErrorObj &other)
Definition: ErrorObj.cc:128
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 269 of file ErrorObj.cc.

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

269  {
270  // Exactly equivalent to the general template.
271  // If this is not provided explicitly, then the template will
272  // be instantiated once for each length of string ever used.
273  myOs.str(emptyString);
274  myOs << s;
275 #ifdef OLD_STYLE_AUTOMATIC_SPACES
276  if ( ! myOs.str().empty() ) {
277  if ( !verbatim ) {
278  emitToken( myOs.str() + ' ' );
279  } else {
280  emitToken( myOs.str() );
281  }
282  }
283 #else
284  if ( ! myOs.str().empty() ) emitToken( myOs.str() );
285 #endif
286  return *this;
287 }
std::string emptyString
Definition: ErrorObj.h:109
virtual ErrorObj & emitToken(const ELstring &txt)
Definition: ErrorObj.cc:215
std::ostringstream myOs
Definition: ErrorObj.h:108
bool verbatim
Definition: ErrorObj.h:110
bool edm::ErrorObj::reactedTo ( ) const

Definition at line 152 of file ErrorObj.cc.

References myReactedTo.

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

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

Definition at line 147 of file ErrorObj.cc.

References mySerial.

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

147 { return mySerial; }
void edm::ErrorObj::set ( const ELseverityLevel sev,
const ELstring id 
)
virtual

Definition at line 244 of file ErrorObj.cc.

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

244  {
245 
246  clear();
247 
248  myTimestamp = time( nullptr );
249  mySerial = ++ ourSerial;
250 
251  setID( id );
252  setSeverity( sev );
253 
254 } // set()
time_t myTimestamp
Definition: ErrorObj.h:104
virtual void setSeverity(const ELseverityLevel &sev)
Definition: ErrorObj.cc:175
virtual void clear()
Definition: ErrorObj.cc:257
static std::atomic< int > ourSerial(0)
virtual void setID(const ELstring &ID)
Definition: ErrorObj.cc:183
void edm::ErrorObj::setContext ( const ELstring context)
virtual

Definition at line 192 of file ErrorObj.cc.

References EnergyCorrector::c, and myContext.

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

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

Definition at line 183 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().

183  {
184  myXid.id = ELstring( id, 0, maxIDlength );
185  if ( id.length() > maxIDlength )
186  myIdOverflow = ELstring( id, maxIDlength, id.length()-maxIDlength );
187 }
ELstring myIdOverflow
Definition: ErrorObj.h:103
ELextendedID myXid
Definition: ErrorObj.h:102
const unsigned int maxIDlength(200)
std::string ELstring
Definition: ELstring.h:26
void edm::ErrorObj::setModule ( const ELstring module)
virtual

Definition at line 190 of file ErrorObj.cc.

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

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

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

Definition at line 205 of file ErrorObj.cc.

References myReactedTo, and alignCSCRings::r.

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

205  {
206  myReactedTo = r;
207 }
bool myReactedTo
Definition: ErrorObj.h:106
void edm::ErrorObj::setSeverity ( const ELseverityLevel sev)
virtual

Definition at line 175 of file ErrorObj.cc.

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

Referenced by set().

175  {
176  myXid.severity = (sev <= ELzeroSeverity ) ? (ELseverityLevel)ELdebug
177  : (sev >= ELhighestSeverity) ? (ELseverityLevel)ELsevere
178  : sev
179  ;
180 }
ELslProxy< ELdebugGen > const ELdebug
ELseverityLevel severity
Definition: ELextendedID.h:35
ELslProxy< ELhighestSeverityGen > const ELhighestSeverity
ELextendedID myXid
Definition: ErrorObj.h:102
ELslProxy< ELzeroSeverityGen > const ELzeroSeverity
ELslProxy< ELsevereGen > const ELsevere
void edm::ErrorObj::setSubroutine ( const ELstring subroutine)
virtual

Definition at line 195 of file ErrorObj.cc.

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

Referenced by emitToken().

195  {
196  #ifdef ErrorObj_SUB_TRACE
197  std::cerr << "=:=:=: ErrorObj::setSubroutine(" << subroutine << ")\n";
198  #endif
199  myXid.subroutine = (subroutine[0] == ' ')
200  ? subroutine.substr(1)
201  : subroutine;
202 }
ELextendedID myXid
Definition: ErrorObj.h:102
ELstring subroutine
Definition: ELextendedID.h:37
void edm::ErrorObj::swap ( ErrorObj other)

Definition at line 128 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().

128  {
129  std::swap(mySerial, other.mySerial);
130  std::swap(myXid, other.myXid);
131  myIdOverflow.swap(other.myIdOverflow);
132  std::swap(myTimestamp, other.myTimestamp);
133  myItems.swap(other.myItems);
134  std::swap(myReactedTo, other.myReactedTo);
135  myContext.swap(other.myContext);
136  std::string temp(other.myOs.str());
137  other.myOs.str(myOs.str());
138  myOs.str(temp);
139  emptyString.swap(other.emptyString);
140  std::swap(verbatim, other.verbatim);
141 }
std::string emptyString
Definition: ErrorObj.h:109
time_t myTimestamp
Definition: ErrorObj.h:104
ELstring myIdOverflow
Definition: ErrorObj.h:103
ELlist_string myItems
Definition: ErrorObj.h:105
ELextendedID myXid
Definition: ErrorObj.h:102
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::ostringstream myOs
Definition: ErrorObj.h:108
bool verbatim
Definition: ErrorObj.h:110
ELstring myContext
Definition: ErrorObj.h:107
bool myReactedTo
Definition: ErrorObj.h:106
time_t edm::ErrorObj::timestamp ( ) const

Definition at line 150 of file ErrorObj.cc.

References myTimestamp.

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

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

Member Data Documentation

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

Definition at line 109 of file ErrorObj.h.

Referenced by opltlt(), and swap().

ELstring edm::ErrorObj::myContext
private

Definition at line 107 of file ErrorObj.h.

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

ELstring edm::ErrorObj::myIdOverflow
private

Definition at line 103 of file ErrorObj.h.

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

ELlist_string edm::ErrorObj::myItems
private

Definition at line 105 of file ErrorObj.h.

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

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

Definition at line 108 of file ErrorObj.h.

Referenced by opltlt(), and swap().

bool edm::ErrorObj::myReactedTo
private

Definition at line 106 of file ErrorObj.h.

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

int edm::ErrorObj::mySerial
private

Definition at line 101 of file ErrorObj.h.

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

time_t edm::ErrorObj::myTimestamp
private

Definition at line 104 of file ErrorObj.h.

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

ELextendedID edm::ErrorObj::myXid
private

Definition at line 102 of file ErrorObj.h.

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

bool edm::ErrorObj::verbatim
private

Definition at line 110 of file ErrorObj.h.

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