PLCnext API Documentation 25.0.2.69
IndexOutOfRangeException.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/System/Commons/Exceptions/Plc/PlcException.hpp"
9
10namespace Arp { namespace System { namespace Commons { namespace Plc
11{
12
14{
15public: // construction/destruction
16 template<typename... Args>
17 IndexOutOfRangeException(const char* message, const Args& ... args);
18 IndexOutOfRangeException(const String& message);
20 IndexOutOfRangeException(const String& message, int skipStackTraceDepth);
21 IndexOutOfRangeException(String&& message, int skipStackTraceDepth);
22 IndexOutOfRangeException(const String& message, const Exception& innerException);
23 IndexOutOfRangeException(String&& message, Exception&& innerException);
26 virtual ~IndexOutOfRangeException(void) = default;
27
28public: // static factory methods
29 static IndexOutOfRangeException Create(const String& message);
30 static IndexOutOfRangeException CreateWithStackTrace(const String& message, const String& additionalStackTrace, int skipStackTraceDepth = 0);
31
32protected: // overridden operations
33 Exception::Ptr Clone(void)const override;
34
35private: // deleted methods
36 IndexOutOfRangeException& operator=(const IndexOutOfRangeException& arg) = delete;
37};
38
40// inline methods of class IndexOutOfRangeException
41
43template<typename... Args>
44inline IndexOutOfRangeException::IndexOutOfRangeException(const char* message, const Args& ... args)
45 : PlcException(ExceptionTypeId::PlcIndexOutOfRange, String::Format(message, args...))
46{
47}
48
49}}}} // end of namesapce Arp::System::Commons::Plc
50
52// template specialization of IndexOutOfRangeException formatter
53template<> struct fmt::formatter<Arp::System::Commons::Plc::IndexOutOfRangeException> : 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
Definition: IndexOutOfRangeException.hpp:14
IndexOutOfRangeException(const char *message, const Args &... args)
Constructs an IndexOutOfRangeException instance.
Definition: IndexOutOfRangeException.hpp:44
static IndexOutOfRangeException Create(const String &message)
Creates an IndexOutOfRangeException instance using a default message text.
Definition: IndexOutOfRangeException.cpp:19
Exception::Ptr Clone(void) const override
This operation clones this instance polymorpically as a deep copy.
Definition: IndexOutOfRangeException.cpp:13
Definition: PlcException.hpp:14
ExceptionTypeId
Specifies the type id of any exception derived by <see cref="CommonException".
Definition: ExceptionTypeId.hpp:15
Root namespace for the PLCnext API