PLCnext API Documentation 25.0.2.69
RaiiGuard.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/Base/Core/delegate.hxx"
9
10namespace Arp { namespace Base { namespace Core
11{
12
17class ARP_EXPORT RaiiGuard
18{
19public: // usings
20 using Operation = delegate<void(void)>;
21
22public: // construction/destruction/assignment
23 explicit RaiiGuard(Operation destructing);
24 RaiiGuard(Operation constructing, Operation destructing);
25 RaiiGuard(const RaiiGuard& arg) = delete;
26 RaiiGuard(RaiiGuard&& arg)noexcept = delete;
27 RaiiGuard& operator=(const RaiiGuard& arg) = delete;
28 RaiiGuard& operator=(RaiiGuard&& arg)noexcept = delete;
29 ~RaiiGuard(void);
30
31private: // fields
32 Operation constructing;
33 Operation destructing;
34};
35
36}}} // end of namespace Arp::Base::Core
37
38namespace Arp {
41}
This class is a utility class which provides a generic guard to implement the RAII idiom.
Definition: RaiiGuard.hpp:18
Root namespace for the PLCnext API