2#ifndef _CONSOLIX_MODULE_HUB_COMPONENT_HPP_INCLUDED
3#define _CONSOLIX_MODULE_HUB_COMPONENT_HPP_INCLUDED
9#if CONSOLIX_USE_EVENT_HUB == 1
13#include <event_hub.hpp>
23 class ModuleHubComponent :
25 public IShutdownable {
28 ModuleHubComponent() =
default;
32 explicit ModuleHubComponent(event_hub::ModuleHub* module_hub) :
33 m_module_hub(module_hub) {
38 void set_module_hub(event_hub::ModuleHub* module_hub) {
39 m_module_hub = module_hub;
44 std::size_t last_work_count()
const {
45 return m_last_work_count;
49 bool initialize()
override {
51 m_module_hub->initialize();
57 bool is_initialized()
const override {
61 void process()
override {
63 m_last_work_count = 0;
67 m_last_work_count = m_module_hub->process();
70 void shutdown(
int )
override {
72 m_module_hub->request_stop();
73 m_module_hub->shutdown();
78 event_hub::ModuleHub* m_module_hub{
nullptr};
79 std::size_t m_last_work_count{0};
80 bool m_is_init{
false};
< Utility modules and helpers.