From a2ec09ccea410c4c0b1e227cf3fb49d82a6cf347 Mon Sep 17 00:00:00 2001 From: a <57077778+cryptochassis@users.noreply.github.com> Date: Mon, 31 Aug 2026 10:41:31 -0700 Subject: [PATCH] update include/ccapi_cpp/ccapi_event_dispatcher.h --- include/ccapi_cpp/ccapi_event_dispatcher.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/ccapi_cpp/ccapi_event_dispatcher.h b/include/ccapi_cpp/ccapi_event_dispatcher.h index de4635ff..3c93b1ac 100644 --- a/include/ccapi_cpp/ccapi_event_dispatcher.h +++ b/include/ccapi_cpp/ccapi_event_dispatcher.h @@ -35,7 +35,7 @@ class EventDispatcher { CCAPI_LOGGER_FUNCTION_EXIT; } - void dispatch(const std::function& op) { + virtual void dispatch(const std::function& op) { CCAPI_LOGGER_FUNCTION_ENTER; if (this->shouldContinue.load()) { CCAPI_LOGGER_TRACE("start to dispatch an operation"); @@ -51,18 +51,18 @@ class EventDispatcher { CCAPI_LOGGER_FUNCTION_EXIT; } - void start() { + virtual void start() { this->shouldContinue = true; for (size_t i = 0; i < numDispatcherThreads; i++) { - this->dispatcherThreads.push_back(std::thread(&EventDispatcher::dispatch_thread_handler, this)); + this->dispatcherThreads.push_back(std::thread(&EventDispatcher::dispatchThreadHandler, this)); } } - void resume() { this->shouldContinue = true; } + virtual void resume() { this->shouldContinue = true; } - void pause() { this->shouldContinue = false; } + virtual void pause() { this->shouldContinue = false; } - void stop() { + virtual void stop() { std::unique_lock lock(this->lock); this->quit = true; lock.unlock(); @@ -73,9 +73,9 @@ class EventDispatcher { } #ifndef CCAPI_EXPOSE_INTERNAL - private: + protected: #endif - void dispatch_thread_handler() { + virtual void dispatchThreadHandler() { CCAPI_LOGGER_FUNCTION_ENTER; std::unique_lock lock(this->lock); do {