15#ifndef SINGLETON_H_6014714286
16#define SINGLETON_H_6014714286
61template<
typename InstanceType >
88 if( instancePtr !=
nullptr )
106 instancePtr =
nullptr;
114 return instancePtr ==
nullptr ? *
new InstanceType() : *instancePtr;
122 return instancePtr !=
nullptr;
128template<
typename InstanceType >
129InstanceType* Singleton< InstanceType >::instancePtr =
nullptr;
Defines LibCarna::base::LibCarnaException and LibCarna::base::AssertionFailure.
#define LIBCARNA_ASSERT_EX(expression, description)
If the given expression is false, a break point is raised in debug mode and an AssertionFailure throw...
Represents an association.
static InstanceType & instance()
Returns the only instance from class InstanceType.
static void reset()
Deletes the only instance from class InstanceType.
Singleton()
Denotes that the instance was created. Default constructor is hidden.
InstanceType Instance
Denotes the class, that is derived from this class template.
static bool exists()
Tells whether the instance from class InstanceType currently exists.
virtual ~Singleton()
Denotes that the instance was deleted.
Defines LibCarna::base::noncopyable and NON_COPYABLE.
#define NON_COPYABLE
Marks the class that it is placed in as non-copyable.