ServiceContainer class
#include <liarsdice/di/service_container.hpp>
Constructors, destructors, conversion operators
- ServiceContainer() defaulted
- ~ServiceContainer() defaulted
- ServiceContainer(const ServiceContainer&) deleted
- ServiceContainer(ServiceContainer&&) deleted
Public functions
- auto operator=(const ServiceContainer&) -> ServiceContainer& deleted
- auto operator=(ServiceContainer&&) -> ServiceContainer& deleted
-
template<typename TInterface, typename TImplementation>void register_service(ServiceLifetime lifetime = ServiceLifetime::
Transient) -
template<typename TInterface>void register_factory(ServiceFactory<TInterface> factory, ServiceLifetime lifetime = ServiceLifetime::
Transient) -
template<typename TInterface>void register_instance(std::shared_ptr<TInterface> instance)
-
template<typename T>auto resolve() -> std::shared_ptr<T>
-
template<typename T>auto is_registered() const -> bool
- void clear()
- auto service_count() const -> size_t