PLCnext API Documentation 26.6.0.38
NotImplementedException.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/Base/Core/PimplPtr.hxx"
9#include "Arp/Base/Commons/Exceptions/CommonExceptionBase.hpp"
10
11namespace Arp::Base::Commons::Exceptions
12{
13
16class ARP_BASE_COMMONS_EXPORT NotImplementedException : public CommonExceptionBase
17{
18public: // Impl forward declaration
19 class Impl;
20
21public: // construction
22 template<typename... Args>
23 explicit NotImplementedException(const char* message, const Args& ... args);
24 explicit NotImplementedException(String&& message);
25 explicit NotImplementedException(const String& message);
26 NotImplementedException(String&& message, const Exception& innerException);
27 NotImplementedException(const String& message, const Exception& innerException);
28
29 // canonical construction/destruction/assignment
34 ~NotImplementedException(void) override ;
35
36protected: // construction
37 NotImplementedException(ExceptionTypeId typeId, String&& message, StackCounter stackCounter);
38
39public: // static factory operations
40 static NotImplementedException Create(const char* functionName);
41
42public: // internal operations
43 Impl& GetImpl(void);
44 const Impl& GetImpl(void)const;
45
46protected: // overridden operations
47 Exception::Ptr Clone(void)const override ;
48
49private: // static factory methods
50 static NotImplementedException CreateImpl(const char* functionName, StackCounter stackCounter);
51
52private: // Impl usings
54
55private: // Impl fields
56 Pimpl pimpl;
57};
58
60// inline methods of class ArgumentException
61
68template<typename... Args>
69inline NotImplementedException::NotImplementedException(const char* message, const Args& ... args)
70 : NotImplementedException(ExceptionTypeId::NotImplemented, String::Format(message, args...), StackCounter())
71{
72}
73
74} // end of namespace Arp::Base::Commons::Exceptions
75
76namespace Arp {
77// Import exception into Arp namespace as Arp::System::Commons library does
79} // end of namespace Arp
81// template specialization of NotImplementedException formatter
82template<> struct fmt::formatter<Arp::Base::Commons::Exceptions::NotImplementedException> : public fmt::ostream_formatter {};
This class serves as base class for all Arp commons exceptions.
Definition: CommonExceptionBase.hpp:24
This exception is thrown when an operation was not implemented yet.
Definition: NotImplementedException.hpp:17
NotImplementedException & operator=(const NotImplementedException &arg)
Default copy-assignment operator.
NotImplementedException(const char *message, const Args &... args)
Creates an NotImplementedException with message.
Definition: NotImplementedException.hpp:69
NotImplementedException(NotImplementedException &&arg) noexcept
Default move constructor.
NotImplementedException & operator=(NotImplementedException &&arg) noexcept
Default move-assignment operator.
NotImplementedException(const NotImplementedException &arg)
Default copy constructor.
~NotImplementedException(void) override
Default destructor.
This class is used to count sequenced operation calls, which are e.g. invoked during an exception thr...
Definition: StackCounter.hpp:20
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
Adapter class to implement PImpl idiom.
Definition: PimplPtr.hxx:15
This class represents the Arp String. The implementation is based on std::string.
Definition: String.hpp:39
@ 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