CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 80 of file ErrorObj.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, clear(), and set().

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

Definition at line 94 of file ErrorObj.cc.

References ecal_dqm_sourceclient-live_cfg::cerr.

94  :
95  mySerial ( orig.mySerial )
96  , myXid ( orig.myXid )
97  , myIdOverflow ( orig.myIdOverflow )
98  , myTimestamp ( orig.myTimestamp )
99  , myItems ( orig.myItems )
100  , myReactedTo ( orig.myReactedTo )
101  , myOs ( )
102  , emptyString ( )
103  , verbatim ( orig.verbatim )
104 {
105 
106  #ifdef ErrorObjCONSTRUCTOR_TRACE
107  std::cerr << "Copy Constructor for ErrorObj\n";
108  #endif
109 
110 } // 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 113 of file ErrorObj.cc.

References ecal_dqm_sourceclient-live_cfg::cerr.

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

Member Function Documentation

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

Definition at line 256 of file ErrorObj.cc.

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

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

256  {
257 
258  mySerial = 0;
259  myXid.clear();
260  myIdOverflow = "";
261  myTimestamp = 0;
262  myItems.erase( myItems.begin(), myItems.end() ); // myItems.clear();
263  myReactedTo = false;
264 
265 } // 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 154 of file ErrorObj.cc.

References myContext.

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

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

Definition at line 214 of file ErrorObj.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, edm::eq_nocase(), myItems, and setSubroutine().

Referenced by opltlt().

214  {
215 
216  #ifdef ErrorObj_EMIT_TRACE
217  std::cerr << "=:=:=: ErrorObj::emitToken( " << s << " )\n";
218  #endif
219 
220  #ifdef ErrorObj_SUB_TRACE
221  if ( subN > 0 ) {
222  std::cerr << "=:=:=: subN ErrorObj::emitToken( " << s << " )\n";
223  subN--;
224  }
225  #endif
226 
227  if ( eq_nocase(s.substr(0,5), "@SUB=" ) ) {
228  #ifdef ErrorObj_SUB_TRACE
229  std::cerr << "=:=:=: ErrorObj::@SUB s.substr(5) is: " << s.substr(5)
230  << '\n';
231  #endif
232  setSubroutine(s.substr(5));
233  }
234  else {
235  myItems.push_back( s );
236  }
237 
238  return * this;
239 
240 } // emitToken()
virtual void setSubroutine(const ELstring &subroutine)
Definition: ErrorObj.cc:194
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 158 of file ErrorObj.cc.

References myItems, and mps_fire::result.

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

Definition at line 148 of file ErrorObj.cc.

References myIdOverflow.

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

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

Definition at line 152 of file ErrorObj.cc.

References verbatim.

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

152 { return verbatim; }
bool verbatim
Definition: ErrorObj.h:110
const ELlist_string & edm::ErrorObj::items ( ) const

Definition at line 150 of file ErrorObj.cc.

References myItems.

Referenced by python.rootplot.core.Options::kwarg_list(), and edm::service::ELoutput::log().

150 { return myItems; }
ELlist_string myItems
Definition: ErrorObj.h:105
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 121 of file ErrorObj.cc.

References swap(), and groupFilesInBlocks::temp.

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

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

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

Definition at line 151 of file ErrorObj.cc.

References myReactedTo.

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

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

Definition at line 146 of file ErrorObj.cc.

References mySerial.

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

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

Definition at line 243 of file ErrorObj.cc.

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

Referenced by ErrorObj(), and betterConfigParser.BetterConfigParser::getGeneral().

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

Definition at line 191 of file ErrorObj.cc.

References EnergyCorrector::c, and myContext.

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

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

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

182  {
183  myXid.id = ELstring( id, 0, maxIDlength );
184  if ( id.length() > maxIDlength )
185  myIdOverflow = ELstring( id, maxIDlength, id.length()-maxIDlength );
186 }
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
void edm::ErrorObj::setReactedTo ( bool  r)
virtual

Definition at line 204 of file ErrorObj.cc.

References myReactedTo, and alignCSCRings::r.

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

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

Definition at line 174 of file ErrorObj.cc.

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

Referenced by set().

174  {
175  myXid.severity = (sev <= ELzeroSeverity ) ? (ELseverityLevel)ELdebug
176  : (sev >= ELhighestSeverity) ? (ELseverityLevel)ELsevere
177  : sev
178  ;
179 }
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 194 of file ErrorObj.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, myXid, and edm::ELextendedID::subroutine.

Referenced by emitToken().

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

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

127  {
128  std::swap(mySerial, other.mySerial);
129  std::swap(myXid, other.myXid);
130  myIdOverflow.swap(other.myIdOverflow);
131  std::swap(myTimestamp, other.myTimestamp);
132  myItems.swap(other.myItems);
133  std::swap(myReactedTo, other.myReactedTo);
134  myContext.swap(other.myContext);
135  std::string temp(other.myOs.str());
136  other.myOs.str(myOs.str());
137  myOs.str(temp);
138  emptyString.swap(other.emptyString);
139  std::swap(verbatim, other.verbatim);
140 }
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 149 of file ErrorObj.cc.

References myTimestamp.

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

149 { 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().