PLCnext API Documentation 25.0.2.69
AppDomainSingleton.hxx
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/Base/Core/TypeName.hxx"
9#include "Arp/Base/Core/Exception.hpp"
10#include "Arp/Base/Core/Detail/AppDomainSingletonBase.hpp"
11namespace Arp { namespace Base { namespace Core
12{
13
21template<class Derived>
22class ARP_DEPRECATED("Do not use this class any more, use global singleton pattern instead") AppDomainSingleton : protected AppDomainSingletonBase
23{
24public: // usings
25 using Instance = Derived;
26
27 ARP_DEPRECATED_IGNORE_BEGIN
28 using SingletonBase = AppDomainSingleton<Derived>; // used from within derived classes
29 ARP_DEPRECATED_IGNORE_END
30
31protected: // usings
32 using Base = AppDomainSingletonBase;
33
34public: // construction/destruction
35 AppDomainSingleton(void);
36
37public: // static operations
38 template<class T = Instance, class ...Args>
39 static Instance & CreateInstance(Args && ... args);
40 static bool IsCreated(void);
41 static Instance& GetInstance(void);
42 static void DisposeInstance(void);
43
44 ARP_DEPRECATED("Do not use this operation any more, use GetInstance() instead.")
45 static Instance* GetInstancePtr(void);
46
47private: // methods
48 static Derived* GetInstancePtrFromAppDomain(void);
49};
50
51}}} // end of namespace Arp::Base::Core
52
53namespace Arp
54{
55
56ARP_DEPRECATED_IGNORE_BEGIN
57
59using Arp::Base::Core::AppDomainSingleton;
60
61ARP_DEPRECATED_IGNORE_END
62}
63#include "Arp/Base/Core/Detail/AppDomainSingleton.ipp"
@ Instance
Instance member or field, respectively.
Root namespace for the PLCnext API
class ARP_DEPRECATED("Use Arp::Enum<T> instead.") EnumStrings
Deprecated! The class implements an adapter for enums to define the string literals of the enum entri...
Definition: EnumStrings.hxx:38