PLCnext API Documentation  21.0.0.35466
StackOverflowException.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  StackOverflowException(const char* message, const Args& ... args);
19  StackOverflowException(const String& message);
20  StackOverflowException(String&& message);
21  StackOverflowException(const String& message, const Exception& innerException);
22  StackOverflowException(String&& message, Exception&& innerException);
23  StackOverflowException(const StackOverflowException& arg) = default;
24  StackOverflowException(StackOverflowException&& arg) = default;
25  virtual ~StackOverflowException(void) = default;
26 
27 public: // static factory methods
28  static StackOverflowException Create(const String& stackTrace);
29 
30 protected: // overridden operations
31  Exception::Ptr Clone(void)const override;
32 
33 private: // deleted methods
34  StackOverflowException& operator=(const StackOverflowException& arg) = delete;
35 };
36 
38 // inline methods of class StackOverflowException
39 
41 template<typename... Args>
42 inline StackOverflowException::StackOverflowException(const char* message, const Args& ... args)
43  : PlcException(ExceptionTypeId::PlcStackOverflow, String::Format(message, args...))
44 {
45 }
46 
49  : PlcException(ExceptionTypeId::PlcStackOverflow, message)
50 {
51 }
52 
55  : PlcException(ExceptionTypeId::PlcStackOverflow, std::move(message))
56 {
57 }
58 
60 inline StackOverflowException::StackOverflowException(const String& message, const Exception& innerException)
61  : PlcException(ExceptionTypeId::PlcStackOverflow, message, innerException)
62 {
63 }
64 
67  : PlcException(ExceptionTypeId::PlcStackOverflow, std::move(message), std::move(innerException))
68 {
69 }
70 
71 }}}} // end of namesapce Arp::System::Commons::Plc
String Format(int indentLevel, bool withInnerException) const override
Formats this exception using the given indent level.
Namespace of the C++ standard library
This exception is used when a $$$TODO$$$ occurs.
Definition: StackOverflowException.hpp:14
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
ExceptionTypeId
Specifies the type id of any exception derived by <see cref="CommonException".
Definition: ExceptionTypeId.hpp:14
Root namespace for the PLCnext API
StackOverflowException(const char *message, const Args &... args)
Constructs an StackOverflowException instance.
Definition: StackOverflowException.hpp:42
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
Exception::Ptr Clone(void) const override
Clones this instance.