solinject
1.0.0
C++17 Dependency Injection header-only library
|
Go to the documentation of this file.
24 #include <type_traits>
28 namespace sol::di::impl
34 template<
class TService,
class...TServiceParents>
41 "The TServiceParents types must be derived from the TService type"
70 auto service = m_Factory(container);
74 return std::static_pointer_cast<void>(service);
Dependency Injection container.
Definition: Container.hpp:48
typename Base::Container Container
DI container.
Definition: ServiceBase.hpp:48
TransientService(Factory factory)
Constructor.
Definition: TransientService.hpp:63
#define solinject_req_assert(expression)
Required assert, which is disabled only when the assert() macro from assert.h is disabled.
Definition: Defines.hpp:41
virtual VoidPtr GetServiceAsVoidPtr(const Container &container) override
Resolves a service.
Definition: TransientService.hpp:68
Transient DI service.
Definition: TransientService.hpp:35
typename Base::ServicePtr ServicePtr
Pointer to an instance of a service.
Definition: ServiceBase.hpp:42
typename Base::Factory Factory
Factory function that accepts a reference to a DI container and returns a pointer to an instance of a...
Definition: TransientService.hpp:54
Base for the DI service classes.
Definition: ServiceBase.hpp:35
std::shared_ptr< void > VoidPtr
Pointer to void.
Definition: IService.hpp:38
typename Base::ServicePtr ServicePtr
Pointer to an instance of a service.
Definition: TransientService.hpp:51
typename Base::Factory Factory
Factory function that accepts a reference to a DI container and returns a pointer to an instance of a...
Definition: ServiceBase.hpp:45