Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Error Class Reference

Base exception class for programm errors. More...

#include <Err.h>

Inheritance diagram for rs::err::Error:

Inheritance graph
[legend]
Collaboration diagram for Error:

Collaboration graph
[legend]
List of all members.

Public Methods

 Error (bool real_error_, const std::string &s)
 Error (const std::string &s)
 Error (bool real_error_, const char *s)
 Error (const char *s)
virtual ~Error () throw ()
virtual void print (std::ostream &out) const
virtual std::string get_print_message () const
virtual const char * what () const throw ()
const char * get_message () const

Static Public Methods

std::string set_module_name (const std::string &new_module_name)

Protected Attributes

std::string error_module
bool real_error

Static Protected Attributes

std::string module_name = "<unknown>"

Friends

void reThrow (const exception &e)

Detailed Description

Base exception class for programm errors.

Definition at line 44 of file Err.h.


Constructor & Destructor Documentation

Error bool    real_error_,
const std::string &    s
 

Create a new error.

Parameters:
s  Error message
real_error_  true -> 'Error in ..'
See also:
rs::err

Definition at line 38 of file Err.cpp.

Referenced by InfoError::InfoError(), and StringError::StringError().

Error const std::string &    s
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Create a new error.

Note:
like above with real_error == true

Definition at line 50 of file Err.cpp.

Error bool    real_error_,
const char *    s
 

Create a new error.

Parameters:
s  Error message
real_error_  true -> 'Error in ..'

Definition at line 62 of file Err.cpp.

Error const char *    s
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Create a new error.

Note:
like above with real_error == true

Definition at line 74 of file Err.cpp.

~Error   throw () [virtual]
 

Definition at line 147 of file Err.cpp.


Member Function Documentation

void print std::ostream &    out const [virtual]
 

Print error message.

Parameters:
out  Stream to which the error is printed
See also:
get_print_message

Reimplemented in InfoError, and StringError.

Definition at line 153 of file Err.cpp.

string get_print_message   const [virtual]
 

Get error message as it would be printed by print.

Returns:
String containing the error message: "Error in <module>: <message>"
See also:
print , set_module_name

Reimplemented in InternalError.

Definition at line 161 of file Err.cpp.

Referenced by Error::print().

virtual const char* what   const throw () [inline, virtual]
 

Get plain error message

Returns:
const char* containing the plain error message.

Definition at line 88 of file Err.h.

Referenced by Error::get_message(), InternalError::get_print_message(), and Error::get_print_message().

const char* get_message   const [inline]
 

Get plain error message.

Returns:
string containing the plain error message.

Definition at line 92 of file Err.h.

string set_module_name const std::string &    new_module_name [static]
 

Changes the module name shown in error messages.

Parameters:
new_module_name  Name of current module
Returns:
Name of previous module

Definition at line 179 of file Err.cpp.


Friends And Related Function Documentation

void reThrow const exception &    e [friend]
 

Definition at line 89 of file Err.cpp.


Member Data Documentation

std::string error_module [protected]
 

Definition at line 46 of file Err.h.

Referenced by InternalError::get_print_message(), and Error::get_print_message().

string module_name = "<unknown>" [static, protected]
 

Definition at line 29 of file Err.cpp.

Referenced by InternalError::get_print_message(), and Error::set_module_name().

bool real_error [protected]
 

Definition at line 48 of file Err.h.


The documentation for this class was generated from the following files:
Contact me in case of errors or questions.
This documentation is powered by Doxygen.
(C) 2000-2002 Doxygen