|
libpnicore
|
Exceptions base class. More...
#include <exceptions.hpp>
Public Types | |
|
typedef std::list < exception_record > ::const_iterator | const_iterator |
| const iterator over the error record | |
Public Member Functions | |
| exception () | |
| default constructor | |
| exception (const string &n) | |
| constructor More... | |
| exception (const string &n, const exception_record &rec) | |
| constructor More... | |
| exception (const string &n, const exception_record &rec, const string &d) | |
| constructor More... | |
| virtual | ~exception () throw () |
| virtual destructor | |
| void | name (const std::string &name) |
| set the exception name More... | |
| const string & | name () const |
| get the exceptions name More... | |
| void | append (const exception_record &n) |
| add a new issuer More... | |
| void | description (const std::string &desc) |
| set exception desccription More... | |
| const string & | description () const |
| get the exceptions description More... | |
| const_iterator | begin () const |
| get iterator to first error record More... | |
| const_iterator | end () const |
| get iterator to the last error record More... | |
Protected Member Functions | |
| std::ostream & | print (std::ostream &o) const |
| ouptut method More... | |
Private Attributes | |
| string | _name |
| name of the exception | |
| string | _description |
| description of the error occured | |
| std::list< exception_record > | _records |
| exception records | |
Friends | |
| std::ostream & | operator<< (std::ostream &, const exception &) |
| output operator for exceptions | |
This is the base class for all exceptions used in this library.
| pni::core::exception::exception | ( | const string & | n | ) |
| n | name of the exception |
| pni::core::exception::exception | ( | const string & | n, |
| const exception_record & | rec | ||
| ) |
| n | name of the exception |
| rec | Exception record of the initial location where the error occured |
| pni::core::exception::exception | ( | const string & | n, |
| const exception_record & | rec, | ||
| const string & | d | ||
| ) |
| n | name of the exception |
| rec | exception record describing the location of the first occurrence of the error |
| d | description of the exception |
|
inline |
Use this method to add a new issuer in the case that the exception is re-thrown by an other function or class method.
With this a particular exception can be traced througout the entire code.
| n | exception_record to append |
|
inline |
Return get a const iterator to the first error record in the class.
|
inline |
| desc | description of the exception |
|
inline |
|
inline |
Return a const iterator pointing to the last+1 element in the exception record list.
|
inline |
| name | exception name |
|
inline |
|
protected |
Protected method to be used by derived classes for implementing exception printing to std::out.
| o | reference to the ouptput stream |
1.8.8