ServiceDescriptor#
-
class ServiceDescriptor#
Public Types
-
using Ptr = std::unique_ptr<ServiceDescriptor>#
Public Functions
-
ServiceDescriptor(TypeId serviceTypeId, TypeId implementationTypeId, ServiceLifeTime lifeTime, IServiceFactory::Ptr implementationFactory, ptrdiff_t castOffset = 0)#
Construct a new service descriptor object.
- Parameters:
serviceTypeId – - service type identifier
implementationTypeId – - service implementation type identifier, type must inhetit from service type
lifeTime – - service life time: Singleton, Scoped or Transient
implementationFactory – - service implementation factory, can be nullptr in that case describer is treated as alias
castOffset – - cast offset is a difference in bytes between implementation pointer and casted service pointer, should be non zero for multiinheritance scenarios
-
ServiceDescriptor(const ServiceDescriptor &other) = default#
-
ServiceDescriptor(ServiceDescriptor &&other) = default#
-
ServiceDescriptor &operator=(const ServiceDescriptor &other) = default#
-
ServiceDescriptor &operator=(ServiceDescriptor &&other) = default#
-
ServiceLifeTime getLifeTime() const#
Get the lifetime object.
-
const IServiceFactory &getImplementationFactory() const#
Get the service implementation factory.
-
ptrdiff_t getCastOffset() const#
Get the service cast offset, non zero for multiinheritance.
-
bool isAlias() const#
Check if service is alias (implementation factory is nullptr)
-
bool operator!=(const ServiceDescriptor &descriptor) const#
-
bool operator==(const ServiceDescriptor &descriptor) const#
-
using Ptr = std::unique_ptr<ServiceDescriptor>#