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 ()
 
const std::string & context () const
 
virtual ErrorObjemitToken (std::string_view txt)
 
 ErrorObj (const ErrorObj &orig)
 
 ErrorObj (const messagelogger::ELseverityLevel &sev, std::string_view id, bool verbatim=false)
 
template<typename... Args>
ErrorObjformat (std::string_view fmt, Args const &... args)
 
std::string fullText () const
 
const std::string & idOverflow () 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 messagelogger::ELseverityLevel &sev, std::string_view id)
 
virtual void setContext (std::string_view context)
 
virtual void setID (std::string_view ID)
 
virtual void setModule (std::string_view module)
 
virtual void setReactedTo (bool r)
 
virtual void setSeverity (const messagelogger::ELseverityLevel &sev)
 
virtual void setSubroutine (std::string_view subroutine)
 
void swap (ErrorObj &other)
 
time_t timestamp () const
 
const ELextendedIDxid () const
 
virtual ~ErrorObj ()
 

Private Attributes

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

Detailed Description

Definition at line 43 of file ErrorObj.h.

Constructor & Destructor Documentation

◆ ErrorObj() [1/2]

edm::ErrorObj::ErrorObj ( const messagelogger::ELseverityLevel sev,
std::string_view  id,
bool  verbatim = false 
)

Definition at line 83 of file ErrorObj.cc.

83  : verbatim(verbat) {
84 #ifdef ErrorObjCONSTRUCTOR_TRACE
85  std::cerr << "Constructor for ErrorObj\n";
86 #endif
87 
88  clear();
89  set(sev, id);
90 
91  } // ErrorObj()

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

◆ ErrorObj() [2/2]

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

Definition at line 93 of file ErrorObj.cc.

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 #ifdef ErrorObjCONSTRUCTOR_TRACE
104  std::cerr << "Copy Constructor for ErrorObj\n";
105 #endif
106 
107  } // ErrorObj(ErrorObj)

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr.

◆ ~ErrorObj()

edm::ErrorObj::~ErrorObj ( )
virtual

Definition at line 109 of file ErrorObj.cc.

109  {
110 #ifdef ErrorObjCONSTRUCTOR_TRACE
111  std::cerr << "Destructor for ErrorObj\n";
112 #endif
113 
114  } // ~ErrorObj()

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr.

Member Function Documentation

◆ clear()

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

Definition at line 228 of file ErrorObj.cc.

228  {
229  mySerial = 0;
230  myXid.clear();
231  myIdOverflow = "";
232  myTimestamp = 0;
233  myItems.erase(myItems.begin(), myItems.end()); // myItems.clear();
234  myReactedTo = false;
235 
236  } // clear()

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

Referenced by ErrorObj(), and set().

◆ context()

const std::string & edm::ErrorObj::context ( ) const

Definition at line 149 of file ErrorObj.cc.

149 { return myContext; }

References myContext.

◆ emitToken()

ErrorObj & edm::ErrorObj::emitToken ( std::string_view  txt)
virtual

Definition at line 192 of file ErrorObj.cc.

192  {
193 #ifdef ErrorObj_EMIT_TRACE
194  std::cerr << "=:=:=: ErrorObj::emitToken( " << s << " )\n";
195 #endif
196 
197 #ifdef ErrorObj_SUB_TRACE
198  if (subN > 0) {
199  std::cerr << "=:=:=: subN ErrorObj::emitToken( " << s << " )\n";
200  subN--;
201  }
202 #endif
203 
204  if (eq_nocase(s.substr(0, 5), "@SUB=")) {
205 #ifdef ErrorObj_SUB_TRACE
206  std::cerr << "=:=:=: ErrorObj::@SUB s.substr(5) is: " << s.substr(5) << '\n';
207 #endif
208  setSubroutine(s.substr(5));
209  } else {
210  myItems.emplace_back(s);
211  }
212 
213  return *this;
214 
215  } // emitToken()

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, myItems, alignCSCRings::s, and setSubroutine().

Referenced by opltlt().

◆ format()

template<typename... Args>
ErrorObj& edm::ErrorObj::format ( std::string_view  fmt,
Args const &...  args 
)
inline

◆ fullText()

std::string edm::ErrorObj::fullText ( ) const

Definition at line 151 of file ErrorObj.cc.

151  {
153  for (auto const& it : myItems)
154  result += it;
155  return result;
156  } // fullText()

References myItems, mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ idOverflow()

const std::string & edm::ErrorObj::idOverflow ( ) const

Definition at line 143 of file ErrorObj.cc.

143 { return myIdOverflow; }

References myIdOverflow.

◆ is_verbatim()

bool edm::ErrorObj::is_verbatim ( ) const

Definition at line 147 of file ErrorObj.cc.

147 { return verbatim; }

References verbatim.

◆ items()

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

◆ 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 116 of file ErrorObj.cc.

116  {
118  this->swap(temp);
119  return *this;
120  }

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

◆ opltlt() [1/2]

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

Definition at line 238 of file ErrorObj.cc.

238  {
239  // Exactly equivalent to the general template.
240  // If this is not provided explicitly, then the template will
241  // be instantiated once for each length of string ever used.
242  myOs.str(emptyString);
243  myOs << s;
244 #ifdef OLD_STYLE_AUTOMATIC_SPACES
245  if (!myOs.str().empty()) {
246  if (!verbatim) {
247  emitToken(myOs.str() + ' ');
248  } else {
249  emitToken(myOs.str());
250  }
251  }
252 #else
253  if (!myOs.str().empty())
254  emitToken(myOs.str());
255 #endif
256  return *this;
257  }

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 146 of file ErrorObj.cc.

146 { return myReactedTo; }

References myReactedTo.

◆ serial()

int edm::ErrorObj::serial ( ) const

Definition at line 141 of file ErrorObj.cc.

141 { return mySerial; }

References mySerial.

◆ set()

void edm::ErrorObj::set ( const messagelogger::ELseverityLevel sev,
std::string_view  id 
)
virtual

Definition at line 217 of file ErrorObj.cc.

217  {
218  clear();
219 
220  myTimestamp = time(nullptr);
221  mySerial = ++ourSerial;
222 
223  setID(id);
224  setSeverity(sev);
225 
226  } // set()

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

Referenced by ErrorObj().

◆ setContext()

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

Definition at line 177 of file ErrorObj.cc.

177 { myContext = c; }

References c, and myContext.

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

◆ setID()

void edm::ErrorObj::setID ( std::string_view  ID)
virtual

Definition at line 169 of file ErrorObj.cc.

169  {
170  myXid.id = id.substr(0, maxIDlength);
171  if (id.length() > maxIDlength)
172  myIdOverflow = id.substr(maxIDlength, id.length() - maxIDlength);
173  }

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

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

◆ setModule()

void edm::ErrorObj::setModule ( std::string_view  module)
virtual

◆ setReactedTo()

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

Definition at line 186 of file ErrorObj.cc.

186 { myReactedTo = r; }

References myReactedTo, and alignCSCRings::r.

◆ setSeverity()

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

Definition at line 162 of file ErrorObj.cc.

162  {
163  using namespace edm::messagelogger;
166  : sev;
167  }

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

Referenced by set().

◆ setSubroutine()

void edm::ErrorObj::setSubroutine ( std::string_view  subroutine)
virtual

Definition at line 179 of file ErrorObj.cc.

179  {
180 #ifdef ErrorObj_SUB_TRACE
181  std::cerr << "=:=:=: ErrorObj::setSubroutine(" << subroutine << ")\n";
182 #endif
183  myXid.subroutine = (subroutine[0] == ' ') ? subroutine.substr(1) : subroutine;
184  }

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

Referenced by emitToken().

◆ swap()

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

Definition at line 122 of file ErrorObj.cc.

122  {
123  std::swap(mySerial, other.mySerial);
124  std::swap(myXid, other.myXid);
125  myIdOverflow.swap(other.myIdOverflow);
126  std::swap(myTimestamp, other.myTimestamp);
127  myItems.swap(other.myItems);
128  std::swap(myReactedTo, other.myReactedTo);
129  myContext.swap(other.myContext);
130  std::string temp(other.myOs.str());
131  other.myOs.str(myOs.str());
132  myOs.str(temp);
133  emptyString.swap(other.emptyString);
134  std::swap(verbatim, other.verbatim);
135  }

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 144 of file ErrorObj.cc.

144 { return myTimestamp; }

References myTimestamp.

◆ xid()

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

Member Data Documentation

◆ emptyString

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

Definition at line 102 of file ErrorObj.h.

Referenced by opltlt(), and swap().

◆ myContext

std::string edm::ErrorObj::myContext
private

Definition at line 100 of file ErrorObj.h.

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

◆ myIdOverflow

std::string edm::ErrorObj::myIdOverflow
private

Definition at line 96 of file ErrorObj.h.

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

◆ myItems

ELlist_string edm::ErrorObj::myItems
private

Definition at line 98 of file ErrorObj.h.

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

◆ myOs

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

Definition at line 101 of file ErrorObj.h.

Referenced by opltlt(), and swap().

◆ myReactedTo

bool edm::ErrorObj::myReactedTo
private

Definition at line 99 of file ErrorObj.h.

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

◆ mySerial

int edm::ErrorObj::mySerial
private

Definition at line 94 of file ErrorObj.h.

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

◆ myTimestamp

time_t edm::ErrorObj::myTimestamp
private

Definition at line 97 of file ErrorObj.h.

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

◆ myXid

ELextendedID edm::ErrorObj::myXid
private

Definition at line 95 of file ErrorObj.h.

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

◆ verbatim

bool edm::ErrorObj::verbatim
private

Definition at line 103 of file ErrorObj.h.

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

edm::ELextendedID::module
std::string module
Definition: ELextendedID.h:31
edm::ErrorObj::emitToken
virtual ErrorObj & emitToken(std::string_view txt)
Definition: ErrorObj.cc:192
edm::ELhighestSeverity
constexpr const ELseverityLevel ELhighestSeverity
Definition: ELseverityLevel.h:96
edm::ourSerial
static std::atomic< int > ourSerial(0)
edm::ErrorObj::mySerial
int mySerial
Definition: ErrorObj.h:94
edm::ErrorObj::myIdOverflow
std::string myIdOverflow
Definition: ErrorObj.h:96
edm::ErrorObj::myItems
ELlist_string myItems
Definition: ErrorObj.h:98
protons_cff.time
time
Definition: protons_cff.py:35
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::ErrorObj::setSeverity
virtual void setSeverity(const messagelogger::ELseverityLevel &sev)
Definition: ErrorObj.cc:162
edm::ErrorObj::myContext
std::string myContext
Definition: ErrorObj.h:100
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::ELextendedID::severity
messagelogger::ELseverityLevel severity
Definition: ELextendedID.h:30
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
trackingPlots.other
other
Definition: trackingPlots.py:1464
edm::ErrorObj::setID
virtual void setID(std::string_view ID)
Definition: ErrorObj.cc:169
edm::ELsevere
constexpr const ELseverityLevel ELsevere
Definition: ELseverityLevel.h:94
edm::maxIDlength
const unsigned int maxIDlength(200)
edm::ErrorObj::myReactedTo
bool myReactedTo
Definition: ErrorObj.h:99
edm::ErrorObj::clear
virtual void clear()
Definition: ErrorObj.cc:228
edm::ErrorObj::emptyString
std::string emptyString
Definition: ErrorObj.h:102
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ErrorObj::myXid
ELextendedID myXid
Definition: ErrorObj.h:95
edm::ELdebug
constexpr const ELseverityLevel ELdebug
Definition: ELseverityLevel.h:82
alignCSCRings.r
r
Definition: alignCSCRings.py:93
callgraph.module
module
Definition: callgraph.py:61
edm::ErrorObj::myOs
std::ostringstream myOs
Definition: ErrorObj.h:101
edm::ELextendedID::clear
void clear()
Definition: ELextendedID.cc:41
edm::ELextendedID::id
std::string id
Definition: ELextendedID.h:29
edm::ErrorObj::ErrorObj
ErrorObj(const messagelogger::ELseverityLevel &sev, std::string_view id, bool verbatim=false)
Definition: ErrorObj.cc:83
edm::ErrorObj::verbatim
bool verbatim
Definition: ErrorObj.h:103
edm::ErrorObj::myTimestamp
time_t myTimestamp
Definition: ErrorObj.h:97
edm::messagelogger::ELseverityLevel
Definition: ELseverityLevel.h:26
edm::ErrorObj::swap
void swap(ErrorObj &other)
Definition: ErrorObj.cc:122
mps_fire.result
result
Definition: mps_fire.py:311
edm::ELextendedID::subroutine
std::string subroutine
Definition: ELextendedID.h:32
edm::ErrorObj::set
virtual void set(const messagelogger::ELseverityLevel &sev, std::string_view id)
Definition: ErrorObj.cc:217
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
edm::ErrorObj::setSubroutine
virtual void setSubroutine(std::string_view subroutine)
Definition: ErrorObj.cc:179
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
edm::ELzeroSeverity
constexpr const ELseverityLevel ELzeroSeverity
Definition: ELseverityLevel.h:80
edm::messagelogger
Definition: ELseverityLevel.h:21