|
Minimal Dependency Injection Framework for C++
Single file library for implementing the dependency injection pattern
|
Dependency injection pattern. More...
Classes | |
| struct | Injector |
| Custom injector. More... | |
| struct | instance |
| Injected instance of a service. More... | |
| struct | instance_set |
| Set of injected instances of a service. More... | |
Functions | |
| template<class Service > | |
| void | inject (const Injector< Service > &injector) |
| Inject a service provider using a custom injector. More... | |
| template<class Service , class Provider , typename... _Args> | |
| void | inject_transient (_Args &&...args) |
| Inject a transient instance to a Service. More... | |
| template<class Service , class Provider , typename... _Args> | |
| void | inject_singleton (_Args &&...args) |
| Inject a singleton instance to a Service. More... | |
| template<class Service , class Provider , typename... _Args> | |
| void | inject_thread_singleton (_Args &&...args) |
| Inject a per-thread singleton instance to a Service. More... | |
| template<class Service > | |
| void | add (const Injector< Service > &injector) |
| Inject a service provider using a custom injector. More... | |
| template<class Service , class Provider , typename... _Args> | |
| void | add_transient (_Args &&...args) |
| Inject a transient instance to a Service. More... | |
| template<class Service , class Provider , typename... _Args> | |
| void | add_singleton (_Args &&...args) |
| Inject a singleton instance to a Service. More... | |
| template<class Service , class Provider , typename... _Args> | |
| void | add_thread_singleton (_Args &&...args) |
| Inject a per-thread singleton instance to a Service. More... | |
Dependency injection pattern.
|
inline |
Inject a service provider using a custom injector.
| Service | Injectable service |
| injector | Service injector |
|
inline |
Inject a singleton instance to a Service.
| Service | Injectable service |
| Provider | Service provider |
| _Args | Constructor argument types |
| args | Constructor arguments |
|
inline |
Inject a per-thread singleton instance to a Service.
| Service | Injectable service |
| Provider | Service provider |
| _Args | Constructor argument types |
| args | Constructor arguments |
|
inline |
Inject a transient instance to a Service.
| Service | Injectable service |
| Provider | Service provider |
| _Args | Constructor argument types |
| args | Constructor arguments |
|
inline |
Inject a service provider using a custom injector.
| Service | Injectable service |
| injector | Service injector |
|
inline |
Inject a singleton instance to a Service.
| Service | Injectable service |
| Provider | Service provider |
| _Args | Constructor argument types |
| args | Constructor arguments |
|
inline |
Inject a per-thread singleton instance to a Service.
| Service | Injectable service |
| Provider | Service provider |
| _Args | Constructor argument types |
| args | Constructor arguments |
|
inline |
Inject a transient instance to a Service.
| Service | Injectable service |
| Provider | Service provider |
| _Args | Constructor argument types |
| args | Constructor arguments |