sfem::Exception Class Reference

... the standard exception class for the SFEM library More...

#include <exception.hpp>

Inheritance diagram for sfem::Exception:

Inheritance graph
[legend]
Collaboration diagram for sfem::Exception:

Collaboration graph
[legend]

List of all members.

Public Types

enum  ExceptionCodes {
  ERR_NO_TYPE = 0, ERR_FILE_NOT_FOUND, ERR_CANNOT_WRITE_TO_FILE, ERR_INVALID_PARAMS_CONTENTS, ERR_INVALID_PARAMS_TYPE, ERR_ITEM_ALREADY_EXISTS, ERR_ITEM_NOT_FOUND, ERR_INTERNAL_ERROR, ERR_PROGRAMMING_ERROR, ERR_BADALLOC,
  ERR_INVALID_STATE, ERR_MATH
}

Public Member Functions

void addMessage (const std::string &m, const std::string &source, const std::string &file, long line)
 ... adds a (formatted) string to the existing stack of error messages in the calling hierarchy
void addMessage (const std::string &m)
 ... adds a string to the existing stack of error messages in the calling hierarchy
 Exception (const std::string &m, const std::string &source, const std::string &type, const std::string &file, long line)
 ... constructor, creates the exception with formatted message
 Exception (const std::string &m)
 ... default constructor, creates the exception with given message
virtual std::string getFormattedString (const std::string &m, const std::string &source, const std::string &type, const std::string &file, const long &line)
 ... formats the given exception message and returns the formatted string.
virtual const char * what () const throw ()
 ... returns exception message
virtual ~Exception () throw ()
 ... default destructor

Static Public Member Functions

static Exception create (int type, const std::string &m, const std::string &source, const std::string &file, long line)
 ... creates a (formatted) exception and returns it
static const std::string stringFromDouble (const double &x, const char *format)
static const std::string stringFromInt (const int &x)
static const std::string stringFromUint (const unsigned int &x)

Protected Attributes

std::string message


Detailed Description

... the standard exception class for the SFEM library

Constructor & Destructor Documentation

sfem::Exception::Exception ( const std::string &  m  )  [inline, explicit]

... default constructor, creates the exception with given message

Parameters:
m ... is the message

sfem::Exception::Exception ( const std::string &  m,
const std::string &  source,
const std::string &  type,
const std::string &  file,
long  line 
) [inline, explicit]

... constructor, creates the exception with formatted message

Parameters:
m ... is the message
source ... is the function name
type ... is the type of exception
file ... is the source code file name of origin
line ... is the corresponding line number


Member Function Documentation

void sfem::Exception::addMessage ( const std::string &  m,
const std::string &  source,
const std::string &  file,
long  line 
)

... adds a (formatted) string to the existing stack of error messages in the calling hierarchy

Parameters:
m ... is the message
source ... is the function name
file ... is the source code file name of origin
line ... is the corresponding line number

void sfem::Exception::addMessage ( const std::string &  m  ) 

... adds a string to the existing stack of error messages in the calling hierarchy

Parameters:
m ... is the message to be added Use case: try {..} catch(Exception& e) { e.addMessage("additional text"); throw e; }

static Exception sfem::Exception::create ( int  type,
const std::string &  m,
const std::string &  source,
const std::string &  file,
long  line 
) [static]

... creates a (formatted) exception and returns it

Parameters:
m ... is the message
source ... is the function name
type ... is the type of exception (alphanumeric)
file ... is the source code file name of origin
line ... is the corresponding line number

virtual std::string sfem::Exception::getFormattedString ( const std::string &  m,
const std::string &  source,
const std::string &  type,
const std::string &  file,
const long &  line 
) [virtual]

... formats the given exception message and returns the formatted string.

Parameters:
m ... is the message
source ... is the function name
type ... is the type of exception
file ... is the source code file name of origin
line ... is the corresponding line number


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

Generated on Wed Nov 17 17:35:54 2010 for 'sfem' Module Programming Interface by  doxygen 1.5.6