![]() |
Safir SDK Core
|
Common functionality for the exception hierarchy of the DOB typesystem. More...
#include <Safir/Dob/Typesystem/Exceptions.h>
Public Member Functions | |
CommonExceptionBase (const std::wstring &message, const std::wstring &fileName, const Dob::Typesystem::Int64 lineNumber) | |
Constructor with exception information. | |
virtual | ~CommonExceptionBase () throw () |
Destroy the exception. | |
const std::wstring | GetExceptionInfo () const |
Get a formatted string containing all the information in the exception. | |
const char * | what () const override throw () |
Get the GetExceptionInfo as a UTF8 encoded string. | |
virtual TypeId | GetTypeId () const =0 |
Get the type id of this exception. | |
Selectors for exception information. | |
Probably you want to use the GetExceptionInfo method instead of these methods.
| |
const std::wstring & | GetMessage () const |
Get the message about why the exception occurred. | |
virtual const std::wstring | GetName () const =0 |
Get the exception name. | |
const std::wstring & | GetFileName () const |
Get the name of the file where the exception occurred. | |
Dob::Typesystem::Int64 | GetLineNumber () const |
Get the line number that the exception occurred on. | |
Common functionality for the exception hierarchy of the DOB typesystem.
This class contains the common parts of the FundamentalException and Exception base classes.
No exceptions except FundamentalException and Exception shall ever inherit from this class. See Exception and FundamentalException for more information on how to define your exceptions.
Safir::Dob::Typesystem::Internal::CommonExceptionBase::CommonExceptionBase | ( | const std::wstring & | message, |
const std::wstring & | fileName, | ||
const Dob::Typesystem::Int64 | lineNumber ) |
Constructor with exception information.
Creates an exception that contains information about why and where the exception occurred.
message | [in] - A message describing why the exception occurred. |
fileName | [in] - The name of the file where the exception occurred. Always use WFILE as the argument for this parameter. |
lineNumber | [in] - The line number that the exception occurred on. Always use LINE as the argument for this parameter. |
|
virtual |
Destroy the exception.
const std::wstring Safir::Dob::Typesystem::Internal::CommonExceptionBase::GetExceptionInfo | ( | ) | const |
Get a formatted string containing all the information in the exception.
The string will look like this (yes, there's a line break in it): "ExceptionName at some_file_name.cpp: 453 Description: Some kind of explanation of the exception".
const std::wstring & Safir::Dob::Typesystem::Internal::CommonExceptionBase::GetFileName | ( | ) | const |
Get the name of the file where the exception occurred.
Dob::Typesystem::Int64 Safir::Dob::Typesystem::Internal::CommonExceptionBase::GetLineNumber | ( | ) | const |
Get the line number that the exception occurred on.
const std::wstring & Safir::Dob::Typesystem::Internal::CommonExceptionBase::GetMessage | ( | ) | const |
Get the message about why the exception occurred.
|
pure virtual |
Get the exception name.
Implemented in Safir::Dob::Typesystem::IllegalValueException, Safir::Dob::Typesystem::IncompatibleTypesException, Safir::Dob::Typesystem::ConfigurationErrorException, Safir::Dob::Typesystem::SoftwareViolationException, Safir::Dob::Typesystem::NullException, Safir::Dob::Typesystem::ReadOnlyException, Safir::Dob::AccessDeniedException, Safir::Dob::GhostExistsException, Safir::Dob::LowMemoryException, Safir::Dob::NotFoundException, Safir::Dob::NotOpenException, and Safir::Dob::OverflowException.
|
pure virtual |
Get the type id of this exception.
Gets the type id of the exception. Method is virtual to ensure that the right value gets returned for pointers or references.
Note: This method is overridden by all auto-generated classes.
Implemented in Safir::Dob::Typesystem::FundamentalException, Safir::Dob::Typesystem::Exception, Safir::Dob::Typesystem::IllegalValueException, Safir::Dob::Typesystem::IncompatibleTypesException, Safir::Dob::Typesystem::ConfigurationErrorException, Safir::Dob::Typesystem::SoftwareViolationException, Safir::Dob::Typesystem::NullException, Safir::Dob::Typesystem::ReadOnlyException, Safir::Dob::AccessDeniedException, Safir::Dob::GhostExistsException, Safir::Dob::LowMemoryException, Safir::Dob::NotFoundException, Safir::Dob::NotOpenException, and Safir::Dob::OverflowException.
|
override |
Get the GetExceptionInfo as a UTF8 encoded string.
This method is only provided to be compatible with the std::exception class.
If at all possible, use GetExceptionInfo instead since this method performs a copy and a conversion of the string. Note: This override allow catches of std::exception to still print the complete exception message.