#include <Exception.hpp>
None of the functions in this class throws exceptions because an exception has probably already been thrown or is about to be thrown. Each exception object contains the following:
Exception provides all of the functions required for it and its derived classes, including functions that operate on the text strings in the stack.
Definition at line 155 of file Exception.hpp.
Public Types | |
| enum | Severity { unrecoverable, recoverable } |
| Exception severity classes. More... | |
Public Member Functions | |
| Exception () throw () | |
| Default constructor. | |
| Exception (const std::string &errorText, const unsigned long &errorId=0, const Severity &severity=unrecoverable) throw () | |
| Full constructor for exception. | |
| Exception (const char *errorText, const unsigned long &errorId=0, const Severity &severity=unrecoverable) throw () | |
| Full constructor for exception. | |
| Exception (const Exception &exception) throw () | |
| Copy constructor. | |
| ~Exception () throw () | |
| Destructor. | |
| Exception & | operator= (const Exception &e) throw () |
| Assignment operator. | |
| void | terminate () throw () |
| Ends the application. | |
| unsigned long | getErrorId () const throw () |
| Returns the error ID of the exception. | |
| Exception & | setErrorId (const unsigned long &errId) throw () |
| Sets the error ID to the specified value. | |
| Exception & | addLocation (const ExceptionLocation &location) throw () |
| Adds the location information to the exception object. | |
| const ExceptionLocation | getLocation (const size_t &index=0) const throw () |
| Returns the ExceptionLocation object at the specified index. | |
| size_t | getLocationCount () const throw () |
| Returns the number of locations stored in the exception location array. | |
| bool | isRecoverable () const throw () |
| If the thrower (that is, whatever creates the exception) determines the exception is recoverable, 1 is returned. | |
| Exception & | setSeverity (const Severity &sever) throw () |
| Sets the severity of the exception. | |
| Exception & | addText (const std::string &errorText) throw () |
| Appends the specified text to the text string on the top of the exception text stack. | |
| std::string | getText (const size_t &index=0) const throw () |
| Returns an exception text string from the exception text stack. | |
| size_t | getTextCount () const throw () |
| Returns the number of text strings in the exception text stack. | |
| std::string | getName () const throw () |
| Returns the name of the object's class. | |
| void | dump (std::ostream &s) const throw () |
| Debug output function. | |
| std::string | what () const throw () |
| Dump to a string. | |
Protected Member Functions | |
| int | overflow (int c) |
| This is the streambuf function that actually outputs the data to the device. | |
Protected Attributes | |
| unsigned long | errorId |
| Error code. | |
| std::vector< ExceptionLocation > | locations |
| Stack of exception locations (where it was thrown). | |
| Severity | severity |
| Severity of exception. | |
| std::vector< std::string > | text |
| Text stack describing exception condition. | |
Friends | |
| std::ostream & | operator<< (std::ostream &s, const Exception &e) throw () |
| Output stream operator for ::Exception. | |
|
|
Exception severity classes.
Definition at line 159 of file Exception.hpp. |
|
|
Default constructor. Does nothing. |
|
||||||||||||||||
|
Full constructor for exception.
|
|
||||||||||||||||
|
Full constructor for exception.
|
|
|
Copy constructor.
|
|
|
Destructor.
Definition at line 202 of file Exception.hpp. |
|
|
Adds the location information to the exception object. The library captures this information when an exception is thrown or rethrown. An array of ExceptionLocation objects is stored in the exception object.
|
|
|
Appends the specified text to the text string on the top of the exception text stack.
|
|
|
Debug output function.
|
|
|
Returns the error ID of the exception.
Definition at line 222 of file Exception.hpp. |
|
|
Returns the ExceptionLocation object at the specified index.
|
|
|
Returns the number of locations stored in the exception location array.
|
|
|
Returns the name of the object's class.
Definition at line 306 of file Exception.hpp. |
|
|
Returns an exception text string from the exception text stack.
|
|
|
Returns the number of text strings in the exception text stack.
|
|
|
If the thrower (that is, whatever creates the exception) determines the exception is recoverable, 1 is returned. If the thrower determines it is unrecoverable, 0 is returned. Definition at line 269 of file Exception.hpp. |
|
|
Assignment operator.
|
|
|
This is the streambuf function that actually outputs the data to the device. Since all output should be done with the standard ostream operators, this function should never be called directly. In the case of this class, the characters to be output are stored in a buffer and added to the exception text after each newline. |
|
|
Sets the error ID to the specified value.
Definition at line 231 of file Exception.hpp. |
|
|
Sets the severity of the exception.
Definition at line 278 of file Exception.hpp. |
|
|
Ends the application. Normally, the library only intends this function to be used internally by the library's exception-handling macros when the compiler you are using does not support C++ exception handling. This only occurs if you define the NO_EXCEPTIONS_SUPPORT macro. Definition at line 217 of file Exception.hpp. |
|
|
Dump to a string.
|
|
||||||||||||
|
Output stream operator for ::Exception. This is intended just to dump all the data in the ::Exception to the indicated stream.
|
|
|
Error code.
Definition at line 334 of file Exception.hpp. |
|
|
Stack of exception locations (where it was thrown).
Definition at line 336 of file Exception.hpp. |
|
|
Severity of exception.
Definition at line 338 of file Exception.hpp. |
|
|
Text stack describing exception condition.
Definition at line 340 of file Exception.hpp. |
1.3.9.1