PLCnext API Documentation 23.6.0.37
DivisionByZeroException.hpp
1
2//
3// Copyright PHOENIX CONTACT Electronics GmbH
4//
6#pragma once
8#include "Arp/System/Commons/Exceptions/Plc/PlcException.hpp"
9
10namespace Arp { namespace System { namespace Commons { namespace Plc
11{
12
15{
16public: // construction/destruction
17 template<typename... Args>
18 DivisionByZeroException(const char* message, const Args& ... args);
19 DivisionByZeroException(const String& message);
21 DivisionByZeroException(const String& message, int skipStackTraceDepth);
22 DivisionByZeroException(String&& message, int skipStackTraceDepth);
23 DivisionByZeroException(const String& message, const Exception& innerException);
24 DivisionByZeroException(String&& message, Exception&& innerException);
27 virtual ~DivisionByZeroException(void) = default;
28
29public: // static factory methods
30 static DivisionByZeroException Create(const String& message);
31 static DivisionByZeroException CreateWithStackTrace(const String& message, const String& additionalStackTrace, int skipStackTraceDepth = 0);
32
33protected: // overridden operations
34 Exception::Ptr Clone(void)const override;
35
36private: // deleted methods
37 DivisionByZeroException& operator=(const DivisionByZeroException& arg) = delete;
38
39private:
40 static const char* const defaultMessage;
41};
42
44// inline methods of class DivisionByZeroException
45
47template<typename... Args>
48inline DivisionByZeroException::DivisionByZeroException(const char* message, const Args& ... args)
49 : PlcException(ExceptionTypeId::PlcDivisionByZero, String::Format(message, args...))
50{
51}
52
55 : PlcException(ExceptionTypeId::PlcDivisionByZero, message)
56{
57}
58
61 : PlcException(ExceptionTypeId::PlcDivisionByZero, std::move(message))
62{
63}
64
66inline DivisionByZeroException::DivisionByZeroException(const String& message, int skipStackTraceDepth)
67 : PlcException(ExceptionTypeId::PlcDivisionByZero, message, skipStackTraceDepth)
68{
69}
70
72inline DivisionByZeroException::DivisionByZeroException(String&& message, int skipStackTraceDepth)
73 : PlcException(ExceptionTypeId::PlcDivisionByZero, std::move(message), skipStackTraceDepth)
74{
75}
76
78inline DivisionByZeroException::DivisionByZeroException(const String& message, const Exception& innerException)
79 : PlcException(ExceptionTypeId::PlcDivisionByZero, message, innerException)
80{
81}
82
85 : PlcException(ExceptionTypeId::PlcDivisionByZero, std::move(message), std::move(innerException))
86{
87}
88
89}}}} // end of namesapce Arp::System::Commons::Plc
This is the base class of all Arp exception classes.
Definition: Exception.hpp:16
std::shared_ptr< Exception > Ptr
The smart pointer tpye of this class.
Definition: Exception.hpp:19
This exception is used when a $$$TODO$$$ occurs.
Definition: DivisionByZeroException.hpp:15
Exception::Ptr Clone(void) const override
Clones this instance.
DivisionByZeroException(const char *message, const Args &... args)
Constructs an DivisionByZeroException instance.
Definition: DivisionByZeroException.hpp:48
This exception is used when a $$$TODO$$$ occurs.
Definition: PlcException.hpp:15
ExceptionTypeId
Specifies the type id of any exception derived by <see cref="CommonException".
Definition: ExceptionTypeId.hpp:15
Root namespace for the PLCnext API
Namespace of the C++ standard library