solinject
1.0.0
C++17 Dependency Injection header-only library
|
Scoped DI service builders collection. More...
#include <ScopedServiceBuilders.hpp>
Public Types | |
template<class T > | |
using | Factory = typename IServiceTyped< T >::Factory |
Factory function that accepts a reference to a DI container and returns a pointer to an instance of a service. More... | |
template<class T > | |
using | ServicePtr = typename IServiceTyped< T >::ServicePtr |
Pointer to an instance of a service. More... | |
using | DIServicePtr = std::shared_ptr< IService > |
Pointer to a IService instance. | |
using | ScopedServiceBuilderPtr = std::shared_ptr< IScopedServiceBuilder > |
Pointer to a scoped service builder. | |
using | RegisteredServicesMap = std::map< std::type_index, std::vector< DIServicePtr > > |
Map of registered DI services. | |
using | RegisteredServiceBuildersMap = std::map< std::type_index, std::vector< ScopedServiceBuilderPtr > > |
Map of registered DI service builders. | |
Public Member Functions | |
template<class T > | |
void | RegisterScopedService (Factory< T > factory) |
Registers a scoped service. More... | |
void | RegisterScopedService (std::type_index type, ScopedServiceBuilderPtr serviceBuilder) |
Registers a scoped service. More... | |
RegisteredServicesMap | BuildDIServices () const |
Builds DI services. More... | |
Scoped DI service builders collection.
using sol::di::impl::ScopedServiceBuilders::Factory = typename IServiceTyped<T>::Factory |
Factory function that accepts a reference to a DI container and returns a pointer to an instance of a service.
T | service type |
using sol::di::impl::ScopedServiceBuilders::ServicePtr = typename IServiceTyped<T>::ServicePtr |
Pointer to an instance of a service.
T | service type |
|
inline |
Builds DI services.
|
inline |
Registers a scoped service.
T | service type |
factory | factory function |
|
inline |
Registers a scoped service.
type | service type |
serviceBuilder | service builder |