PLCnext API Documentation  22.6.0.43
ParseException.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/CommonException.hpp"
9 
10 namespace Arp { namespace System { namespace Commons
11 {
12 
15 {
16 public: // construction/destruction
17  template<typename... Args>
18  ParseException(const char* message, const Args& ... args);
19  ParseException(const String& message);
20  ParseException(String&& message);
21  ParseException(const String& message, const Exception& innerException);
22  ParseException(String&& message, Exception&& innerException);
23  ParseException(const ParseException& arg) = default;
24  ParseException(ParseException&& arg) = default;
25  virtual ~ParseException(void) = default;
26 
27 protected: // overridden operations
28  Exception::Ptr Clone(void)const override;
29 
30 private: // deleted methods
31  ParseException& operator=(const ParseException& arg) = delete;
32 };
33 
35 // inline methods of class ParseException
36 
38 template<typename... Args>
39 inline ParseException::ParseException(const char* message, const Args& ... args)
40  : CommonException(ExceptionTypeId::Parse, String::Format(message, args...))
41 {
42 }
43 
45 inline ParseException::ParseException(const String& message)
46  : CommonException(ExceptionTypeId::Parse, message)
47 {
48 }
49 
52  : CommonException(ExceptionTypeId::Parse, std::move(message))
53 {
54 }
55 
57 inline ParseException::ParseException(const String& message, const Exception& innerException)
58  : CommonException(ExceptionTypeId::Parse, message, innerException)
59 {
60 }
61 
63 inline ParseException::ParseException(String&& message, Exception&& innerException)
64  : CommonException(ExceptionTypeId::Parse, std::move(message), std::move(innerException))
65 {
66 }
67 
68 }}} // end of namesapce Arp::System::Commons
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 exception is used when it fails to parse a string.
Definition: ParseException.hpp:15
Exception::Ptr Clone(void) const override
Clones this instance.
ParseException(const char *message, const Args &... args)
Constructs an ParseException instance.
Definition: ParseException.hpp:39
@ 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