|
| static shared_ptr< ServiceType > | get_service (const char *alias=nullptr) |
| | Get the service that has been registereed for this type.
|
| |
| static void | register_service (shared_ptr< ServiceType > &service, const char *alias=nullptr) |
| | Register a service instance with the service locator.
|
| |
template<typename ServiceType>
class ServiceLocator< ServiceType >
Definition at line 126 of file ServiceLocator.hxx.
◆ get_service()
template<typename ServiceType >
| static shared_ptr< ServiceType > ServiceLocator< ServiceType >::get_service |
( |
const char * |
alias = nullptr | ) |
|
|
inlinestatic |
Get the service that has been registereed for this type.
- Parameters
-
| alias | allows you to retrieve an instance with a specific name |
- Returns
- the service, or nullptr if no such service
Definition at line 134 of file ServiceLocator.hxx.
◆ register_service()
template<typename ServiceType >
| static void ServiceLocator< ServiceType >::register_service |
( |
shared_ptr< ServiceType > & |
service, |
|
|
const char * |
alias = nullptr |
|
) |
| |
|
inlinestatic |
Register a service instance with the service locator.
Because this is just registering the pointer, the creator still owns the lifetime.
- Parameters
-
| service | instance that you want to register |
| alias | allows you to register a mapping with a specific name |
Definition at line 147 of file ServiceLocator.hxx.
The documentation for this class was generated from the following file: