DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
ServiceProvider.h
Go to the documentation of this file.
1#pragma once
2
9#include <typeindex>
10
11namespace DotNetDupe {
12 namespace Extensions {
13 namespace DependencyInjection {
14
21 public:
25
29
32
37
39 DOTNETDUPE_API void Dispose() override;
40
41 private:
43
44 bool m_bIsRoot;
45 ServiceProvider* m_pRootProvider;
46
47 struct Impl;
49 };
50
73
94 }
95 }
96}
#define DOTNETDUPE_API
Platform-specific linkage decoration for exporting or importing library symbols.
Definition Common.h:20
Provides a re-entrant mutual exclusion primitive for thread synchronization.
Defines a mechanism for retrieving a service object; that is, an object that provides custom support ...
Specifies the contract for a collection of service descriptors.
Defines a factory interface used to create instances of IServiceScope.
Controls the lifetime of a scoped service.
Describes a service with its service type, implementation, and lifetime.
Default IoC service provider for resolving dependencies.
void Dispose() override
Disposes all resolved singleton instances and clears cached references.
ServiceProvider(const IServiceCollection &collection)
Initializes a root ServiceProvider from an IServiceCollection.
DotNetDupe::System::SmartPointer< DotNetDupe::System::Object > GetService(const std::type_index &serviceType) override
Resolves a service object of the specified type.
ServiceScopeFactory(ServiceProvider *pProvider)
Initializes a ServiceScopeFactory bound to a root provider.
~ServiceScopeFactory() override=default
Virtual destructor.
DotNetDupe::System::SmartPointer< IServiceScope > CreateScope() override
Creates a new child IServiceScope.
DotNetDupe::System::SmartPointer< DotNetDupe::System::IServiceProvider > GetServiceProvider() const override
Gets the scoped IServiceProvider.
void Dispose() override
Disposes the scope and all scoped instances created within it.
ServiceScope(DotNetDupe::System::SmartPointer< ServiceProvider > pProvider)
Initializes a ServiceScope wrapping a scoped ServiceProvider.
Provides a mechanism for releasing unmanaged resources.
Definition IDisposable.h:13
Defines a mechanism for retrieving a service object; that is, an object that provides custom support ...
A unified smart pointer that supports both unique and shared ownership semantics.