PLCnext API Documentation 25.0.2.69
IoException.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 { namespace Io
11{
12
15{
16public: // construction/destruction
17 template<typename... Args>
18 IoException(const char* message, const Args& ... args);
19 IoException(const String& message);
20 IoException(String&& message);
21 IoException(const String& message, const Exception& innerException);
22 IoException(String&& message, Exception&& innerException);
23 IoException(const IoException& arg) = default;
24 IoException(IoException&& arg)noexcept = default;
25 virtual ~IoException(void) = default;
26
27protected: // construction
28 IoException(ExceptionTypeId typeId, String&& message, int skipStackTraceDepth = 3);
29 IoException(ExceptionTypeId typeId, const String& message, int skipStackTraceDepth = 3);
30 IoException(ExceptionTypeId typeId, String&& message, Exception&& innerException, int skipStackTraceDepth = 3);
31 IoException(ExceptionTypeId typeId, const String& message, const Exception& innerException, int skipStackTraceDepth = 3);
32
33protected: // overridden operations
34 Exception::Ptr Clone(void)const override;
35
36private: // deleted methods
37 IoException& operator=(const IoException& arg) = delete;
38};
39
41// inline methods of class IoException
42
44template<typename... Args>
45inline IoException::IoException(const char* message, const Args& ... args)
46 : CommonException(ExceptionTypeId::Io, String::Format(message, args...))
47{
48}
49
50}}}} // end of namesapce Arp::System::Commons::Io
51
53// template specialization of IoException formatter
54template<> struct fmt::formatter<Arp::System::Commons::Io::IoException> : 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 is the base class of all IO exceptions.
Definition: IoException.hpp:15
IoException(const char *message, const Args &... args)
Constructs an IoException instance.
Definition: IoException.hpp:45
Exception::Ptr Clone(void) const override
This operation clones this instance polymorpically as a deep copy.
Definition: IoException.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