|
CoreLinux++
0.4.32
|
Exception is the base exception class used in the CoreLinux++ libraries. More...
#include <Exception.hpp>
Public Types | |
| enum | Severity { CONTINUABLE = 1, THREADFATAL, PROCESSFATAL, THREADTERMINATE, PROCESSTERMINATE } |
| Exception Severity States. More... | |
Public Member Functions | |
| Exception (CharCptr why, CharCptr file, LineNum line, Severity severity=Exception::CONTINUABLE, bool outOfMemory=false) | |
| Default Constructor. More... | |
| Exception (ExceptionCref crOther) | |
| Copy constructor. More... | |
| virtual | ~Exception (void) |
| Virtual Destructor. | |
| ExceptionRef | operator= (ExceptionCref otherRef) |
| Assignment operator overload. More... | |
| bool | operator== (ExceptionCref otherRef) |
| Comparisson operator overload. More... | |
| const std::string & | getFile (void) const |
| Accessor. More... | |
| LineNumCref | getLine (void) const |
| Accessor. More... | |
| const std::string & | getWhy (void) const |
| Accessor. More... | |
| const Severity & | getSeverity (void) const |
| Accessor. More... | |
| const std::string & | getUnwind (void) const |
| Accessor. More... | |
| bool | isOutOfMemory (void) const |
| Accessor. More... | |
| void | addUnwindInfo (CharCptr unwindInfo) |
| Append unwind information to the Exception. More... | |
| void | setThreadFatalSeverity (void) |
| Change the severity to Severity::THREADFATAL. | |
| void | setProcessFatalSeverity (void) |
| Change the severity to Severity::PROCESSFATAL. | |
| void | setThreadTerminateSeverity (void) |
| Change the severity to Severity::THREADTERMINATE. More... | |
| void | setProcessTerminateSeverity (void) |
| Change the severity to Severity::PROCESSTERMINATE. More... | |
Protected Member Functions | |
| Exception (void) | |
| Exceptions must have a reason. More... | |
| Exception (CharCptr file, LineNum line, Severity severity=Exception::CONTINUABLE, bool outOfMemory=false) | |
| Exception constructor for use by derivations. | |
| void | setWhy (const std::string &) |
| Changes the exception reason. | |
| void | setWhy (CharCptr) |
| Changes the exception reason. | |
Exception is the base exception class used in the CoreLinux++ libraries.
It is provided to support a rich base from which domain Exceptions may derive.
| corelinux::Exception::Exception | ( | CharCptr | why, |
| CharCptr | file, | ||
| LineNum | line, | ||
| Exception::Severity | aSeverity = Exception::CONTINUABLE, |
||
| bool | outOfMemory = false |
||
| ) |
Default Constructor.
| why | describes why the exception was thrown |
| file | The source module throwing the exception |
| line | The line of source throwing the exception |
| severity | The Exception::Severity of the Exception |
| outOfMemory | An out of memory indicator |
References Exception().
| corelinux::Exception::Exception | ( | ExceptionCref | crOther | ) |
Copy constructor.
| Exception | const reference |
|
protected |
Exceptions must have a reason.
Default constructor is not allowed.
Referenced by Exception(), and isOutOfMemory().
| void corelinux::Exception::addUnwindInfo | ( | CharCptr | unwindInfo | ) |
Append unwind information to the Exception.
Clients should use this service to identify themselves and specify any changes to severity.
Referenced by corelinux::CommandFrame::execute(), corelinux::CommandFrame::executeReverse(), and isOutOfMemory().
| const std::string & corelinux::Exception::getFile | ( | void | ) | const |
Accessor.
Referenced by operator=().
| LineNumCref corelinux::Exception::getLine | ( | void | ) | const |
Accessor.
Referenced by operator=().
| const Exception::Severity & corelinux::Exception::getSeverity | ( | void | ) | const |
| const std::string & corelinux::Exception::getUnwind | ( | void | ) | const |
| const std::string & corelinux::Exception::getWhy | ( | void | ) | const |
|
inline |
Accessor.
References addUnwindInfo(), Exception(), setProcessFatalSeverity(), setProcessTerminateSeverity(), setThreadFatalSeverity(), setThreadTerminateSeverity(), and setWhy().
Referenced by operator=().
| ExceptionRef corelinux::Exception::operator= | ( | ExceptionCref | otherRef | ) |
Assignment operator overload.
| Exception | const reference |
References getFile(), getLine(), getSeverity(), getUnwind(), getWhy(), and isOutOfMemory().
Referenced by corelinux::CompositeException::operator=(), corelinux::IteratorException::operator=(), corelinux::AbstractFactoryException::operator=(), corelinux::SemaphoreException::operator=(), corelinux::StorageException::operator=(), corelinux::ThreadException::operator=(), corelinux::CommandFrameException::operator=(), corelinux::NullPointerException::operator=(), and corelinux::Assertion::operator=().
| bool corelinux::Exception::operator== | ( | ExceptionCref | otherRef | ) |
Comparisson operator overload.
| Exception | const reference |
| void corelinux::Exception::setProcessTerminateSeverity | ( | void | ) |
Change the severity to Severity::PROCESSTERMINATE.
This is useful to the catcher that the process should exit
References PROCESSTERMINATE.
Referenced by isOutOfMemory().
| void corelinux::Exception::setThreadTerminateSeverity | ( | void | ) |
Change the severity to Severity::THREADTERMINATE.
This is useful to the catcher that the thread should be cleaned up.
References THREADTERMINATE.
Referenced by isOutOfMemory().