SASSY
0.0
Software Architecture Support System
|
An exception object with severity levels. More...
#include <cfi/sx.h>
Public Member Functions | |
sxt (Severity s) | |
constructor More... | |
sxt (Severity s, const std::string &f, int ln) | |
constructor More... | |
template<class T > | |
sxt & | operator<< (T x) |
Provide stream syntax for the exception object. | |
Severity | severity () |
get the severity of the exception | |
virtual const char * | what () const throw () |
get the message from the exception | |
Static Public Member Functions | |
static const std::string & | sevToString (SASSY::Severity s) |
Convert a severity into a string. | |
Protected Attributes | |
Severity | mSeverity |
severity level of the exception | |
std::string | buff |
message built into this | |
std::string | file |
source file from which it was thrown | |
int | line |
line number in the source file | |
int | ptr |
insertion point for message text | |
An exception object with severity levels.
The sxt class is an exception object that includes severity levels and has stream syntax for creating messages.
Typical usage: throw sxt(SASSY::Error) << "something went wrong: " << strerror(errno);
A macro version that automatically records the file name and line number is also defined. It would be used like:
throw SX(Warning) << "there is a problem";
|
inlineexplicit |
constructor
s | The severity of the problem. |
|
inline |
constructor
s | the severity of the exception |
f | the file name of the source file |
ln | the line number of the source file |