PLCnext API Documentation 23.6.0.37
IoException.hpp
1
2//
3// Copyright PHOENIX CONTACT Electronics GmbH
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
51inline IoException::IoException(const String& message)
52 : CommonException(ExceptionTypeId::Io, message)
53{
54}
55
58 : CommonException(ExceptionTypeId::Io, std::move(message))
59{
60}
61
63inline IoException::IoException(const String& message, const Exception& innerException)
64 : CommonException(ExceptionTypeId::Io, message, innerException)
65{
66}
67
69inline IoException::IoException(String&& message, Exception&& innerException)
70 : CommonException(ExceptionTypeId::Io, std::move(message), std::move(innerException))
71{
72}
73
75inline IoException::IoException(ExceptionTypeId typeId, String&& message, int skipStackTraceDepth)
76 : CommonException(typeId, std::move(message), skipStackTraceDepth)
77{
78}
79
81inline IoException::IoException(ExceptionTypeId typeId, const String& message, int skipStackTraceDepth)
82 : CommonException(typeId, message, skipStackTraceDepth)
83{
84}
85
87inline IoException::IoException(ExceptionTypeId typeId, String&& message, Exception&& innerException, int skipStackTraceDepth)
88 : CommonException(typeId, std::move(message), std::move(innerException), skipStackTraceDepth)
89{
90}
91
93inline IoException::IoException(ExceptionTypeId typeId, const String& message, const Exception& innerException, int skipStackTraceDepth)
94 : CommonException(typeId, message, innerException, skipStackTraceDepth)
95{
96}
97
98}}}} // end of namesapce Arp::System::Commons::Io
This is the base class of all Arp exception classes.
Definition: Exception.hpp:16
std::shared_ptr< Exception > Ptr
The smart pointer tpye of this class.
Definition: Exception.hpp:19
This is the base class of common exception classes.
Definition: CommonException.hpp:19
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
Clones this instance.
@ System
System components used by the System, Device, Plc or Io domains.
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