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

#include "exception.h"

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) noexcept
 Move constructor. More...
 
ExceptionWrapperoperator= (const ExceptionWrapper &other)
 Assignment operator. More...
 
ExceptionWrapperoperator= (ExceptionWrapper &&other) noexcept
 Move assignment operator. More...
 
template<typename ... Args, typename = std::enable_if_t< !System::Details::IsForwardingOf<ExceptionPtr, Args...>::value && !System::Details::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...
 

Protected Member Functions

 ExceptionWrapper (T *ptr)
 Constructs a instance of ExceptionWrapper class that contains passed instance. 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/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)
inlinenoexcept

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< !System::Details::IsForwardingOf<ExceptionPtr, Args...>::value && !System::Details::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 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)
inlinenoexcept

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.