solinject
1.0.0
C++17 Dependency Injection header-only library
|
DI service interface. More...
#include <IServiceTyped.hpp>
Public Types | |
using | ServicePtr = typename std::shared_ptr< T > |
Pointer to an instance of a service. | |
using | Factory = typename std::function< ServicePtr(const Container &)> |
Factory function that accepts a reference to a DI container and returns a pointer to an instance of a service. | |
![]() | |
using | Container = sol::di::Container |
DI container. | |
using | VoidPtr = std::shared_ptr< void > |
Pointer to void. | |
Public Member Functions | |
virtual ServicePtr | GetService (const Container &container)=0 |
Resolves the service. More... | |
![]() | |
virtual VoidPtr | GetServiceAsVoidPtr (const Container &container)=0 |
Resolves a service. More... | |
DI service interface.
|
pure virtual |
Resolves the service.
[in] | container | DI container |
Implemented in sol::di::impl::ServiceBase< T >, sol::di::impl::ServiceBase< TService >, and sol::di::impl::ServiceBase< TServiceParents >.