|
Corium 1.1.0
High-Performance Zero-Heap C++20 MPSC Application Runtime
|
Execution context provided to background services. Allows services to post events back to the main event queue thread-safely and communicate with other registered background services. More...
#include <ServiceContext.hpp>
Inheritance diagram for corium::BasicServiceContext< EventVariant >:
Collaboration diagram for corium::BasicServiceContext< EventVariant >:Public Types | |
| using | GetServiceFn = void *(*)(void *registryPtr, internal::TypeIdPtr typeId) |
Public Member Functions | |
| BasicServiceContext ()=default | |
| BasicServiceContext (EventSinkT< EventVariant > sink, void *regPtr=nullptr, GetServiceFn fn=nullptr) noexcept | |
| EventSinkT< EventVariant > | eventSink () const noexcept |
| Access main application EventSink handle. | |
| template<typename ServiceType > | |
| ServiceType * | getService () const noexcept |
| Retrieve another registered service instance by type. | |
| template<typename ServiceType > | |
| EventSinkT< EventVariant > | getServiceSink () const noexcept |
| Retrieve event sink handle of a target registered service if available. | |
| EventSinkT< EventVariant > | mainSink () const noexcept |
| Access main application EventSink handle. | |
| template<typename TargetService , typename EventType > | |
| bool | sendToService (EventType &&event, EventPriority priority=EventPriority::Normal) const |
| Post an event directly to a target service. | |
| void | setRegistry (void *registryPtr, GetServiceFn fn) noexcept |
| Configure registry resolution bridge (internal framework usage). | |
Execution context provided to background services. Allows services to post events back to the main event queue thread-safely and communicate with other registered background services.
| EventVariant | The variant type list of supported events. |
| using corium::BasicServiceContext< EventVariant >::GetServiceFn = void* (*)(void* registryPtr, internal::TypeIdPtr typeId) |
|
default |
|
inlineexplicitnoexcept |
|
inlinenoexcept |
Access main application EventSink handle.
|
inlinenoexcept |
Retrieve another registered service instance by type.
| ServiceType | Type of the target background service. |
|
inlinenoexcept |
Retrieve event sink handle of a target registered service if available.
| ServiceType | Type of the target background service. |
|
inlinenoexcept |
Access main application EventSink handle.
|
inline |
Post an event directly to a target service.
| TargetService | Target service type to send the event to. |
| EventType | Event type to send. |
| event | Event instance to post. |
| priority | Priority level. |
|
inlinenoexcept |
Configure registry resolution bridge (internal framework usage).
Here is the caller graph for this function: