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::ios_base &(*f)(std::ios_base &))
 
ErrorObjoperator<< (std::ostream &(*f)(std::ostream &))
 
ErrorObjoperator= (const ErrorObj &other)
 
ErrorObjopltlt (const char s[])
 
template<class T >
ErrorObjopltlt (const T &t)
 
bool reactedTo () const
 
int serial () const
 
virtual void set (const ELseverityLevel &sev, const ELstring &id)
 
virtual void setContext (const std::string_view &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

◆ ErrorObj() [1/2]

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

Definition at line 74 of file ErrorObj.cc.

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()

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

◆ ErrorObj() [2/2]

edm::ErrorObj::ErrorObj ( const ErrorObj orig)

Definition at line 84 of file ErrorObj.cc.

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)

References beam_dqm_sourceclient-live_cfg::cerr.

◆ ~ErrorObj()

edm::ErrorObj::~ErrorObj ( )
virtual

Definition at line 100 of file ErrorObj.cc.

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

References beam_dqm_sourceclient-live_cfg::cerr.

Member Function Documentation

◆ clear()

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

Definition at line 218 of file ErrorObj.cc.

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()

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

Referenced by ErrorObj(), and set().

◆ context()

ELstring edm::ErrorObj::context ( ) const

Definition at line 140 of file ErrorObj.cc.

140 { return myContext; }

References myContext.

◆ emitToken()

ErrorObj & edm::ErrorObj::emitToken ( const ELstring txt)
virtual

Definition at line 182 of file ErrorObj.cc.

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()

References beam_dqm_sourceclient-live_cfg::cerr, edm::eq_nocase(), myItems, alignCSCRings::s, and setSubroutine().

Referenced by opltlt().

◆ fullText()

ELstring edm::ErrorObj::fullText ( ) const

Definition at line 142 of file ErrorObj.cc.

142  {
144  for (ELlist_string::const_iterator it = myItems.begin(); it != myItems.end(); ++it)
145  result += *it;
146  return result;
147 
148  } // fullText()

References myItems, and mps_fire::result.

◆ idOverflow()

const ELstring & edm::ErrorObj::idOverflow ( ) const

Definition at line 134 of file ErrorObj.cc.

134 { return myIdOverflow; }

References myIdOverflow.

◆ is_verbatim()

bool edm::ErrorObj::is_verbatim ( ) const

Definition at line 138 of file ErrorObj.cc.

138 { return verbatim; }

References verbatim.

◆ items()

const ELlist_string & edm::ErrorObj::items ( ) const

Definition at line 136 of file ErrorObj.cc.

136 { return myItems; }

References myItems.

Referenced by crabConfigParser.CrabConfigParser::getSectionLines(), and python.rootplot.core.Options::kwarg_list().

◆ operator<<() [1/2]

ErrorObj& edm::ErrorObj::operator<< ( std::ios_base &(*)(std::ios_base &)  f)
inline

◆ operator<<() [2/2]

ErrorObj& edm::ErrorObj::operator<< ( std::ostream &(*)(std::ostream &)  f)
inline

◆ operator=()

ErrorObj & edm::ErrorObj::operator= ( const ErrorObj other)

Definition at line 107 of file ErrorObj.cc.

107  {
109  this->swap(temp);
110  return *this;
111  }

References trackingPlots::other, swap(), and groupFilesInBlocks::temp.

◆ opltlt() [1/2]

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

Definition at line 228 of file ErrorObj.cc.

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  }

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

◆ opltlt() [2/2]

template<class T >
ErrorObj& edm::ErrorObj::opltlt ( const T t)
inline

◆ reactedTo()

bool edm::ErrorObj::reactedTo ( ) const

Definition at line 137 of file ErrorObj.cc.

137 { return myReactedTo; }

References myReactedTo.

◆ serial()

int edm::ErrorObj::serial ( ) const

Definition at line 132 of file ErrorObj.cc.

132 { return mySerial; }

References mySerial.

◆ set()

void edm::ErrorObj::set ( const ELseverityLevel sev,
const ELstring id 
)
virtual

Definition at line 207 of file ErrorObj.cc.

207  {
208  clear();
209 
210  myTimestamp = time(nullptr);
211  mySerial = ++ourSerial;
212 
213  setID(id);
214  setSeverity(sev);
215 
216  } // set()

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

Referenced by ErrorObj().

◆ setContext()

void edm::ErrorObj::setContext ( const std::string_view &  context)
virtual

Definition at line 167 of file ErrorObj.cc.

167 { myContext = c; }

References HltBtagPostValidation_cff::c, and myContext.

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

◆ setID()

void edm::ErrorObj::setID ( const ELstring ID)
virtual

◆ setModule()

void edm::ErrorObj::setModule ( const ELstring module)
virtual

Definition at line 165 of file ErrorObj.cc.

165 { myXid.module = module; }

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

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

◆ setReactedTo()

void edm::ErrorObj::setReactedTo ( bool  r)
virtual

Definition at line 176 of file ErrorObj.cc.

176 { myReactedTo = r; }

References myReactedTo, and alignCSCRings::r.

◆ setSeverity()

void edm::ErrorObj::setSeverity ( const ELseverityLevel sev)
virtual

Definition at line 154 of file ErrorObj.cc.

154  {
155  myXid.severity = (sev <= ELzeroSeverity) ? (ELseverityLevel)ELdebug
156  : (sev >= ELhighestSeverity) ? (ELseverityLevel)ELsevere : sev;
157  }

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

Referenced by set().

◆ setSubroutine()

void edm::ErrorObj::setSubroutine ( const ELstring subroutine)
virtual

Definition at line 169 of file ErrorObj.cc.

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  }

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

Referenced by emitToken().

◆ swap()

void edm::ErrorObj::swap ( ErrorObj other)

Definition at line 113 of file ErrorObj.cc.

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  }

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

Referenced by operator=().

◆ timestamp()

time_t edm::ErrorObj::timestamp ( ) const

Definition at line 135 of file ErrorObj.cc.

135 { return myTimestamp; }

References myTimestamp.

◆ xid()

const ELextendedID & edm::ErrorObj::xid ( ) const

Member Data Documentation

◆ emptyString

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

Definition at line 101 of file ErrorObj.h.

Referenced by opltlt(), and swap().

◆ myContext

ELstring edm::ErrorObj::myContext
private

Definition at line 99 of file ErrorObj.h.

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

◆ myIdOverflow

ELstring edm::ErrorObj::myIdOverflow
private

Definition at line 95 of file ErrorObj.h.

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

◆ myItems

ELlist_string edm::ErrorObj::myItems
private

Definition at line 97 of file ErrorObj.h.

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

◆ myOs

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

Definition at line 100 of file ErrorObj.h.

Referenced by opltlt(), and swap().

◆ myReactedTo

bool edm::ErrorObj::myReactedTo
private

Definition at line 98 of file ErrorObj.h.

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

◆ mySerial

int edm::ErrorObj::mySerial
private

Definition at line 93 of file ErrorObj.h.

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

◆ myTimestamp

time_t edm::ErrorObj::myTimestamp
private

Definition at line 96 of file ErrorObj.h.

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

◆ myXid

ELextendedID edm::ErrorObj::myXid
private

Definition at line 94 of file ErrorObj.h.

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

◆ verbatim

bool edm::ErrorObj::verbatim
private

Definition at line 102 of file ErrorObj.h.

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

edm::ourSerial
static std::atomic< int > ourSerial(0)
edm::ErrorObj::mySerial
int mySerial
Definition: ErrorObj.h:93
edm::ELextendedID::id
ELstring id
Definition: ELextendedID.h:28
edm::ELzeroSeverity
const ELslProxy< ELzeroSeverityGen > ELzeroSeverity
Definition: ELseverityLevel.cc:284
edm::ErrorObj::ErrorObj
ErrorObj(const ELseverityLevel &sev, const ELstring &id, bool verbatim=false)
Definition: ErrorObj.cc:74
edm::ErrorObj::myContext
ELstring myContext
Definition: ErrorObj.h:99
edm::ErrorObj::myItems
ELlist_string myItems
Definition: ErrorObj.h:97
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::ELextendedID::module
ELstring module
Definition: ELextendedID.h:30
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::ELstring
std::string ELstring
Definition: ELstring.h:21
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
edm::ErrorObj::setSeverity
virtual void setSeverity(const ELseverityLevel &sev)
Definition: ErrorObj.cc:154
trackingPlots.other
other
Definition: trackingPlots.py:1465
edm::ELextendedID::subroutine
ELstring subroutine
Definition: ELextendedID.h:31
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ErrorObj::setSubroutine
virtual void setSubroutine(const ELstring &subroutine)
Definition: ErrorObj.cc:169
edm::ELsevere
const ELslProxy< ELsevereGen > ELsevere
Definition: ELseverityLevel.cc:320
edm::ELdebug
const ELslProxy< ELdebugGen > ELdebug
Definition: ELseverityLevel.cc:290
edm::ELhighestSeverity
const ELslProxy< ELhighestSeverityGen > ELhighestSeverity
Definition: ELseverityLevel.cc:326
edm::ErrorObj::myIdOverflow
ELstring myIdOverflow
Definition: ErrorObj.h:95
beam_dqm_sourceclient-live_cfg.cerr
cerr
Definition: beam_dqm_sourceclient-live_cfg.py:17
edm::maxIDlength
const unsigned int maxIDlength(200)
edm::ErrorObj::myReactedTo
bool myReactedTo
Definition: ErrorObj.h:98
edm::ErrorObj::clear
virtual void clear()
Definition: ErrorObj.cc:218
edm::ErrorObj::emptyString
std::string emptyString
Definition: ErrorObj.h:101
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
module
Definition: vlib.h:198
edm::ErrorObj::myXid
ELextendedID myXid
Definition: ErrorObj.h:94
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::ErrorObj::set
virtual void set(const ELseverityLevel &sev, const ELstring &id)
Definition: ErrorObj.cc:207
edm::ErrorObj::myOs
std::ostringstream myOs
Definition: ErrorObj.h:100
edm::eq_nocase
bool eq_nocase(const ELstring &s1, const char s2[])
Definition: ELstring.cc:21
edm::ELextendedID::clear
void clear()
Definition: ELextendedID.cc:46
edm::ErrorObj::verbatim
bool verbatim
Definition: ErrorObj.h:102
edm::ErrorObj::myTimestamp
time_t myTimestamp
Definition: ErrorObj.h:96
edm::ErrorObj::swap
void swap(ErrorObj &other)
Definition: ErrorObj.cc:113
edm::ErrorObj::setID
virtual void setID(const ELstring &ID)
Definition: ErrorObj.cc:159
edm::ErrorObj::emitToken
virtual ErrorObj & emitToken(const ELstring &txt)
Definition: ErrorObj.cc:182
mps_fire.result
result
Definition: mps_fire.py:303
edm::ELextendedID::severity
ELseverityLevel severity
Definition: ELextendedID.h:29
ntuplemaker.time
time
Definition: ntuplemaker.py:310