|
header_utils
|
Basic dependency injection framework. More...
Concepts | |
| concept | ghassanpl::di::has_default_lifetime |
| If the interface or implementation has a DefaultLifetime static member field, that specified lifetime will be used by default for that interface/implementation. | |
Classes | |
| struct | ghassanpl::di::Container |
| The container for implementations; used to request interfaces. More... | |
Enumerations | |
| enum class | ghassanpl::di::Lifetime { ghassanpl::di::Lifetime::Default , ghassanpl::di::Lifetime::Transient , ghassanpl::di::Lifetime::InstanceSingleton , ghassanpl::di::Lifetime::WeakSingleton , ghassanpl::di::Lifetime::ThreadSingleton } |
| Specifies the lifetime of an implementation. More... | |
Variables | |
| constexpr DefaultImplementationStruct | ghassanpl::di::DefaultImplementation |
| Used to specify an implementation is the default one for the interface being registered. | |
Basic dependency injection framework.
A tiny and as-simple-as-possible Dependency Injection/IoC library, based around shared_ptrs.
Works, but might contain bugs. Still, you should be able to register types, instances, factory functions, and the construction arguments should resolve automatically, so, a basic DI container.
Supports custom instance lifetimes (strong and weak singletons, per-thread singleton, multiple-instances), naming interfaces/instances, instance creation callbacks, and probably other stuff.
|
strong |
Specifies the lifetime of an implementation.