CoreLinux++
0.4.32
|
Assertion is-a Exception created when an assertion fails. More...
#include <Assertion.hpp>
Public Types | |
enum | Type { REQUIRE, ENSURE, CHECK, ASSERT, NEVERGETHERE } |
Assertion Types enum. More... | |
![]() | |
enum | Severity { CONTINUABLE = 1, THREADFATAL, PROCESSFATAL, THREADTERMINATE, PROCESSTERMINATE } |
Exception Severity States. More... | |
Public Member Functions | |
Assertion (Type aType, CharPtr aReason, CharPtr aFile, LineNum aLine) | |
Assertion Constructor. More... | |
Assertion (AssertionCref rExcept) | |
Assertion copy constructor. More... | |
virtual | ~Assertion (void) |
Virtual Destructor. | |
AssertionRef | operator= (AssertionCref) |
Assignment operator overload. More... | |
bool | operator== (AssertionCref) |
Comparisson operator overload. More... | |
Assertion::Type | getType (void) const |
Accessor. More... | |
![]() | |
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... | |
Additional Inherited Members | |
![]() | |
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. | |
Assertion is-a Exception created when an assertion fails.
It contains type information so that clients may filter the types of assertion violations that they catch. There are several types of assertion macros defined. Refer to the comments at the top of Assertion.hpp for details.
Assertion Types enum.
Enumerator | |
---|---|
ENSURE | REQUIRE pre-condition state. |
CHECK | ENSURE post-condition state. |
ASSERT | CHECK invariant state. |
NEVERGETHERE | ASSERT invariant state. NEVERGETHERE logic state |
corelinux::Assertion::Assertion | ( | Assertion::Type | aType, |
CharPtr | aReason, | ||
CharPtr | aFile, | ||
LineNum | aLine | ||
) |
Assertion Constructor.
Type | Specifies the state condition for the assertion |
Reason | Text describing the assertion |
File | The source module the assertion was thrown from |
Line | The throw point line in the source module |
corelinux::Assertion::Assertion | ( | AssertionCref | rExcept | ) |
Assertion::Type corelinux::Assertion::getType | ( | void | ) | const |
AssertionRef corelinux::Assertion::operator= | ( | AssertionCref | aAssertion | ) |
Assignment operator overload.
Assertion | const reference |
References getType(), and corelinux::Exception::operator=().
bool corelinux::Assertion::operator== | ( | AssertionCref | ) |
Comparisson operator overload.
Assertion | const reference |