Orxonox  0.0.5 Codename: Arcturus
Static Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
orxonox::Singleton< T > Class Template Reference

Base for singleton classes. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/util/Singleton.h>

Inheritance diagram for orxonox::Singleton< T >:
orxonox::DynLibManager orxonox::ScreenshotManager orxonox::SignalHandler

Static Public Member Functions

static bool exists ()
 Tells whether the singleton has been created. More...
 
static T & getInstance ()
 Returns a reference to the singleton instance. More...
 

Protected Member Functions

 Singleton ()
 Constructor sets the singleton instance pointer. More...
 
virtual ~Singleton ()
 Destructor resets the singleton instance pointer. More...
 

Private Member Functions

 Singleton (const Singleton &)=delete
 
Singletonoperator= (const Singleton &)=delete
 

Detailed Description

template<class T>
class orxonox::Singleton< T >

Base for singleton classes.

Usage: Inherit publicly from Singleton<MyClass> and provide access to MyClass::singletonPtr_s. This can easily be done with a friend declaration.

See this example for an exemplary implementation.

Constructor & Destructor Documentation

template<class T>
orxonox::Singleton< T >::Singleton ( )
inlineprotected

Constructor sets the singleton instance pointer.

template<class T>
virtual orxonox::Singleton< T >::~Singleton ( )
inlineprotectedvirtual

Destructor resets the singleton instance pointer.

template<class T>
orxonox::Singleton< T >::Singleton ( const Singleton< T > &  )
privatedelete

Member Function Documentation

template<class T>
static bool orxonox::Singleton< T >::exists ( )
inlinestatic

Tells whether the singleton has been created.

template<class T>
static T& orxonox::Singleton< T >::getInstance ( )
inlinestatic

Returns a reference to the singleton instance.

template<class T>
Singleton& orxonox::Singleton< T >::operator= ( const Singleton< T > &  )
privatedelete

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