PLCnext API Documentation 25.0.2.69
ObjectDisposedException.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/System/Commons/Exceptions/CommonException.hpp"
9
10namespace Arp { namespace System { namespace Commons
11{
12
15{
16public: // construction/destruction
17 template<typename... Args>
18 ObjectDisposedException(const char* message, const Args& ... args);
19 ObjectDisposedException(const String& message);
21 ObjectDisposedException(const String& message, const Exception& innerException);
22 ObjectDisposedException(String&& message, Exception&& innerException);
25 virtual ~ObjectDisposedException(void) = default;
26
27protected: // overridden operations
28 Exception::Ptr Clone(void)const override;
29
30private: // deleted methods
31 ObjectDisposedException& operator=(const ObjectDisposedException& arg) = delete;
32};
33
35// inline methods of class ObjectDisposedException
36
38template<typename... Args>
39inline ObjectDisposedException::ObjectDisposedException(const char* message, const Args& ... args)
40 : CommonException(ExceptionTypeId::ObjectDisposed, String::Format(message, args...))
41{
42}
43
44}}} // end of namesapce Arp::System::Commons
45
47// template specialization of ObjectDisposedException formatter
48template<> struct fmt::formatter<Arp::System::Commons::ObjectDisposedException> : 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
This is the base class of common exception classes.
Definition: CommonException.hpp:18
This exception is used when a method call is invalid for object's current state.
Definition: ObjectDisposedException.hpp:15
ObjectDisposedException(const char *message, const Args &... args)
Constructs an ObjectDisposedException instance.
Definition: ObjectDisposedException.hpp:39
Exception::Ptr Clone(void) const override
This operation clones this instance polymorpically as a deep copy.
Definition: ObjectDisposedException.cpp:13
ExceptionTypeId
Specifies the type id of any exception derived by <see cref="CommonException".
Definition: ExceptionTypeId.hpp:15
Root namespace for the PLCnext API