PLCnext API Documentation 25.0.2.69
DivisionByZeroException.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/System/Commons/Exceptions/Plc/PlcException.hpp"
9
10namespace Arp { namespace System { namespace Commons { namespace Plc
11{
12
14{
15public: // construction/destruction
16 template<typename... Args>
17 DivisionByZeroException(const char* message, const Args& ... args);
18 DivisionByZeroException(const String& message);
20 DivisionByZeroException(const String& message, int skipStackTraceDepth);
21 DivisionByZeroException(String&& message, int skipStackTraceDepth);
22 DivisionByZeroException(const String& message, const Exception& innerException);
23 DivisionByZeroException(String&& message, Exception&& innerException);
26 virtual ~DivisionByZeroException(void) = default;
27
28public: // static factory methods
29 static DivisionByZeroException Create(const String& message);
30 static DivisionByZeroException CreateWithStackTrace(const String& message, const String& additionalStackTrace, int skipStackTraceDepth = 0);
31
32protected: // overridden operations
33 Exception::Ptr Clone(void)const override;
34
35private: // deleted methods
36 DivisionByZeroException& operator=(const DivisionByZeroException& arg) = delete;
37
38private:
39 static const char* const defaultMessage;
40};
41
43// inline methods of class DivisionByZeroException
44
46template<typename... Args>
47inline DivisionByZeroException::DivisionByZeroException(const char* message, const Args& ... args)
48 : PlcException(ExceptionTypeId::PlcDivisionByZero, String::Format(message, args...))
49{
50}
51
52}}}} // end of namesapce Arp::System::Commons::Plc
53
55// template specialization of DivisionByZeroException formatter
56template<> struct fmt::formatter<Arp::System::Commons::Plc::DivisionByZeroException> : public fmt::ostream_formatter {};
This is the base class of all Arp exception classes.
Definition: Exception.hpp:21
std::unique_ptr< Exception > Ptr
The smart pointer type of this class.
Definition: Exception.hpp:27
This class represents the Arp String. The implementation is based on std::string.
Definition: String.hpp:39
Definition: DivisionByZeroException.hpp:14
Exception::Ptr Clone(void) const override
This operation clones this instance polymorpically as a deep copy.
Definition: DivisionByZeroException.cpp:13
DivisionByZeroException(const char *message, const Args &... args)
Constructs an DivisionByZeroException instance.
Definition: DivisionByZeroException.hpp:47
static DivisionByZeroException Create(const String &message)
Creates an DivisionByZeroException instance using a default message text.
Definition: DivisionByZeroException.cpp:19
Definition: PlcException.hpp:14
ExceptionTypeId
Specifies the type id of any exception derived by <see cref="CommonException".
Definition: ExceptionTypeId.hpp:15
Root namespace for the PLCnext API