PLCnext API Documentation 26.6.0.38
CommonExceptionBase.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/Base/Core/PimplPtr.hxx"
9#include "Arp/Base/Core/Exception.hpp"
10#include "Arp/Base/Core/ExceptionTypeId.hpp"
11#include "Arp/Base/Commons/Runtime/Stacktrace.hpp"
12#include "Arp/Base/Commons/Runtime/StackCounter.hpp"
13#include "Arp/Base/Commons/Arp.Base.Commons.hpp"
14
15namespace Arp::Base::Commons::Exceptions
16{
17
23class ARP_BASE_COMMONS_EXPORT CommonExceptionBase : public Arp::Base::Core::Exception
24{
25public: // Impl forward declaration
26 class Impl;
27
28public: // usings
31
32protected: // construction
33 CommonExceptionBase(void) = delete;
34 CommonExceptionBase(ExceptionTypeId typeId, String&& message, StackCounter stackCounter);
35 CommonExceptionBase(ExceptionTypeId typeId, const String& message, StackCounter stackCounter);
36 CommonExceptionBase(ExceptionTypeId typeId, String&& message, const Exception& innerException, StackCounter stackCounter);
37 CommonExceptionBase(ExceptionTypeId typeId, const String& message, const Exception& innerException, StackCounter stackCounter);
38
39 // canonical construction/destruction/assignment
44 ~CommonExceptionBase(void) override ;
45
46public: // setter/getter operations
47 const Stacktrace& GetStacktrace(void)const;
48 const Stacktrace::Items& GetStacktraceItems(void)const;
49
50protected: // overriden operations
51 String Format(bool withInnerException)const override ;
52
53private: // Impl usings
55
56private: // Impl fields
57 Pimpl pimpl;
58};
59
60} // end of namespace Arp::Base::Commons::Exceptions
This class serves as base class for all Arp commons exceptions.
Definition: CommonExceptionBase.hpp:24
CommonExceptionBase(CommonExceptionBase &&arg) noexcept
Default move constructor.
CommonExceptionBase & operator=(CommonExceptionBase &&arg) noexcept
Default move-assignment operator.
CommonExceptionBase & operator=(const CommonExceptionBase &arg)
Default copy-assignment operator.
~CommonExceptionBase(void) override
Default destructor.
CommonExceptionBase(const CommonExceptionBase &arg)
Default copy constructor.
This class is used to count sequenced operation calls, which are e.g. invoked during an exception thr...
Definition: StackCounter.hpp:20
This class provides a stacktrace.
Definition: Stacktrace.hpp:15
This is the base class of all Arp exception classes.
Definition: Exception.hpp:21
Adapter class to implement PImpl idiom.
Definition: PimplPtr.hxx:15
This class represents the Arp String. The implementation is based on std::string.
Definition: String.hpp:39
ExceptionTypeId
Specifies the type id of any exception derived by <see cref="CommonException".
Definition: ExceptionTypeId.hpp:15