FEDEM Solver  R8.0
Source code of the dynamics solver
Static Public Member Functions | Protected Member Functions | Static Private Attributes | List of all members
FFaSingelton< T, Container > Class Template Reference

Template class for singleton classes. More...

#include <FFaSingelton.H>

Static Public Member Functions

static T * instance ()
 Returns the actual instance of this class. More...
 
static void removeInstance ()
 Deletes the dynamically allocated instance. More...
 
static bool allocated ()
 Returns true, if the instance has been allocated. More...
 

Protected Member Functions

 FFaSingelton ()
 The constructor is protected to allow objects of sub-classes only. More...
 
 FFaSingelton (const FFaSingelton &)=delete
 Disable default copy constructor. More...
 
FFaSingeltonoperator= (const FFaSingelton &)=delete
 Disable default assignment operator. More...
 

Static Private Attributes

static T * ourInstance = 0
 Points to the dynamically allocated instance. More...
 

Detailed Description

template<class T, class Container = T>
class FFaSingelton< T, Container >

Template class for singleton classes.

This class is used as a wrapper for classes for which there should only exist one instance. All referencing to the class members are then to be done via the instance() method.

Constructor & Destructor Documentation

◆ FFaSingelton() [1/2]

template<class T , class Container = T>
FFaSingelton< T, Container >::FFaSingelton ( )
inlineprotected

The constructor is protected to allow objects of sub-classes only.

◆ FFaSingelton() [2/2]

template<class T , class Container = T>
FFaSingelton< T, Container >::FFaSingelton ( const FFaSingelton< T, Container > &  )
protecteddelete

Disable default copy constructor.

Member Function Documentation

◆ allocated()

template<class T , class Container = T>
static bool FFaSingelton< T, Container >::allocated ( )
inlinestatic

Returns true, if the instance has been allocated.

◆ instance()

template<class T , class Container = T>
static T* FFaSingelton< T, Container >::instance ( )
inlinestatic

Returns the actual instance of this class.

The instance is allocated dynamically in the first invocation.

◆ operator=()

template<class T , class Container = T>
FFaSingelton& FFaSingelton< T, Container >::operator= ( const FFaSingelton< T, Container > &  )
protecteddelete

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.

Member Data Documentation

◆ ourInstance

template<class T , class Container >
T * FFaSingelton< T, Container >::ourInstance = 0
staticprivate

Points to the dynamically allocated instance.


The documentation for this class was generated from the following file: