Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Private Attributes | List of all members
orxonox::ClassScopedSingletonWrapper< T, true > Class Template Reference

This class partially spezializes ClassScopedSingletonWrapper for classes T that are allowed to fail. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/singleton/ScopedSingletonWrapper.h>

Inheritance diagram for orxonox::ClassScopedSingletonWrapper< T, true >:
orxonox::ScopedSingletonWrapper orxonox::ScopeListener

Public Member Functions

 ClassScopedSingletonWrapper (const std::string &className)
 
 ~ClassScopedSingletonWrapper ()
 
virtual void activated () override
 Called if the Scope of the Singleton gets active (creates the instance) More...
 
virtual void deactivated () override
 Called if the Scope of this Singleton gets deactivated (destroys the instance) More...
 
void destroy (Destroyable *)
 Destroys the singleton instance - overloaded for Destroyable, calls Destroyable::destroy() More...
 
void destroy (void *)
 Destroys the singleton instance - overloaded for void*, calls delete. More...
 
- Public Member Functions inherited from orxonox::ScopedSingletonWrapper
 ScopedSingletonWrapper (const std::string &className)
 Constructor: Initializes all the values. More...
 
virtual ~ScopedSingletonWrapper ()=default
 

Private Attributes

T * singletonPtr_
 Unique instance of the singleton class T. More...
 

Additional Inherited Members

- Protected Member Functions inherited from orxonox::ScopeListener
 ScopeListener ()
 
virtual ~ScopeListener ()=default
 
- Protected Attributes inherited from orxonox::ScopedSingletonWrapper
const std::string className_
 The name of the scoped singleton class that is managed by this object. More...
 

Detailed Description

template<class T>
class orxonox::ClassScopedSingletonWrapper< T, true >

This class partially spezializes ClassScopedSingletonWrapper for classes T that are allowed to fail.

Parameters
TThe managed singleton class

Because T could fail when being created, this partial spezialization of ClassScopedSingletonWrapper uses a try-catch block to handle exceptions.

See ClassScopedSingletonWrapper for a full documentation of the basis template.

Constructor & Destructor Documentation

template<class T >
orxonox::ClassScopedSingletonWrapper< T, true >::ClassScopedSingletonWrapper ( const std::string &  className)
inline
template<class T >
orxonox::ClassScopedSingletonWrapper< T, true >::~ClassScopedSingletonWrapper ( )
inline

Member Function Documentation

template<class T >
virtual void orxonox::ClassScopedSingletonWrapper< T, true >::activated ( )
inlineoverridevirtual

Called if the Scope of the Singleton gets active (creates the instance)

Implements orxonox::ScopeListener.

template<class T >
virtual void orxonox::ClassScopedSingletonWrapper< T, true >::deactivated ( )
inlineoverridevirtual

Called if the Scope of this Singleton gets deactivated (destroys the instance)

Implements orxonox::ScopeListener.

template<class T >
void orxonox::ClassScopedSingletonWrapper< T, true >::destroy ( Destroyable )
inline

Destroys the singleton instance - overloaded for Destroyable, calls Destroyable::destroy()

template<class T >
void orxonox::ClassScopedSingletonWrapper< T, true >::destroy ( void )
inline

Destroys the singleton instance - overloaded for void*, calls delete.

Member Data Documentation

template<class T >
T* orxonox::ClassScopedSingletonWrapper< T, true >::singletonPtr_
private

Unique instance of the singleton class T.


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