LifeV
FactorySingleton< SingletonType > Class Template Reference

implement the FactorySingleton pattern More...

#include <FactorySingleton.hpp>

+ Collaboration diagram for FactorySingleton< SingletonType >:

Private Member Functions

 FactorySingleton ()
 

Static Private Attributes

static instance_Type S_instance
 
static bool S_destroyed
 

Public typedefs

typedef SingletonType Singleton_Type
 
typedef FactoryPolicyLifeTimeDefault< Singleton_TypelifetimeFactoryPolicy_Type
 
typedef FactoryPolicyCreationUsingNew< Singleton_TypecreationFactoryPolicy_Type
 

Public static methods

static Singleton_Typeinstance ()
 return the instance of the FactorySingleton More...
 

Private typedefs

typedef Singleton_Typeinstance_Type
 

Private static methods

static void makeInstance ()
 
static void destroyFactorySingleton ()
 FactorySingleton::makeInstance (helper for Instance) More...
 

Detailed Description

template<typename SingletonType>
class LifeV::FactorySingleton< SingletonType >

implement the FactorySingleton pattern

A FactorySingleton pattern implementation using the ideas from Alexandrescu's book "modern C++ design" http://www.moderncppdesign.com/

Definition at line 59 of file FactorySingleton.hpp.

Member Typedef Documentation

◆ Singleton_Type

typedef SingletonType Singleton_Type

Definition at line 64 of file FactorySingleton.hpp.

◆ lifetimeFactoryPolicy_Type

◆ creationFactoryPolicy_Type

◆ instance_Type

typedef Singleton_Type* instance_Type
private

Definition at line 79 of file FactorySingleton.hpp.

Constructor & Destructor Documentation

◆ FactorySingleton()

FactorySingleton ( )
private

Member Function Documentation

◆ instance()

SingletonType & instance ( )
inlinestatic

return the instance of the FactorySingleton

Definition at line 110 of file FactorySingleton.hpp.

◆ makeInstance()

void makeInstance ( )
staticprivate

Definition at line 120 of file FactorySingleton.hpp.

+ Here is the caller graph for this function:

◆ destroyFactorySingleton()

void destroyFactorySingleton ( )
staticprivate

FactorySingleton::makeInstance (helper for Instance)

Definition at line 135 of file FactorySingleton.hpp.

+ Here is the caller graph for this function:

Field Documentation

◆ S_instance

FactorySingleton< SingletonType >::instance_Type S_instance
staticprivate

Definition at line 95 of file FactorySingleton.hpp.

◆ S_destroyed

bool S_destroyed
staticprivate

Definition at line 96 of file FactorySingleton.hpp.


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