#include <DependencyInjection.hpp>
◆ Add()
◆ AddSingleton() [1/2]
template<class TService , class TImplementation = TService>
178 {
179 const auto factory = [] (IServiceProvider&)
180 {
181 static const auto& service = TImplementation();
182 return service;
183 };
184 return AddSingleton<TService, TImplementation>(factory);
185 }
◆ AddSingleton() [2/2]
template<class TService , class TImplementation = TService>
189 {
190 const ServiceDescriptor descriptor {
191 typeid(TService),
192 factory,
194 };
195 return Add(descriptor);
196 }
ServiceCollection & Add(const ServiceDescriptor &descriptor) final
Definition: DependencyInjection.hpp:170
◆ AddTransient() [1/2]
template<class TService , class TImplementation = TService>
200 {
201 const auto factory = [] (IServiceProvider&)
202 {
203 TImplementation service;
204 return service;
205 };
206 return AddTransient<TService, TImplementation>(factory);
207 }
◆ AddTransient() [2/2]
template<class TService , class TImplementation = TService>
211 {
212 const ServiceDescriptor descriptor {
213 typeid(TService),
214 factory,
216 };
217 return Add(descriptor);
218 }
◆ BuildServiceProvider()
ServiceProvider DependencyInjection::ServiceCollection::BuildServiceProvider |
( |
| ) |
const |
|
inline |
◆ _descriptors
The documentation for this class was generated from the following file: