TF++, Miscellaneous classes and modules in C++:

Base class for exceptions. More...

#include <error.h>

Inheritance diagram for tfxx::error::Exception:
Collaboration diagram for tfxx::error::Exception:

Public Member Functions

 Exception ()
 Creates exception with no explaning comments. More...
 
 Exception (const char *message)
 Creates an exception with an explanation message. More...
 
 Exception (const char *message, const char *condition)
 Creates an exception with message and failed assertion. More...
 
 Exception (const char *message, const char *file, const int &line, const char *condition)
 Create with message, failed assertion, and code position. More...
 
 Exception (const char *message, const char *file, const int &line)
 Create with message and code position. More...
 
virtual ~Exception ()
 provide explicit virtual destructor More...
 
virtual void report () const
 Screen report. More...
 

Static Public Member Functions

static void report_on_construct ()
 Issue a screen report on construction of exception. More...
 
static void dont_report_on_construct ()
 Issue NO screen report on construction of exception. More...
 
static void restore_report_state ()
 Restore previous report state. More...
 

Protected Member Functions

bool report_on_construct_is_true () const
 

Private Member Functions

void base_report () const
 Screen report. More...
 

Private Attributes

const char * Mmessage
 pointer to message string More...
 
const char * Mfile
 pointer to file name string More...
 
int Mline
 pointer to line number in source file More...
 
const char * Mcondition
 pointer to assertion condition text string More...
 

Static Private Attributes

static bool Mreport_on_construct =true
 Shall we print to cerr at construction time? More...
 
static std::stack< bool > Mprevious_report_state
 a place to store previous report state More...
 

Detailed Description

Base class for exceptions.

This is an exception base class. It holds some information about the reason for throwing the exception. The information is printed to cerr through function report(). This function may be overloaded by a derived type. But its functionality is still accessible through base_report().

The standard behaviour is to print ou the message during object initialization. If you don't like this, call dont_report_on_construct().

,

See also
TFXX_Xassert

Definition at line 78 of file error.h.


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