38 #ifndef TF_ERROR_H_VERSION 40 #define TF_ERROR_H_VERSION \ 42 #define TF_ERROR_H_CVSID \ 74 const char* condition);
79 const char* condition);
87 virtual void report()
const;
119 const char* condition);
135 #define SERIALPORT_Xassert(C,M,E) \ 136 if (!(C)) { throw( E ( M , __FILE__, __LINE__, #C )); } 144 #define SERIALPORT_assert(C,M) \ 145 SERIALPORT_Xassert( C , M , serialport::Exception ) 153 #define SERIALPORT_abort(M) \ 154 throw( serialport::Exception ( M , __FILE__, __LINE__ )) 156 #define SERIALPORT_illegal SERIALPORT_abort("illegal call!") 167 #define SERIALPORT_report_assert(C,M,V) \ 169 serialport::report_violation(M, __FILE__, __LINE__, #C); \ 170 std::cerr << "* comment: " << V << std::endl; \ 171 std::cerr << std::endl; \ 184 #define SERIALPORT_nonfatal_assert(F,C,M,V) \ 185 if (F) { SERIALPORT_report_assert(C,M,V) } else { SERIALPORT_assert(C,M) } 187 #endif // TF_ERROR_H_VERSION (includeguard) virtual ~Exception()
provide explicit virtual destructor
Base class for exceptions.
const char * Mmessage
pointer to message string
const char * Mcondition
pointer to assertion condition text string
static void report_on_construct()
Issue a screen report on construction of exception.
static void dont_report_on_construct()
Issue NO screen report on construction of exception.
Root namespace of library.
Exception()
Creates exception with no explaning comments.
void base_report() const
Screen report.
virtual void report() const
Screen report.
const int & Mline
pointer to line number in source file
const char * Mfile
pointer to file name string
static bool Mreport_on_construct
Shall we print to cerr at construction time?
void report_violation(const char *message, const char *file, const int &line, const char *condition)
report violation of assertion