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.
singletontestmocktest.hpp
Definition in file singletonpreconfigure.hpp.
#include "lib/test/mockinjector.hpp"


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 > |
1.5.6