PLCnext API Documentation  21.0.0.35466
IndexOutOfRangeException.hpp
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 #pragma once
7 #include "Arp/System/Core/Arp.h"
8 #include "Arp/System/Commons/Exceptions/Plc/PlcException.hpp"
9 
10 namespace Arp { namespace System { namespace Commons { namespace Plc
11 {
12 
15 {
16 public: // 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);
23  IndexOutOfRangeException(const IndexOutOfRangeException& arg) = default;
24  IndexOutOfRangeException(IndexOutOfRangeException&& arg) = default;
25  virtual ~IndexOutOfRangeException(void) = default;
26 
27 public: // static factory methods
28  static IndexOutOfRangeException Create(const String& stackTrace);
29 
30 protected: // overridden operations
31  Exception::Ptr Clone(void)const override;
32 
33 private: // deleted methods
34  IndexOutOfRangeException& operator=(const IndexOutOfRangeException& arg) = delete;
35 };
36 
38 // inline methods of class IndexOutOfRangeException
39 
41 template<typename... Args>
42 inline IndexOutOfRangeException::IndexOutOfRangeException(const char* message, const Args& ... args)
43  : PlcException(ExceptionTypeId::PlcIndexOutOfRange, String::Format(message, args...))
44 {
45 }
46 
49  : PlcException(ExceptionTypeId::PlcIndexOutOfRange, message)
50 {
51 }
52 
55  : PlcException(ExceptionTypeId::PlcIndexOutOfRange, std::move(message))
56 {
57 }
58 
60 inline IndexOutOfRangeException::IndexOutOfRangeException(const String& message, const Exception& innerException)
61  : PlcException(ExceptionTypeId::PlcIndexOutOfRange, message, innerException)
62 {
63 }
64 
67  : PlcException(ExceptionTypeId::PlcIndexOutOfRange, std::move(message), std::move(innerException))
68 {
69 }
70 
71 }}}} // end of namesapce Arp::System::Commons::Plc
This exception is used when an index is out of range.
Definition: IndexOutOfRangeException.hpp:14
IndexOutOfRangeException(const char *message, const Args &... args)
Constructs an IndexOutOfRangeException instance.
Definition: IndexOutOfRangeException.hpp:39
This exception is used when a $$$TODO$$$ occurs.
Definition: PlcException.hpp:16
std::shared_ptr< Exception > Ptr
The smart pointer tpye of this class.
Definition: Exception.hpp:19
static SelfType Format(const SelfType &format, const Args &... args)
Formats the format string using the .NET/Python syntax with the given variadic arguments.
Definition: BasicString.hxx:1482
Root namespace for the PLCnext API
Exception::Ptr Clone(void) const override
Clones this instance.
System components used by the System, Device, Plc or Io domains.
This is the base class of all Arp exception classes.
Definition: Exception.hpp:15