DI Container builder.
More...
#include <ContainerBuilder.hpp>
◆ Factory
Factory function that accepts a reference to a DI container and returns a pointer to an instance of a service.
- Template Parameters
-
◆ Key
Key, used to map classes, registered in a ContainerBuilder to the ones specified in a config file.
◆ BuildContainer()
Builds a DI container.
- Parameters
-
[in] | configuration | the DI configuration |
- Returns
- built DI container
- Warning
- Containers, built from the same ContainerBuilder will share the same services. For example, they will share the same instances of the services with
ServiceLifetime::Singleton
lifetime.
◆ RegisterInterface()
template<class T >
void sol::di::ContainerBuilder::RegisterInterface |
( |
Key |
key | ) |
|
|
inline |
Registers an interface.
- Template Parameters
-
- Parameters
-
◆ RegisterService()
template<class TService , class... TServiceParents>
void sol::di::ContainerBuilder::RegisterService |
( |
Key |
key, |
|
|
Factory< TService > |
factory |
|
) |
| |
|
inline |
Registers a service.
- Template Parameters
-
TService | the service type |
...TServiceParents | the service parent types |
- Parameters
-
key | the service key |
factory | the service factory |
- See also
- FACTORY
The documentation for this class was generated from the following file: