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/CommonException.hpp"
9
10namespace Arp { namespace System { namespace Commons
11{
12
15{
16public: // construction/destruction
17 template<typename... Args>
18 IndexOutOfRangeException(const char* message, const Args& ... args);
19 IndexOutOfRangeException(const String& message);
21 IndexOutOfRangeException(const String& message, const Exception& innerException);
22 IndexOutOfRangeException(String&& message, Exception&& innerException);
25 virtual ~IndexOutOfRangeException(void) = default;
26
27protected: // overridden operations
28 Exception::Ptr Clone(void)const override;
29
30private: // deleted methods
31 IndexOutOfRangeException& operator=(const IndexOutOfRangeException& arg) = delete;
32};
33
35// inline methods of class IndexOutOfRangeException
36
38template<typename... Args>
39inline IndexOutOfRangeException::IndexOutOfRangeException(const char* message, const Args& ... args)
40 : CommonException(ExceptionTypeId::IndexOutOfRange, String::Format(message, args...))
41{
42}
43
44}}} // end of namesapce Arp::System::Commons
45
47// template specialization of IndexOutOfRangeException formatter
48template<> struct fmt::formatter<Arp::System::Commons::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
This is the base class of common exception classes.
Definition: CommonException.hpp:18
This exception is used when an index is out of range.
Definition: IndexOutOfRangeException.hpp:15
Exception::Ptr Clone(void) const override
This operation clones this instance polymorpically as a deep copy.
Definition: IndexOutOfRangeException.cpp:12
IndexOutOfRangeException(const char *message, const Args &... args)
Constructs an IndexOutOfRangeException instance.
Definition: IndexOutOfRangeException.hpp:39
ExceptionTypeId
Specifies the type id of any exception derived by <see cref="CommonException".
Definition: ExceptionTypeId.hpp:15
Root namespace for the PLCnext API