8 #include "Arp/System/Core/Singleton.hxx" 9 #include "Arp/System/Core/AppDomain.hpp" 23 template <
class Derived>
31 typedef Derived Instance;
45 template <
class T = Instance,
class ...Args>
72 template <
class Derived>
73 template <
class T,
class ...Args>
78 if(pInstance !=
nullptr)
83 pInstance =
new T(std::forward<Args>(args)...);
90 template <
class Derived>
101 template <
class Derived>
105 if (pResult ==
nullptr)
112 template <
class Derived>
118 template <
class Derived>
static Derived & CreateInstance(Args &&... args)
Creates this singleton instance.
Definition: AppDomainSingleton.hxx:74
AppDomainSingleton(void)=default
The protected default constructor.
bool RemoveSingleton(void)
Removes the singleton pointer of the specified type from this AppDomain.
Definition: AppDomain.hpp:337
AppDomainSingleton< Derived > SingletonBase
Defines this type to be used from derived classes.
Definition: AppDomainSingleton.hxx:28
This (meta programming) class provides the C++ typename of the as template argument passed type...
Definition: TypeName.hxx:55
~AppDomainSingleton(void)=default
The protected default destructor.
static Derived & GetInstance(void)
Gets a reference of the singleton instance.
Definition: AppDomainSingleton.hxx:102
void AddSingleton(TSingleton *pSingleton)
Adds a singleton instance to this AppDomain.
Definition: AppDomain.hpp:292
Root namespace for the PLCnext API
This class implements the singleton pattern for singletons with process wide scope.
Definition: AppDomainSingleton.hxx:24
static void DisposeInstance(void)
Disposes this singleton instance.
Definition: AppDomainSingleton.hxx:119
static bool IsCreated(void)
Determines if the appdomain was created yet.
Definition: AppDomain.hpp:229
static Derived * GetInstancePtr(void)
Gets a pointer to the singleton instance.
Definition: AppDomainSingleton.hxx:113
TSingleton * GetSingletonPtr(void)
Gets the singleton pointer of the specified type.
Definition: AppDomain.hpp:319
static AppDomain & GetCurrent(void)
Gets the current AppDomain instance.
Definition: AppDomain.hpp:234
This is the base class of all Arp exception classes.
Definition: Exception.hpp:15
static bool IsCreated(void)
Determines if this singleton instance is created yet.
Definition: AppDomainSingleton.hxx:91