PLCnext API Documentation 25.0.2.69
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 using StacktraceItems = Arp::Base::Commons::Runtime::Stacktrace::Items;
32
33protected: // canonical construction/destruction/assignment
38 ~CommonExceptionBase(void)override;
39
40protected: // construction/destruction/assignment
41 CommonExceptionBase(void) = delete;
42 CommonExceptionBase(ExceptionTypeId typeId, String&& message, StackCounter stackCounter);
43 CommonExceptionBase(ExceptionTypeId typeId, const String& message, StackCounter stackCounter);
44 CommonExceptionBase(ExceptionTypeId typeId, String&& message, const Exception& innerException, StackCounter stackCounter);
45 CommonExceptionBase(ExceptionTypeId typeId, const String& message, const Exception& innerException, StackCounter stackCounter);
46
47public: // setter/getter operations
48 const Stacktrace& GetStacktrace(void)const;
49 const StacktraceItems& GetStacktraceItems(void)const;
50
51protected: // overriden operations
52 String Format(bool withInnerException)const override;
53
54private: // Impl usings
56
57private: // Impl fields
58 Pimpl pimpl;
59};
60
61} // 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