solinject
1.0.0
C++17 Dependency Injection header-only library
|
Scoped DI service. More...
#include <ScopedService.hpp>
Public Types | |
using | Base = SingletonService< TService, TServiceParents... > |
Base of the ScopedService class. | |
using | Factory = typename Base::Factory |
Factory function that accepts a reference to a DI container and returns a pointer to an instance of a service. More... | |
using | VoidPtr = typename IService::VoidPtr |
Pointer to void. More... | |
![]() | |
using | Base = ServiceBase< TService > |
Base of the SingletonService class. | |
using | Container = typename Base::Container |
DI container. More... | |
using | ServicePtr = typename Base::ServicePtr |
Pointer to an instance of a service. More... | |
using | Factory = typename Base::Factory |
Factory function that accepts a reference to a DI container and returns a pointer to an instance of a service. More... | |
using | VoidPtr = typename IService::VoidPtr |
Pointer to void. More... | |
![]() | |
using | Base = IServiceTyped< TService > |
Base of the ServiceBase class. | |
using | ServicePtr = typename Base::ServicePtr |
Pointer to an instance of a service. More... | |
using | Factory = typename Base::Factory |
Factory function that accepts a reference to a DI container and returns a pointer to an instance of a service. More... | |
using | Container = typename Base::Container |
DI container. More... | |
![]() | |
using | ServicePtr = typename std::shared_ptr< TService > |
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. | |
![]() | |
using | Base = IServiceTyped< TServiceParents > |
Base of the ServiceBase class. | |
using | ServicePtr = typename Base::ServicePtr |
Pointer to an instance of a service. More... | |
using | Factory = typename Base::Factory |
Factory function that accepts a reference to a DI container and returns a pointer to an instance of a service. More... | |
using | Container = typename Base::Container |
DI container. More... | |
![]() | |
using | ServicePtr = typename std::shared_ptr< TServiceParents > |
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. | |
Public Member Functions | |
ScopedService (Factory factory) | |
Constructor. More... | |
![]() | |
SingletonService (ServicePtr service) | |
Constructor. More... | |
SingletonService (Factory factory) | |
Constructor. More... | |
![]() | |
virtual ServicePtr | GetService (const Container &container) |
Resolves the service and checks for circular dependencies. More... | |
![]() | |
virtual ServicePtr | GetService (const Container &container) |
Resolves the service and checks for circular dependencies. More... | |
Additional Inherited Members | |
![]() | |
virtual VoidPtr | GetServiceAsVoidPtr (const Container &container) override |
Resolves a service. More... | |
![]() | |
bool | m_IsLocked |
Field that indicates if the DI service is "locked". More... | |
![]() | |
bool | m_IsLocked |
Field that indicates if the DI service is "locked". More... | |
Scoped DI service.
T | service type |
using sol::di::impl::ScopedService< TService, TServiceParents >::Factory = typename Base::Factory |
Factory function that accepts a reference to a DI container and returns a pointer to an instance of a service.
using sol::di::impl::ScopedService< TService, TServiceParents >::VoidPtr = typename IService::VoidPtr |
Pointer to void.
|
inline |
Constructor.
factory | factory function |