Asposecpplib
System::ExceptionWrapper< T > Class Template Reference

Template that represents wrapper of exceptions that are derived from Exception class. More...

Public Types

using ExceptionType = T
 Used for casting functions. More...
 

Public Member Functions

 operator SharedPtr< Object > ()
 Implicit cast operator to SharedPtr<Object> More...
 
 ExceptionWrapper (std::nullptr_t)
 Constructs a null-instance of ExceptionWrapper class that does not represent any exception. More...
 
 ExceptionWrapper (const ExceptionPtr &ptr)
 Constructs a instance of ExceptionWrapper class that contains passed pointer. More...
 
 ExceptionWrapper (const ExceptionWrapper &other)
 Copy constructor. More...
 
 ExceptionWrapper (ExceptionWrapper &&other)
 Move constructor. More...
 
ExceptionWrapperoperator= (const ExceptionWrapper &other)
 Assignment operator. More...
 
ExceptionWrapperoperator= (ExceptionWrapper &&other)
 Move assignment operator. More...
 
template<typename ... Args, typename = std::enable_if_t<!IsForwardingOf<ExceptionPtr, Args...>::value && !IsForwardingOf<ExceptionWrapper<T>, Args...>::value>>
 ExceptionWrapper (Args &&...args)
 Constructor that forwards parameters to the Exception class constructors and creates smart pointer that holds new Exception class instance. More...
 
T * operator-> () const
 Allows to access members of the Exception object. More...
 

Static Public Member Functions

static void * operator new (std::size_t)=delete
 
static void * operator new[] (std::size_t)=delete
 
static const System::TypeInfoType ()
 Shortcut to get System::TypeInfo object for the Exception type. More...
 

Detailed Description

template<typename T>
class System::ExceptionWrapper< T >

Template that represents wrapper of exceptions that are derived from Exception class.

Member Typedef Documentation

◆ ExceptionType

template<typename T >
using System::ExceptionWrapper< T >::ExceptionType = T

Used for casting functions.

Constructor & Destructor Documentation

◆ ExceptionWrapper() [1/5]

template<typename T >
System::ExceptionWrapper< T >::ExceptionWrapper ( std::nullptr_t  )
inline

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

◆ ExceptionWrapper() [2/5]

template<typename T >
System::ExceptionWrapper< T >::ExceptionWrapper ( const ExceptionPtr ptr)
inline

Constructs a instance of ExceptionWrapper class that contains passed pointer.

Parameters
ptrSmart pointer to the instance of Exception class.

◆ ExceptionWrapper() [3/5]

template<typename T >
System::ExceptionWrapper< T >::ExceptionWrapper ( const ExceptionWrapper< T > &  other)
inline

Copy constructor.

Parameters
otherOther instance of wrapper class that must be copied.

◆ ExceptionWrapper() [4/5]

template<typename T >
System::ExceptionWrapper< T >::ExceptionWrapper ( ExceptionWrapper< T > &&  other)
inline

Move constructor.

Parameters
otherOther instance of wrapper class that must be moved.

◆ ExceptionWrapper() [5/5]

template<typename T >
template<typename ... Args, typename = std::enable_if_t<!IsForwardingOf<ExceptionPtr, Args...>::value && !IsForwardingOf<ExceptionWrapper<T>, Args...>::value>>
System::ExceptionWrapper< T >::ExceptionWrapper ( Args &&...  args)
inlineexplicit

Constructor that forwards parameters to the Exception class constructors and creates smart pointer that holds new Exception class instance.

Member Function Documentation

◆ operator new()

template<typename T >
static void* System::ExceptionWrapper< T >::operator new ( std::size_t  )
staticdelete

◆ operator new[]()

template<typename T >
static void* System::ExceptionWrapper< T >::operator new[] ( std::size_t  )
staticdelete

◆ operator SharedPtr< Object >()

template<typename T >
System::ExceptionWrapper< T >::operator SharedPtr< Object > ( )
inline

Implicit cast operator to SharedPtr<Object>

◆ operator->()

template<typename T >
T* System::ExceptionWrapper< T >::operator-> ( ) const
inline

Allows to access members of the Exception object.

Returns
Raw pointer to the Exception object.
Exceptions
System::NullReferenceExceptionif pointer is null.

◆ operator=() [1/2]

template<typename T >
ExceptionWrapper& System::ExceptionWrapper< T >::operator= ( const ExceptionWrapper< T > &  other)
inline

Assignment operator.

Parameters
otherOther instance of wrapper class that must be assigned.
Returns
Instance with new assigned value.

◆ operator=() [2/2]

template<typename T >
ExceptionWrapper& System::ExceptionWrapper< T >::operator= ( ExceptionWrapper< T > &&  other)
inline

Move assignment operator.

Parameters
otherOther instance of wrapper class that must be moved.
Returns
Instance with new moved value.

◆ Type()

template<typename T >
static const System::TypeInfo& System::ExceptionWrapper< T >::Type ( )
inlinestatic

Shortcut to get System::TypeInfo object for the Exception type.

Returns
Const reference to TypeInfo structure which describes Exception type.