PLCnext API Documentation  22.9.0.33
Public Member Functions | Protected Member Functions | List of all members
Arp::System::Commons::CommonException Class Reference

This is the base class of common exception classes. More...

#include <CommonException.hpp>

Inheritance diagram for Arp::System::Commons::CommonException:
Inheritance graph

Public Member Functions

ExceptionTypeId GetTypeId (void) const
 Returns the ExceptionTypeId of this exception. More...
 
- Public Member Functions inherited from Arp::Exception
template<typename... Args>
 Exception (const char *message, const Args &... args)
 Constructs an instance of class Exception. More...
 
 Exception (const String &message)
 Constructs an instance of class Exception. More...
 
 Exception (String &&message)
 Constructs an instance of class Exception. More...
 
 Exception (const String &message, const Exception &innerException)
 Constructs an instance of class Exception. More...
 
 Exception (String &&message, Exception &&innerException)
 Constructs an instance of class Exception. More...
 
 Exception (const Exception &arg)=default
 Constructs an instance of class Exception. More...
 
 Exception (Exception &&arg)=default
 Constructs an instance of class Exception. More...
 
virtual ~Exception (void)=default
 Destructs this instance virually. More...
 
uint32 GetTypeCode (void) const
 Gets the type code of this exception. More...
 
const StringGetMessage (void) const
 Gets the error message of this exception. More...
 
bool HasInnerException (void) const
 Determines if this exception has an inner exception. More...
 
Exception::Ptr GetInnerException (void) const
 Gets the inner exception of this exception. More...
 
String ToString (void) const
 Gets a reasonable string representation of this exception. More...
 

Protected Member Functions

 CommonException (ExceptionTypeId typeId, const String &message, int skipStackTraceDepth=0)
 Constructs an CommonException instance. More...
 
 CommonException (ExceptionTypeId typeId, String &&message, int skipStackTraceDepth=0)
 Constructs an CommonException instance. More...
 
 CommonException (ExceptionTypeId typeId, const String &message, const Exception &innerException, int skipStackTraceDepth=0)
 Constructs an CommonException instance. More...
 
 CommonException (ExceptionTypeId typeId, String &&message, Exception &&innerException, int skipStackTraceDepth=0)
 Constructs an CommonException instance. More...
 
 CommonException (ExceptionTypeId typeId, String &&message, Exception::Ptr &&innerExceptionPtr, int skipStackTraceDepth=0)
 Constructs an CommonException instance. More...
 
 CommonException (const CommonException &arg)=default
 
 CommonException (CommonException &&arg)=default
 
String Format (int indentLevel, bool withInnerException) const override
 Formats this exception using the given indent level. More...
 
uint32 GetTypeCodeInternal (void) const override
 Get the type code of this exception. Must be overridden by derived classes. More...
 
- Protected Member Functions inherited from Arp::Exception
 Exception (String &&message, const Exception::Ptr &innerExceptionPtr)
 Constructs an instance of class Exception. More...
 
virtual Exception::Ptr Clone (void) const
 Clones this instance. More...
 

Additional Inherited Members

- Public Types inherited from Arp::Exception
typedef std::shared_ptr< ExceptionPtr
 The smart pointer tpye of this class. More...
 
- Static Protected Attributes inherited from Arp::Exception
static const int indentSize = 3
 The indentation size (count of blanks)
 
static const int indentChar = ' '
 The indentation character (blank)
 
static const int innerIndentChar = '-'
 The indentation character to indent inner exceptions.
 

Detailed Description

This is the base class of common exception classes.

Constructor & Destructor Documentation

◆ CommonException() [1/5]

Arp::System::Commons::CommonException::CommonException ( ExceptionTypeId  typeIdArg,
const String messageArg,
int  skipStackTraceDepth = 0 
)
inlineprotected

Constructs an CommonException instance.

◆ CommonException() [2/5]

Arp::System::Commons::CommonException::CommonException ( ExceptionTypeId  typeIdArg,
String &&  messageArg,
int  skipStackTraceDepth = 0 
)
inlineprotected

Constructs an CommonException instance.

◆ CommonException() [3/5]

Arp::System::Commons::CommonException::CommonException ( ExceptionTypeId  typeIdArg,
const String messageArg,
const Exception innerException,
int  skipStackTraceDepth = 0 
)
inlineprotected

Constructs an CommonException instance.

◆ CommonException() [4/5]

Arp::System::Commons::CommonException::CommonException ( ExceptionTypeId  typeIdArg,
String &&  messageArg,
Exception &&  innerException,
int  skipStackTraceDepth = 0 
)
inlineprotected

Constructs an CommonException instance.

◆ CommonException() [5/5]

Arp::System::Commons::CommonException::CommonException ( ExceptionTypeId  typeIdArg,
String &&  messageArg,
Exception::Ptr &&  innerExceptionPtrArg,
int  skipStackTraceDepth = 0 
)
inlineprotected

Constructs an CommonException instance.

Member Function Documentation

◆ Format()

String Arp::System::Commons::CommonException::Format ( int  indentLevel,
bool  withInnerException 
) const
overrideprotectedvirtual

Formats this exception using the given indent level.

Parameters
indentLevelThe indentation level used for formatting.
withInnerExceptionIf true the inner exception (if any) sould be formatted into the resulting string as well.
Returns
The formatted string representation of this instance.

Reimplemented from Arp::Exception.

◆ GetTypeCodeInternal()

uint32 Arp::System::Commons::CommonException::GetTypeCodeInternal ( void  ) const
overrideprotectedvirtual

Get the type code of this exception. Must be overridden by derived classes.

Returns
The type code of this exception.

Implements the templated method pattern to retrieve the correct type code from derived exceptions.

Reimplemented from Arp::Exception.

◆ GetTypeId()

ExceptionTypeId Arp::System::Commons::CommonException::GetTypeId ( void  ) const
inline

Returns the ExceptionTypeId of this exception.

Returns
The ExceptionTypeId of this exception or ExceptionTypeId::None if the typeId was not set.

The documentation for this class was generated from the following file: