Public Member Functions | Private Attributes | List of all members
mf::ErrorObj Class Reference

#include <ErrorObj.h>

Public Member Functions

virtual ~ErrorObj ()
 
 ErrorObj ()=delete
 
 ErrorObj (ELseverityLevel const sev, std::string const &category, bool verbatim=false, std::string const &filename="", int lineNumber=0)
 
 ErrorObj (ErrorObj const &)
 
int serial () const
 
ELextendedID const & xid () const
 
std::string const & idOverflow () const
 
timeval timestamp () const
 
std::list< std::string > const & items () const
 
bool reactedTo () const
 
std::string fullText () const
 
std::string const & context () const
 
std::string const & iteration () const
 
bool is_verbatim () const
 
std::string const & filename () const
 
int lineNumber () const
 
virtual void setTimestamp (timeval const &)
 
virtual void setContext (std::string const &)
 
virtual void setIteration (std::string const &)
 
virtual void setSeverity (ELseverityLevel const)
 
virtual void setID (std::string const &)
 
virtual void setModule (std::string const &)
 
virtual void setSubroutine (std::string const &)
 
virtual void setHostName (std::string const &)
 
virtual void setHostAddr (std::string const &)
 
virtual void setApplication (std::string const &)
 
virtual void setPID (long)
 
ErrorObjoperator<< (std::ostream &(*f)(std::ostream &))
 
ErrorObjoperator<< (std::ios_base &(*f)(std::ios_base &))
 
ErrorObjopltlt (char const *)
 
template<class T >
ErrorObjopltlt (T const &)
 
virtual ErrorObjeo_emit (std::string const &)
 
virtual void clear ()
 
virtual void set (ELseverityLevel const, std::string const &id)
 
virtual void setReactedTo (bool)
 

Private Attributes

int serial_ {}
 
ELextendedID xid_ {}
 
std::string idOverflow_ {}
 
timeval timestamp_ {0, 0}
 
std::list< std::stringitems_ {}
 
bool reactedTo_ {false}
 
std::string iteration_ {}
 
std::ostringstream oss_ {}
 
bool verbatim_ {false}
 
std::string filename_ {}
 
int lineNumber_ {}
 

Detailed Description

Definition at line 17 of file ErrorObj.h.

Constructor & Destructor Documentation

mf::ErrorObj::~ErrorObj ( )
virtual

Definition at line 20 of file ErrorObj.cc.

20 {}
mf::ErrorObj::ErrorObj ( )
delete
mf::ErrorObj::ErrorObj ( ELseverityLevel const  sev,
std::string const &  category,
bool  verbatim = false,
std::string const &  filename = "",
int  lineNumber = 0 
)

Definition at line 22 of file ErrorObj.cc.

27  : serial_{}
28  , xid_{}
29  , idOverflow_{}
30  , timestamp_{0, 0}
31  , items_{}
32  , reactedTo_{false}
33  , iteration_{}
34  , oss_{}
35  , verbatim_{verbatim}
38  {
39  set(sev, category);
40  }
int lineNumber() const
Definition: ErrorObj.cc:126
bool verbatim_
Definition: ErrorObj.h:88
timeval timestamp_
Definition: ErrorObj.h:83
std::string idOverflow_
Definition: ErrorObj.h:82
std::string filename_
Definition: ErrorObj.h:89
int serial_
Definition: ErrorObj.h:80
int lineNumber_
Definition: ErrorObj.h:90
bool reactedTo_
Definition: ErrorObj.h:85
std::string const & filename() const
Definition: ErrorObj.cc:120
ELextendedID xid_
Definition: ErrorObj.h:81
std::string iteration_
Definition: ErrorObj.h:86
std::ostringstream oss_
Definition: ErrorObj.h:87
std::list< std::string > items_
Definition: ErrorObj.h:84
mf::ErrorObj::ErrorObj ( ErrorObj const &  orig)

Definition at line 42 of file ErrorObj.cc.

43  : serial_{orig.serial_}
44  , xid_(orig.xid_)
45  , idOverflow_{orig.idOverflow_}
46  , timestamp_(orig.timestamp_)
47  , items_{orig.items_}
48  , reactedTo_{orig.reactedTo_}
49  , verbatim_{orig.verbatim_}
50  , filename_{orig.filename_}
51  , lineNumber_{orig.lineNumber_}
52  {}
bool verbatim_
Definition: ErrorObj.h:88
timeval timestamp_
Definition: ErrorObj.h:83
std::string idOverflow_
Definition: ErrorObj.h:82
std::string filename_
Definition: ErrorObj.h:89
int serial_
Definition: ErrorObj.h:80
int lineNumber_
Definition: ErrorObj.h:90
bool reactedTo_
Definition: ErrorObj.h:85
ELextendedID xid_
Definition: ErrorObj.h:81
std::list< std::string > items_
Definition: ErrorObj.h:84

Member Function Documentation

void mf::ErrorObj::clear ( )
virtual

Definition at line 218 of file ErrorObj.cc.

219  {
220  serial_ = 0;
221  xid_ = {};
222  idOverflow_.clear();
223  timestamp_ = {0, 0};
224  items_.clear();
225  reactedTo_ = false;
226  iteration_.clear();
227  oss_.str({});
228  verbatim_ = false;
229  }
bool verbatim_
Definition: ErrorObj.h:88
timeval timestamp_
Definition: ErrorObj.h:83
std::string idOverflow_
Definition: ErrorObj.h:82
int serial_
Definition: ErrorObj.h:80
bool reactedTo_
Definition: ErrorObj.h:85
ELextendedID xid_
Definition: ErrorObj.h:81
std::string iteration_
Definition: ErrorObj.h:86
std::ostringstream oss_
Definition: ErrorObj.h:87
std::list< std::string > items_
Definition: ErrorObj.h:84
string const & mf::ErrorObj::context ( ) const

Definition at line 98 of file ErrorObj.cc.

99  {
100  return iteration_;
101  }
std::string iteration_
Definition: ErrorObj.h:86
ErrorObj & mf::ErrorObj::eo_emit ( std::string const &  s)
virtual

Definition at line 207 of file ErrorObj.cc.

208  {
209  if (s.substr(0, 5) == "@SUB=") {
210  setSubroutine(s.substr(5));
211  } else {
212  items_.push_back(s);
213  }
214  return *this;
215  }
virtual void setSubroutine(std::string const &)
Definition: ErrorObj.cc:170
static QCString * s
Definition: config.cpp:1042
std::list< std::string > items_
Definition: ErrorObj.h:84
string const & mf::ErrorObj::filename ( ) const

Definition at line 120 of file ErrorObj.cc.

121  {
122  return filename_;
123  }
std::string filename_
Definition: ErrorObj.h:89
string mf::ErrorObj::fullText ( ) const

Definition at line 110 of file ErrorObj.cc.

111  {
112  string result;
113  for (auto const& text : items_) {
114  result += text;
115  }
116  return result;
117  }
static QCString result
std::list< std::string > items_
Definition: ErrorObj.h:84
string const & mf::ErrorObj::idOverflow ( ) const

Definition at line 67 of file ErrorObj.cc.

68  {
69  return idOverflow_;
70  }
std::string idOverflow_
Definition: ErrorObj.h:82
bool mf::ErrorObj::is_verbatim ( ) const

Definition at line 91 of file ErrorObj.cc.

92  {
93  return verbatim_;
94  }
bool verbatim_
Definition: ErrorObj.h:88
std::list< std::string > const & mf::ErrorObj::items ( ) const

Definition at line 79 of file ErrorObj.cc.

80  {
81  return items_;
82  }
std::list< std::string > items_
Definition: ErrorObj.h:84
string const & mf::ErrorObj::iteration ( ) const

Definition at line 104 of file ErrorObj.cc.

105  {
106  return iteration_;
107  }
std::string iteration_
Definition: ErrorObj.h:86
int mf::ErrorObj::lineNumber ( ) const

Definition at line 126 of file ErrorObj.cc.

127  {
128  return lineNumber_;
129  }
int lineNumber_
Definition: ErrorObj.h:90
ErrorObj & mf::ErrorObj::operator<< ( std::ostream &(*)(std::ostream &)  f)

Definition at line 247 of file ErrorObj.cc.

248  {
249  f(oss_);
250  oss_.str({});
251  return *this;
252  }
std::ostringstream oss_
Definition: ErrorObj.h:87
ErrorObj & mf::ErrorObj::operator<< ( std::ios_base &(*)(std::ios_base &)  f)

Definition at line 255 of file ErrorObj.cc.

256  {
257  f(oss_);
258  return *this;
259  }
std::ostringstream oss_
Definition: ErrorObj.h:87
ErrorObj & mf::ErrorObj::opltlt ( char const *  s)

Definition at line 263 of file ErrorObj.cc.

264  {
265  oss_.str({});
266  oss_ << s;
267  if (!oss_.str().empty()) {
268  eo_emit(oss_.str());
269  }
270  return *this;
271  }
virtual ErrorObj & eo_emit(std::string const &)
Definition: ErrorObj.cc:207
std::ostringstream oss_
Definition: ErrorObj.h:87
static QCString * s
Definition: config.cpp:1042
template<class T >
ErrorObj & mf::ErrorObj::opltlt ( T const &  t)

Definition at line 95 of file ErrorObj.h.

96  {
97  oss_.str({});
98  oss_ << t;
99  if (!oss_.str().empty()) {
100  eo_emit(oss_.str());
101  }
102  return *this;
103  }
virtual ErrorObj & eo_emit(std::string const &)
Definition: ErrorObj.cc:207
std::ostringstream oss_
Definition: ErrorObj.h:87
bool mf::ErrorObj::reactedTo ( ) const

Definition at line 85 of file ErrorObj.cc.

86  {
87  return reactedTo_;
88  }
bool reactedTo_
Definition: ErrorObj.h:85
int mf::ErrorObj::serial ( ) const

Definition at line 55 of file ErrorObj.cc.

56  {
57  return serial_;
58  }
int serial_
Definition: ErrorObj.h:80
void mf::ErrorObj::set ( ELseverityLevel const  sev,
std::string const &  id 
)
virtual

Definition at line 232 of file ErrorObj.cc.

233  {
235  serial_ = ++ourSerial;
236  setID(category);
237  setSeverity(sev);
238  }
virtual void setID(std::string const &)
Definition: ErrorObj.cc:141
timeval timestamp_
Definition: ErrorObj.h:83
static atomic< int > ourSerial
Definition: ErrorObj.cc:18
int serial_
Definition: ErrorObj.h:80
virtual void setSeverity(ELseverityLevel const)
Definition: ErrorObj.cc:132
int gettimeofday(struct timeval *, struct timezone *)
void mf::ErrorObj::setApplication ( std::string const &  application)
virtual

Definition at line 195 of file ErrorObj.cc.

196  {
197  xid_.setApplication(application);
198  }
ELextendedID xid_
Definition: ErrorObj.h:81
void setApplication(std::string const &application)
void mf::ErrorObj::setContext ( std::string const &  s)
virtual

Definition at line 158 of file ErrorObj.cc.

159  {
160  iteration_ = s;
161  }
std::string iteration_
Definition: ErrorObj.h:86
static QCString * s
Definition: config.cpp:1042
void mf::ErrorObj::setHostAddr ( std::string const &  hostaddr)
virtual

Definition at line 189 of file ErrorObj.cc.

190  {
191  xid_.setHostaddr(hostaddr);
192  }
void setHostaddr(std::string const &hostaddr)
ELextendedID xid_
Definition: ErrorObj.h:81
void mf::ErrorObj::setHostName ( std::string const &  hostname)
virtual

Definition at line 183 of file ErrorObj.cc.

184  {
185  xid_.setHostname(hostname);
186  }
void setHostname(std::string const &hostname)
Definition: ELextendedID.cc:99
ELextendedID xid_
Definition: ErrorObj.h:81
void mf::ErrorObj::setID ( std::string const &  category)
virtual

Definition at line 141 of file ErrorObj.cc.

142  {
143  xid_.setID(string(category, 0, maxCategoryLength));
144  if (category.length() > maxCategoryLength) {
146  category, maxCategoryLength, category.length() - maxCategoryLength);
147  }
148  }
std::string string
Definition: nybbler.cc:12
std::string idOverflow_
Definition: ErrorObj.h:82
ELextendedID xid_
Definition: ErrorObj.h:81
void setID(std::string const &id)
Definition: ELextendedID.cc:75
void mf::ErrorObj::setIteration ( std::string const &  s)
virtual

Definition at line 164 of file ErrorObj.cc.

165  {
166  iteration_ = s;
167  }
std::string iteration_
Definition: ErrorObj.h:86
static QCString * s
Definition: config.cpp:1042
void mf::ErrorObj::setModule ( std::string const &  module)
virtual

Definition at line 151 of file ErrorObj.cc.

152  {
153  xid_.setModule(module);
154  }
ELextendedID xid_
Definition: ErrorObj.h:81
void setModule(std::string const &module)
Definition: ELextendedID.cc:87
void mf::ErrorObj::setPID ( long  pid)
virtual

Definition at line 201 of file ErrorObj.cc.

202  {
203  xid_.setPID(pid);
204  }
ELextendedID xid_
Definition: ErrorObj.h:81
void setPID(long pid)
void mf::ErrorObj::setReactedTo ( bool  r)
virtual

Definition at line 177 of file ErrorObj.cc.

178  {
179  reactedTo_ = r;
180  }
bool reactedTo_
Definition: ErrorObj.h:85
void mf::ErrorObj::setSeverity ( ELseverityLevel const  sev)
virtual

Definition at line 132 of file ErrorObj.cc.

133  {
135  (sev <= ELzeroSeverity) ?
136  (ELseverityLevel)ELdebug :
137  ((sev >= ELhighestSeverity) ? (ELseverityLevel)ELsevere : sev));
138  }
void setSeverity(ELseverityLevel severity)
Definition: ELextendedID.cc:81
ELslProxy< ELhighestSeverityGen > constexpr ELhighestSeverity
ELslProxy< ELzeroSeverityGen > constexpr ELzeroSeverity
ELextendedID xid_
Definition: ErrorObj.h:81
ELslProxy< ELdebugGen > constexpr ELdebug
ELslProxy< ELsevereGen > constexpr ELsevere
void mf::ErrorObj::setSubroutine ( std::string const &  subroutine)
virtual

Definition at line 170 of file ErrorObj.cc.

171  {
172  xid_.setSubroutine((subroutine[0] == ' ') ? subroutine.substr(1) :
173  subroutine);
174  }
void setSubroutine(std::string const &subroutine)
Definition: ELextendedID.cc:93
ELextendedID xid_
Definition: ErrorObj.h:81
void mf::ErrorObj::setTimestamp ( timeval const &  t)
virtual

Definition at line 241 of file ErrorObj.cc.

242  {
243  timestamp_ = t;
244  }
timeval timestamp_
Definition: ErrorObj.h:83
timeval mf::ErrorObj::timestamp ( ) const

Definition at line 73 of file ErrorObj.cc.

74  {
75  return timestamp_;
76  }
timeval timestamp_
Definition: ErrorObj.h:83
ELextendedID const & mf::ErrorObj::xid ( ) const

Definition at line 61 of file ErrorObj.cc.

62  {
63  return xid_;
64  }
ELextendedID xid_
Definition: ErrorObj.h:81

Member Data Documentation

std::string mf::ErrorObj::filename_ {}
private

Definition at line 89 of file ErrorObj.h.

std::string mf::ErrorObj::idOverflow_ {}
private

Definition at line 82 of file ErrorObj.h.

std::list<std::string> mf::ErrorObj::items_ {}
private

Definition at line 84 of file ErrorObj.h.

std::string mf::ErrorObj::iteration_ {}
private

Definition at line 86 of file ErrorObj.h.

int mf::ErrorObj::lineNumber_ {}
private

Definition at line 90 of file ErrorObj.h.

std::ostringstream mf::ErrorObj::oss_ {}
private

Definition at line 87 of file ErrorObj.h.

bool mf::ErrorObj::reactedTo_ {false}
private

Definition at line 85 of file ErrorObj.h.

int mf::ErrorObj::serial_ {}
private

Definition at line 80 of file ErrorObj.h.

timeval mf::ErrorObj::timestamp_ {0, 0}
private

Definition at line 83 of file ErrorObj.h.

bool mf::ErrorObj::verbatim_ {false}
private

Definition at line 88 of file ErrorObj.h.

ELextendedID mf::ErrorObj::xid_ {}
private

Definition at line 81 of file ErrorObj.h.


The documentation for this class was generated from the following files: