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 | Static 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 setProcess (const ELstring &proc)
 
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
 

Static Private Attributes

static int ourSerial
 

Detailed Description

Definition at line 51 of file ErrorObj.h.

Constructor & Destructor Documentation

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

Definition at line 79 of file ErrorObj.cc.

References dtNoiseDBValidation_cfg::cerr, clear(), and set().

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

Definition at line 93 of file ErrorObj.cc.

References dtNoiseDBValidation_cfg::cerr.

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

Definition at line 112 of file ErrorObj.cc.

References dtNoiseDBValidation_cfg::cerr.

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

Member Function Documentation

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

Definition at line 262 of file ErrorObj.cc.

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

Referenced by edm::service::ELadministrator::clearMsg(), ErrorObj(), edm::service::ELtsErrorLog::initiateMsg(), and set().

262  {
263 
264  mySerial = 0;
265  myXid.clear();
266  myIdOverflow = "";
267  myTimestamp = 0;
268  myItems.erase( myItems.begin(), myItems.end() ); // myItems.clear();
269  myReactedTo = false;
270 
271 } // clear()
time_t myTimestamp
Definition: ErrorObj.h:113
ELstring myIdOverflow
Definition: ErrorObj.h:112
ELlist_string myItems
Definition: ErrorObj.h:114
ELextendedID myXid
Definition: ErrorObj.h:111
bool myReactedTo
Definition: ErrorObj.h:115
ELstring edm::ErrorObj::context ( ) const

Definition at line 153 of file ErrorObj.cc.

References myContext.

Referenced by edm::ELlog4cplus::log(), and edm::service::MessageLoggerScribe::log().

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

Definition at line 220 of file ErrorObj.cc.

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

Referenced by edm::service::ErrorLog::emitToken(), edm::service::ELtsErrorLog::item(), edm::service::ELerrorList::log(), and opltlt().

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

Definition at line 157 of file ErrorObj.cc.

References myItems, and query::result.

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

Definition at line 147 of file ErrorObj.cc.

References myIdOverflow.

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

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

Definition at line 151 of file ErrorObj.cc.

References verbatim.

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

151 { return verbatim; }
bool verbatim
Definition: ErrorObj.h:119
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 120 of file ErrorObj.cc.

References swap(), and groupFilesInBlocks::temp.

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

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

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

Definition at line 150 of file ErrorObj.cc.

References myReactedTo.

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

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

Definition at line 145 of file ErrorObj.cc.

References mySerial.

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

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

Definition at line 249 of file ErrorObj.cc.

References clear(), mySerial, myTimestamp, ourSerial, setID(), setSeverity(), and cond::rpcobgas::time.

Referenced by ErrorObj(), betterConfigParser.BetterConfigParser::getGeneral(), edm::service::ELtsErrorLog::initiateMsg(), and edm::service::ErrorLog::operator()().

249  {
250 
251  clear();
252 
253  myTimestamp = time( 0 );
254  mySerial = ++ ourSerial;
255 
256  setID( id );
257  setSeverity( sev );
258 
259 } // set()
time_t myTimestamp
Definition: ErrorObj.h:113
virtual void setSeverity(const ELseverityLevel &sev)
Definition: ErrorObj.cc:173
virtual void clear()
Definition: ErrorObj.cc:262
virtual void setID(const ELstring &ID)
Definition: ErrorObj.cc:181
static int ourSerial
Definition: ErrorObj.h:106
void edm::ErrorObj::setContext ( const ELstring context)
virtual

Definition at line 190 of file ErrorObj.cc.

References trackerHits::c, and myContext.

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

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

Definition at line 181 of file ErrorObj.cc.

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

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

181  {
182  myXid.id = ELstring( id, 0, maxIDlength );
183  if ( id.length() > maxIDlength )
184  myIdOverflow = ELstring( id, maxIDlength, id.length()-maxIDlength );
185 }
ELstring myIdOverflow
Definition: ErrorObj.h:112
ELextendedID myXid
Definition: ErrorObj.h:111
const unsigned int maxIDlength(200)
std::string ELstring
Definition: ELstring.h:26
void edm::ErrorObj::setModule ( const ELstring module)
virtual
void edm::ErrorObj::setProcess ( const ELstring proc)
virtual

Definition at line 203 of file ErrorObj.cc.

References dtNoiseDBValidation_cfg::cerr, myXid, proc, and edm::ELextendedID::process.

Referenced by edm::service::ELtsErrorLog::initiateMsg(), edm::service::ErrorLog::operator()(), and edm::service::ELtsErrorLog::pokeMsg().

203  {
204  myXid.process = proc;
205  #if 0
206  std::cerr << "ErrorObj process set to \"" << proc << "\"\n";
207  #endif
208 }
TrainProcessor *const proc
Definition: MVATrainer.cc:101
ELextendedID myXid
Definition: ErrorObj.h:111
void edm::ErrorObj::setReactedTo ( bool  r)
virtual
void edm::ErrorObj::setSeverity ( const ELseverityLevel sev)
virtual

Definition at line 173 of file ErrorObj.cc.

References edm::ELfatal, edm::ELhighestSeverity, edm::ELincidental, edm::ELzeroSeverity, myXid, and edm::ELextendedID::severity.

Referenced by set().

173  {
174  myXid.severity = (sev <= ELzeroSeverity ) ? (ELseverityLevel)ELincidental
175  : (sev >= ELhighestSeverity) ? (ELseverityLevel)ELfatal
176  : sev
177  ;
178 }
ELseverityLevel severity
Definition: ELextendedID.h:36
ELslProxy< ELfatalGen > const ELfatal
ELslProxy< ELhighestSeverityGen > const ELhighestSeverity
ELextendedID myXid
Definition: ErrorObj.h:111
ELslProxy< ELzeroSeverityGen > const ELzeroSeverity
ELslProxy< ELincidentalGen > const ELincidental
void edm::ErrorObj::setSubroutine ( const ELstring subroutine)
virtual

Definition at line 193 of file ErrorObj.cc.

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

Referenced by emitToken(), edm::service::ELtsErrorLog::initiateMsg(), edm::service::ErrorLog::operator()(), and edm::service::ELtsErrorLog::pokeMsg().

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

Definition at line 126 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=(), edm::service::ELtsErrorLog::swap(), and edm::swap().

126  {
127  std::swap(mySerial, other.mySerial);
128  std::swap(myXid, other.myXid);
129  myIdOverflow.swap(other.myIdOverflow);
130  std::swap(myTimestamp, other.myTimestamp);
131  myItems.swap(other.myItems);
132  std::swap(myReactedTo, other.myReactedTo);
133  myContext.swap(other.myContext);
134  std::string temp(other.myOs.str());
135  other.myOs.str(myOs.str());
136  myOs.str(temp);
137  emptyString.swap(other.emptyString);
138  std::swap(verbatim, other.verbatim);
139 }
std::string emptyString
Definition: ErrorObj.h:118
time_t myTimestamp
Definition: ErrorObj.h:113
ELstring myIdOverflow
Definition: ErrorObj.h:112
ELlist_string myItems
Definition: ErrorObj.h:114
ELextendedID myXid
Definition: ErrorObj.h:111
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::ostringstream myOs
Definition: ErrorObj.h:117
bool verbatim
Definition: ErrorObj.h:119
ELstring myContext
Definition: ErrorObj.h:116
bool myReactedTo
Definition: ErrorObj.h:115
time_t edm::ErrorObj::timestamp ( ) const

Definition at line 148 of file ErrorObj.cc.

References myTimestamp.

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

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

Member Data Documentation

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

Definition at line 118 of file ErrorObj.h.

Referenced by opltlt(), and swap().

ELstring edm::ErrorObj::myContext
private

Definition at line 116 of file ErrorObj.h.

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

ELstring edm::ErrorObj::myIdOverflow
private

Definition at line 112 of file ErrorObj.h.

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

ELlist_string edm::ErrorObj::myItems
private

Definition at line 114 of file ErrorObj.h.

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

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

Definition at line 117 of file ErrorObj.h.

Referenced by opltlt(), and swap().

bool edm::ErrorObj::myReactedTo
private

Definition at line 115 of file ErrorObj.h.

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

int edm::ErrorObj::mySerial
private

Definition at line 110 of file ErrorObj.h.

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

time_t edm::ErrorObj::myTimestamp
private

Definition at line 113 of file ErrorObj.h.

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

ELextendedID edm::ErrorObj::myXid
private

Definition at line 111 of file ErrorObj.h.

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

int edm::ErrorObj::ourSerial
staticprivate

Definition at line 106 of file ErrorObj.h.

Referenced by set().

bool edm::ErrorObj::verbatim
private

Definition at line 119 of file ErrorObj.h.

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