lumiera::SingletonSubclassFactory< SI, Create, Life, Threading > Class Template Reference

#include <singletonsubclass.hpp>

Inheritance diagram for lumiera::SingletonSubclassFactory< SI, Create, Life, Threading >:

Inheritance graph
[legend]
Collaboration diagram for lumiera::SingletonSubclassFactory< SI, Create, Life, Threading >:

Collaboration graph
[legend]

List of all members.


Detailed Description

template<class SI, template< class > class Create = singleton::StaticCreate, template< class > class Life = singleton::AutoDestroy, template< class > class Threading = singleton::IgnoreThreadsafety>
class lumiera::SingletonSubclassFactory< SI, Create, Life, Threading >

Special variant of the SingletonFactory with the option of actually creating a subclass or wrap the product in some way.

For the user code, it should behave exactly like the standard SingletonFactory. The configuration of the product actually to be created is delayed until the ctor call, so it can be hidden away to the implementation of a class using the SingletonFactory.

See also:
configrules.cpp usage example

Definition at line 128 of file singletonsubclass.hpp.


Public Member Functions

template<class SU>
 SingletonSubclassFactory (singleton::UseSubclass< SU > &)
 The singleton-factory ctor configures what concrete type to create.

Constructor & Destructor Documentation

template<class SI, template< class > class Create = singleton::StaticCreate, template< class > class Life = singleton::AutoDestroy, template< class > class Threading = singleton::IgnoreThreadsafety>
template<class SU>
lumiera::SingletonSubclassFactory< SI, Create, Life, Threading >::SingletonSubclassFactory ( singleton::UseSubclass< SU > &   )  [inline]

The singleton-factory ctor configures what concrete type to create.

It takes type information passed as dummy parameter and installs a trampoline object in the static field of class Adapter to perform the necessary up/downcasts. This allows to use whatever policy class is desired, but parametrises this policy template with the concrete type to be created. (only the "create" policy needs to know the actual class, because it allocates storage)

Definition at line 145 of file singletonsubclass.hpp.


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

Generated on Tue Jan 6 17:21:28 2009 for Lumiera by  doxygen 1.5.6