|
Core Library
1.7.0.0
Library containing core utilities and tools for threading, networking, logging, INI and CSV file management etc.
|
Exception class from which to define further derived custom exception classes. More...
#include <DetailedException.h>
Public Member Functions | |
| DetailedException ()=default | |
| Default constructor. | |
| DetailedException (const std::string &message) | |
| Initializing constructor. More... | |
| DetailedException (const char *message) | |
| Initializing constructor. More... | |
| ~DetailedException () noexcept override=default | |
| Virtual destructor. | |
| DetailedException (const DetailedException &)=default | |
| Copy constructor. | |
| DetailedException & | operator= (const DetailedException &)=default |
| Copy assignment operator. | |
| DetailedException (DetailedException &&)=default | |
| Move constructor. | |
| DetailedException & | operator= (DetailedException &&)=default |
| Move assignment operator. | |
| char const * | what () const NO_EXCEPT_ override |
Private Attributes | |
| std::string | m_what {"exception"} |
Exception class from which to define further derived custom exception classes.
This class inherits virtually from std::exception and most importantly boost::exception. Inheriting from the latter ensures that we can get extended information when exceptions are thrown using the boost macro BOOST_THROW_EXCEPTION. The extended information contains line, function and file information of where the exception was thrown, as well as providing access to the what() message.
To access extended info you can do the following:
This will also work:
And this:
And lastly this:
This class is defined inline to make exporting from a DLL containing this class trivial as we are deriving from boost::exception and std::exception.
|
inlineexplicit |
Initializing constructor.
| [in] | message | - A user specified message string. |
|
inlineexplicit |
Initializing constructor.
| [in] | message | - A user specified message string. |