|
Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
|
Lightweight service registry for dependency lookup. More...
#include <service_registry.h>

Static Public Member Functions | |
| template<typename Interface > | |
| static auto | register_service (std::shared_ptr< Interface > service) -> void |
| Register a service implementation for the given interface type. | |
| template<typename Interface > | |
| static auto | get_service () -> std::shared_ptr< Interface > |
| static auto | clear_services () -> void |
| Remove all registered services. | |
| static auto | get_service_count () -> std::size_t |
| Get the number of registered services. | |
Static Private Attributes | |
| static std::unordered_map< std::type_index, std::any > | services_ {} |
| static std::shared_mutex | mutex_ {} |
Lightweight service registry for dependency lookup.
Definition at line 29 of file service_registry.h.
|
inlinestatic |
Remove all registered services.
Definition at line 90 of file service_registry.h.
|
inlinestatic |
Definition at line 70 of file service_registry.h.
References mutex_, and services_.
Referenced by main().

|
inlinestatic |
Get the number of registered services.
Definition at line 102 of file service_registry.h.
|
inlinestatic |
Register a service implementation for the given interface type.
| Interface | Service interface type |
| service | Shared pointer to service implementation |
Definition at line 45 of file service_registry.h.
References mutex_, and services_.
Referenced by main().

|
inlinestaticprivate |
Definition at line 32 of file service_registry.h.
Referenced by clear_services(), get_service(), get_service_count(), and register_service().
|
inlinestaticprivate |
Definition at line 31 of file service_registry.h.
Referenced by clear_services(), get_service(), get_service_count(), and register_service().