lib/singletonpreconfigure.hpp File Reference


Detailed Description

Preconfiguration of some Singleton types, done by template specialisation.

Typically the client code just includes singleton.h and uses the Singleton type. But in some cases, we want to configure specific (dependency injection) behaviour at a central location. At some point, we may well have a full blown Dependency Manager, but for the moment using just some specialized Singleton type for some instances seems sufficient.

One reason why one wants special Singleton behaviour is testing: Without altering the executable, for running some tests we need to inject a Test Mock in place of some service object, so we can verify the behaviour of the code using this service. For this, we mix lumiera::test::MockInjector into the actual Singleton type.

Note:
we declare the specialisations into the target namespace
See also:
SingletonFactory

singletontestmocktest.hpp

Definition in file singletonpreconfigure.hpp.

#include "lib/test/mockinjector.hpp"

Include dependency graph for singletonpreconfigure.hpp:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  backend_interface
namespace  lumiera
namespace  lumiera::test

Classes

class  lumiera::Singleton< SI >
 Default Singleton configuration. More...
class  lumiera::Singleton< backend_interface::MediaAccessFacade >
class  lumiera::Singleton< test::TestSingletonO >


Generated on Tue Jan 6 17:20:53 2009 for Lumiera by  doxygen 1.5.6