PLCnext API Documentation 25.0.2.69
NotImplementedException.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
7#ifndef ARP_USE_ARP_SYSTEM_COMMONS_EXCEPTIONS
8#include "Arp/Base/Commons/Exceptions/NotImplementedException.hpp"
9namespace Arp
10{
12}
13#else
14#include "Arp/System/Core/Arp.h"
15#include "Arp/System/Commons/Exceptions/CommonException.hpp"
16
17namespace Arp { namespace System { namespace Commons
18{
19
21class NotImplementedException : public CommonException
22{
23public: // construction/destruction
24 template<typename... Args>
25 NotImplementedException(const char* message, const Args& ... args);
26 NotImplementedException(const String& message);
27 NotImplementedException(String&& message);
28 NotImplementedException(const String& message, const Exception& innerException);
29 NotImplementedException(String&& message, Exception&& innerException);
30 NotImplementedException(const NotImplementedException& arg) = default;
31 NotImplementedException(NotImplementedException&& arg) = default;
32 virtual ~NotImplementedException(void) = default;
33
34public: // static factory methods
35 static NotImplementedException Create(const char* functionName);
36 static NotImplementedException Create(const char* functionName, const Exception& innerException);
37
38protected: // overridden operations
39 Exception::Ptr Clone(void)const override;
40
41private: // deleted methods
42 NotImplementedException& operator=(const NotImplementedException& arg) = delete;
43
44private:
45 static const char* const defaultMessage;
46};
47
49// inline methods of class NotImplementedException
50
51
53template<typename... Args>
54inline NotImplementedException::NotImplementedException(const char* message, const Args& ... args)
55 : CommonException(ExceptionTypeId::NotImplemented, String::Format(message, args...))
56{
57}
58
60inline NotImplementedException::NotImplementedException(const String& message)
61 : CommonException(ExceptionTypeId::NotImplemented, message)
62{
63}
64
66inline NotImplementedException::NotImplementedException(String&& message)
67 : CommonException(ExceptionTypeId::NotImplemented, std::move(message))
68{
69}
70
72inline NotImplementedException::NotImplementedException(const String& message, const Exception& innerException)
73 : CommonException(ExceptionTypeId::NotImplemented, message, innerException)
74{
75}
76
78inline NotImplementedException::NotImplementedException(String&& message, Exception&& innerException)
79 : CommonException(ExceptionTypeId::NotImplemented, std::move(message), std::move(innerException))
80{
81}
82
84inline NotImplementedException NotImplementedException::Create(const char* functionName)
85{
86 return NotImplementedException(defaultMessage, functionName);
87}
88
90inline NotImplementedException NotImplementedException::Create(const char* functionName, const Exception& innerException)
91{
92 return NotImplementedException(String::Format(defaultMessage, functionName), innerException);
93}
94
95}}} // end of namesapce Arp::System::Commons
96
98// template specialization of NotImplementedException formatter
99template<> struct fmt::formatter<Arp::System::Commons::NotImplementedException> : public fmt::ostream_formatter {};
100
101#endif // ndef ARP_USE_ARP_SYSTEM_COMMONS_EXCEPTIONS
This exception is thrown when an operation was not implemented yet.
Definition: NotImplementedException.hpp:17
NotImplementedException(const char *message, const Args &... args)
Creates an NotImplementedException with message.
Definition: NotImplementedException.hpp:68
std::unique_ptr< Exception > Ptr
The smart pointer type of this class.
Definition: Exception.hpp:27
@ Create
Creates a new file. If the file already exists, it is overwritten.
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