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

 ExceptionWrapper (std::nullptr_t)
 Constructs a null-instance of ExceptionWrapper class that does not represent any exception. More...
 
 ExceptionWrapper (const ExceptionPtr &ptr)
 
 ExceptionWrapper (const ExceptionWrapper &other)
 
 ExceptionWrapper (ExceptionWrapper &&other)
 
ExceptionWrapperoperator= (const ExceptionWrapper &other)
 
ExceptionWrapperoperator= (ExceptionWrapper &&other)
 
template<typename ... Args, typename = std::enable_if_t<!IsForwardingOf<ExceptionPtr, Args...>::value && !IsForwardingOf<ExceptionWrapper<T>, Args...>::value>>
 ExceptionWrapper (Args &&...args)
 
T * operator-> () const
 

Static Public Member Functions

static const System::TypeInfoType ()
 

Protected Member Functions

 ExceptionWrapper (T *ptr)
 

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/6]

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/6]

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/6]

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/6]

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/6]

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.

◆ ExceptionWrapper() [6/6]

template<typename T>
System::ExceptionWrapper< T >::ExceptionWrapper ( T *  ptr)
inlineprotected

Constructs a instance of ExceptionWrapper class that contains passed instance.

Parameters
ptrRaw pointer to the instance of Exception class.

Member Function Documentation

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