DependencyInjection
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations
DependencyInjection Namespace Reference

Classes

class  IServiceCollection
 
class  IServiceProvider
 
class  ServiceCollection
 
class  ServiceDescriptor
 
class  ServiceProvider
 

Typedefs

typedef std::function< std::any(IServiceProvider &)> ServiceFactory
 

Enumerations

enum class  ServiceLifetime : std::uint8_t { Singleton = 0 , Transient = 2 }
 The lifetime of a service. More...
 

Detailed Description

MIT License

Copyright (c) 2023 Rikarnto Bariampa

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Typedef Documentation

◆ ServiceFactory

typedef std::function<std::any(IServiceProvider&)> DependencyInjection::ServiceFactory

Enumeration Type Documentation

◆ ServiceLifetime

enum class DependencyInjection::ServiceLifetime : std::uint8_t
strong

The lifetime of a service.

This enum determines how often a service is created within the application. Singleton services are created once and reused, while Transient services are created each time they are requested.

Version
1.0
Enumerator
Singleton 

The service is created once and reused.

Transient 

The service is created each time it is requested.

58 {
59 Singleton = 0, /*!< The service is created once and reused. */
60 // Scoped = 1, /*!< The service is created once per scope. */
61 Transient = 2, /*!< The service is created each time it is requested. */
62 };