Non-allocating ServiceRegistry storing service handles in a fixed stack/static array. Zero heap allocations, zero vtables/RTTI.
More...
|
| | BasicServiceRegistry ()=default |
| |
| template<typename ServiceType > |
| ServiceType * | getService () const noexcept |
| | Retrieve a registered service instance by concrete type.
|
| |
| void * | getServiceById (internal::TypeIdPtr typeId) const noexcept |
| | Retrieve a registered service instance by static type ID.
|
| |
| template<typename ServiceType > |
| EventSinkT< EventVariant > | getServiceSink () const noexcept |
| | Retrieve event sink handle of a target registered service if available.
|
| |
| void | initialize (ServiceContextType ctx) |
| | Initialize and launch all registered background service jthreads.
|
| |
| template<typename ServiceType > |
| bool | registerService (ServiceType &serviceInstance) |
| | Register a background service instance by reference.
|
| |
| void | shutdown () noexcept |
| | Stop and join all registered background service threads.
|
| |
| size_t | size () const noexcept |
| | Access number of registered services.
|
| |
template<size_t MaxServices = 8, typename EventVariant = DefaultEvents>
class corium::BasicServiceRegistry< MaxServices, EventVariant >
Non-allocating ServiceRegistry storing service handles in a fixed stack/static array. Zero heap allocations, zero vtables/RTTI.
- Template Parameters
-
| MaxServices | Maximum number of background services allowed per registry (default 8). |
| EventVariant | Supported event variant type list. |