Asposecpplib
System::ExceptionWrapperBase Class Reference

Base exception class that implements logic for correct exception handling Contains smart pointer to exception instance. More...

Inherits System::ExceptionWrapperType, and std::exception.

Inherited by System::ExceptionWrapper< Details_Exception >.

Public Member Functions

 ExceptionWrapperBase (std::nullptr_t)
 Constructs a null-instance of ExceptionWrapper that does not represent any exception. More...
 
 ExceptionWrapperBase (const ExceptionPtr &ptr)
 Constructs a instance of ExceptionWrapper class that contains. More...
 
virtual const char * what () const noexcept override
 Calls the exception what() implementation. More...
 
ExceptionPtr Get () const
 Returns smart pointer to the instance of Exception class that wrapper contains. More...
 
bool IsNull () const
 Determines if the current Exception object is a null-object i.e. does not represent any exception. More...
 
bool operator== (const ExceptionWrapperBase &e) const
 Determines if the current and the specified Exception objects are equal. More...
 
bool operator== (const std::nullptr_t) const
 Determines if the current Exception object is a null-object i.e. does not represent any exception. More...
 
bool operator!= (const std::nullptr_t) const
 Determines if the current Exception object is not a null-object i.e. represents an exception. More...
 
bool Equals (const ExceptionWrapperBase &e) const
 Determines if the current and the specified Exception objects are equal. More...
 
bool Is (const System::TypeInfo &target) const
 Checks if exception object is of specific type or its child type. Follows C# 'is' semantics. More...
 
int GetHashCode () const
 Calls GetHashCode() on exception pointer. More...
 
String ToString () const
 Calls ToString() on exception pointer. More...
 

Protected Attributes

ExceptionPtr m_ptr
 Pointer to real Exception class. More...
 

Detailed Description

Base exception class that implements logic for correct exception handling Contains smart pointer to exception instance.

Constructor & Destructor Documentation

◆ ExceptionWrapperBase() [1/2]

System::ExceptionWrapperBase::ExceptionWrapperBase ( std::nullptr_t  )

Constructs a null-instance of ExceptionWrapper that does not represent any exception.

◆ ExceptionWrapperBase() [2/2]

System::ExceptionWrapperBase::ExceptionWrapperBase ( const ExceptionPtr ptr)

Constructs a instance of ExceptionWrapper class that contains.

Parameters
ptrSmart pointer to the instance of Exception class.

Member Function Documentation

◆ Equals()

bool System::ExceptionWrapperBase::Equals ( const ExceptionWrapperBase e) const

Determines if the current and the specified Exception objects are equal.

Parameters
eThe Exception object to compare the current object with
Returns
True if the currnent and the specified objects are the same object or both represent the same exception or both do not represent any exceptions (are null-objects), otherwise - false

◆ Get()

ExceptionPtr System::ExceptionWrapperBase::Get ( ) const
inline

Returns smart pointer to the instance of Exception class that wrapper contains.

Returns
ptr Smart pointer to the instance of Exception class.

◆ GetHashCode()

int System::ExceptionWrapperBase::GetHashCode ( ) const

Calls GetHashCode() on exception pointer.

Returns
Result of GetHashCode() call on referenced object (if any) or 0.

◆ Is()

bool System::ExceptionWrapperBase::Is ( const System::TypeInfo target) const

Checks if exception object is of specific type or its child type. Follows C# 'is' semantics.

Parameters
targetSpecifies target type to check against.
Returns
True if C# 'is'-style check is positive and false otherwise.

◆ IsNull()

bool System::ExceptionWrapperBase::IsNull ( ) const

Determines if the current Exception object is a null-object i.e. does not represent any exception.

Returns
True if the current Exception object is a null-object, otherwise - false

◆ operator!=()

bool System::ExceptionWrapperBase::operator!= ( const std::nullptr_t  ) const

Determines if the current Exception object is not a null-object i.e. represents an exception.

Returns
True if the current Exception object is not a null-object, otherwise - false

◆ operator==() [1/2]

bool System::ExceptionWrapperBase::operator== ( const ExceptionWrapperBase e) const

Determines if the current and the specified Exception objects are equal.

Parameters
eThe Exception object to compare the current object with
Returns
True if the currnent and the specified objects are the same object or both represent the same exception or both do not represent any exceptions (are null-objects), otherwise - false

◆ operator==() [2/2]

bool System::ExceptionWrapperBase::operator== ( const std::nullptr_t  ) const

Determines if the current Exception object is a null-object i.e. does not represent any exception.

Returns
True if the current Exception object is a null-object, otherwise - false

◆ ToString()

String System::ExceptionWrapperBase::ToString ( ) const

Calls ToString() on exception pointer.

Returns
Result of ToString() call on referenced object.

◆ what()

virtual const char* System::ExceptionWrapperBase::what ( ) const
overridevirtualnoexcept

Calls the exception what() implementation.

Returns
The description of the exception.

Member Data Documentation

◆ m_ptr

ExceptionPtr System::ExceptionWrapperBase::m_ptr
protected

Pointer to real Exception class.