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 exception.

Inherited by System::ExceptionWrapper< Details_Exception >.

Public Member Functions

ASPOSECPP_SHARED_API ExceptionWrapperBase (std::nullptr_t)
 Constructs a null-instance of ExceptionWrapper that does not represent any exception. More...
 
ASPOSECPP_SHARED_API ExceptionWrapperBase (const ExceptionPtr &ptr)
 Constructs a instance of ExceptionWrapper class that contains. More...
 
virtual ASPOSECPP_SHARED_API 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...
 
ASPOSECPP_SHARED_API bool IsNull () const
 Determines if the current Exception object is a null-object i.e. does not represent any exception. More...
 
ASPOSECPP_SHARED_API bool operator== (const ExceptionWrapperBase &e) const
 Determines if the current and the specified Exception objects are equal. More...
 
ASPOSECPP_SHARED_API 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...
 
ASPOSECPP_SHARED_API bool operator!= (const std::nullptr_t) const
 Determines if the current Exception object is not a null-object i.e. represents an exception. More...
 
ASPOSECPP_SHARED_API bool Equals (const ExceptionWrapperBase &e) const
 Determines if the current and the specified Exception objects are equal. More...
 
ASPOSECPP_SHARED_API bool Is (const System::TypeInfo &target) const
 Checks if exception object is of specific type or its child type. Follows C# 'is' semantics. More...
 
ASPOSECPP_SHARED_API int GetHashCode () const
 Calls GetHashCode() on exception pointer. More...
 
ASPOSECPP_SHARED_API String ToString () const
 Calls ToString() on exception pointer. 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]

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

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

◆ ExceptionWrapperBase() [2/2]

ASPOSECPP_SHARED_API 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()

ASPOSECPP_SHARED_API 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()

ASPOSECPP_SHARED_API int System::ExceptionWrapperBase::GetHashCode ( ) const

Calls GetHashCode() on exception pointer.

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

◆ Is()

ASPOSECPP_SHARED_API 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()

ASPOSECPP_SHARED_API 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!=()

ASPOSECPP_SHARED_API 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]

ASPOSECPP_SHARED_API 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]

ASPOSECPP_SHARED_API 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()

ASPOSECPP_SHARED_API String System::ExceptionWrapperBase::ToString ( ) const

Calls ToString() on exception pointer.

Returns
Result of ToString() call on referenced object.

◆ what()

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

Calls the exception what() implementation.

Returns
The description of the exception.