The ak::Exception class can be used as an universal exception which may used to provide nicely readable exception messages. The provided exception message 'ex_what' is representing the exception message The provided where message 'ex_where' is representing the location where this exception is thrown from. If the exception will be catched by a try block, this exception can be thrown to the next higher level by providing just the new location. At the beginning of each provided location a '@ ' will be added A ak::Exception.what() message can look like this: Exception Message @ Inner function @ Outter function @ Initial calling function.
More...
#include "aException.h"
|
| aException () |
| Default constructor. Will initialize the type with undefined.
|
|
| aException (const char *_exWhat, const char *_exWhere, exceptionType _exType=exceptionType::Undefined) |
| Assignment constructor. Will set the internal variables.
|
|
| aException (const std::string &_exWhat, const char *_exWhere, exceptionType _exType=exceptionType::Undefined) |
| Assignment constructor. Will set the internal variables.
|
|
| aException (const std::string &_exWhat, const std::string &_exWhere, exceptionType _exType=exceptionType::Undefined) |
| Assignment constructor. Will set the internal variables.
|
|
| aException (const char *_exWhat, const std::string &_exWhere, exceptionType _exType=exceptionType::Undefined) |
| Assignment constructor. Will set the internal variables.
|
|
| aException (const aException &_other) |
| Copy constructor. Will copy all information from the other exception.
|
|
| aException (const aException &_other, const char *_exWhere) |
| Forward constructor. Will copy all information from the other exception and append the new location Will copy all the information contained in the other exception. Afterwards the new where location will be appended.
|
|
virtual | ~aException () throw () |
| Deconstructor.
|
|
virtual const char * | what () const override throw () |
| Will return the exception and location text.
|
|
std::string | getWhat (void) const |
| Returns a copy of the what message which represents the exception text.
|
|
std::string | getWhere (void) const |
| Return a copy of the what message which represents the location.
|
|
exceptionType | getType (void) const |
| Returns a copy of the exception type
|
|
|
void | buildOut (void) |
| Contains the exception type which is initialized as undefined.
|
|
The ak::Exception class can be used as an universal exception which may used to provide nicely readable exception messages. The provided exception message 'ex_what' is representing the exception message The provided where message 'ex_where' is representing the location where this exception is thrown from. If the exception will be catched by a try block, this exception can be thrown to the next higher level by providing just the new location. At the beginning of each provided location a '@ ' will be added A ak::Exception.what() message can look like this: Exception Message @ Inner function @ Outter function @ Initial calling function.
◆ exceptionType
Used to determine the type of the exception.
Enumerator |
---|
Undefined | |
Arithmetic | |
ArrayOutOfBounds | |
FileNotFound | |
IO | |
Nullptr | |
NumberFormat | |
InvalidInput | |
UnknownCommand | |
BadAlloc | |
◆ aException() [1/7]
ak::aException::aException |
( |
| ) |
|
Default constructor. Will initialize the type with undefined.
◆ aException() [2/7]
Assignment constructor. Will set the internal variables.
- Parameters
-
_exWhat | The exception message |
_exWhere | The location where the exception was thrown from (e.g. function name) |
_exType | The type of the exception |
◆ aException() [3/7]
Assignment constructor. Will set the internal variables.
- Parameters
-
_exWhat | The exception message |
_exWhere | The location where the exception was thrown from (e.g. function name) |
_exType | The type of the exception |
◆ aException() [4/7]
Assignment constructor. Will set the internal variables.
- Parameters
-
_exWhat | The exception message |
_exWhere | The location where the exception was thrown from (e.g. function name) |
_exType | The type of the exception |
◆ aException() [5/7]
Assignment constructor. Will set the internal variables.
- Parameters
-
_exWhat | The exception message |
_exWhere | The location where the exception was thrown from (e.g. function name) |
_exType | The type of the exception |
◆ aException() [6/7]
ak::aException::aException |
( |
const aException & | _other | ) |
|
Copy constructor. Will copy all information from the other exception.
- Parameters
-
_other | The other exception |
◆ aException() [7/7]
ak::aException::aException |
( |
const aException & | _other, |
|
|
const char * | _exWhere ) |
Forward constructor. Will copy all information from the other exception and append the new location Will copy all the information contained in the other exception. Afterwards the new where location will be appended.
_other The other exception the information will be copied from
_exWhere The new location message which will be appended
◆ ~aException()
ak::aException::~aException |
( |
| ) |
|
throw | ( | ) | | | |
|
virtual |
◆ buildOut()
void ak::aException::buildOut |
( |
void | | ) |
|
|
protected |
Contains the exception type which is initialized as undefined.
◆ getType()
Returns a copy of the exception type
◆ getWhat()
std::string ak::aException::getWhat |
( |
void | | ) |
const |
Returns a copy of the what message which represents the exception text.
◆ getWhere()
std::string ak::aException::getWhere |
( |
void | | ) |
const |
Return a copy of the what message which represents the location.
◆ what()
const char * ak::aException::what |
( |
void | | ) |
const |
throw | ( | ) | | | |
|
overridevirtual |
Will return the exception and location text.
◆ m_type
Contains the location desription.
◆ m_what
std::string ak::aException::m_what |
|
protected |
◆ m_where
std::string ak::aException::m_where |
|
protected |
Contains the exception message.
The documentation for this class was generated from the following files: