Template for singleton classes.
More...
#include <FFaSingelton.H>
template<class T, class Container = T>
class FFaSingelton< T, Container >
Template for singleton classes.
This class is used as a wrapper for classes for which there should only exist one single instance (or none). All referencing to the class members are then to be done via the instance() method. The instance is heap-allocated on the first call to instance(), and can be explicitly deleted by the removeInstance() method.
◆ FFaSingelton() [1/2]
template<class T , class Container = T>
The constructor is protected to allow objects of sub-classes only.
◆ FFaSingelton() [2/2]
template<class T , class Container = T>
Disable default copy constructor.
◆ allocated()
template<class T , class Container = T>
Returns true, if the instance has been allocated.
◆ instance()
template<class T , class Container = T>
Returns the actual instance of this class.
The instance is allocated dynamically in the first invocation.
◆ operator=()
template<class T , class Container = T>
Disable default assignment operator.
◆ removeInstance()
template<class T , class Container = T>
| static void FFaSingelton< T, Container >::removeInstance |
( |
| ) |
|
|
inlinestatic |
Deletes the dynamically allocated instance.
This method is used to clean up memory before terminating.
◆ ourInstance
template<class T , class Container >
Points to the dynamically allocated instance.
The documentation for this class was generated from the following file: