MIRA
Public Types | Public Member Functions | Static Public Member Functions | List of all members
ExplicitInstantiation< Trait > Class Template Reference

Implementation of the InstantiationPolicy that is used by the Singleton template. More...

#include <utils/Singleton.h>

Inheritance diagram for ExplicitInstantiation< Trait >:
Inheritance graph
[legend]

Public Types

typedef Base::Type Type
 

Public Member Functions

 ExplicitInstantiation ()
 
 ~ExplicitInstantiation ()
 Destroys and removes the shared singleton instance. More...
 

Static Public Member Functions

static Typeinstance ()
 

Detailed Description

template<typename Trait>
class mira::singleton::ExplicitInstantiation< Trait >

Implementation of the InstantiationPolicy that is used by the Singleton template.

This policy allows full control of the construction and destruction time of the singleton. The singleton must be instantiated (and hence destroyed) explicitly by the user. It will throw XLogical, if someone tries to create a second instance of the singleton. Due to the explicit instantiation, this singleton type is the only singleton that allows to pass parameters to the constructor.

Please note, that Singletons with this InstantiationPolicy can not take the CreationPolicy and LifetimePolicy into account. Those policies will be ignored.

Member Typedef Documentation

◆ Type

typedef Base::Type Type

Constructor & Destructor Documentation

◆ ExplicitInstantiation()

◆ ~ExplicitInstantiation()

~ExplicitInstantiation ( )
inline

Destroys and removes the shared singleton instance.

Subsequent calls to instance() will fail.

Member Function Documentation

◆ instance()

static Type& instance ( )
inlinestatic

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