Consistency in application event handler naming

This commit is contained in:
Nav
2021-04-25 16:03:07 +01:00
parent fa2a3f67db
commit 9d2b5b2f0a
2 changed files with 6 additions and 6 deletions

View File

@@ -73,7 +73,7 @@ void Application::startup() {
auto applicationEventListener = this->applicationEventListener; auto applicationEventListener = this->applicationEventListener;
this->eventManager.registerListener(applicationEventListener); this->eventManager.registerListener(applicationEventListener);
applicationEventListener->registerCallbackForEventType<Events::ShutdownApplication>( applicationEventListener->registerCallbackForEventType<Events::ShutdownApplication>(
std::bind(&Application::handleShutdownApplicationEvent, this, std::placeholders::_1) std::bind(&Application::onShutdownApplicationRequest, this, std::placeholders::_1)
); );
this->applicationConfig = this->extractConfig(); this->applicationConfig = this->extractConfig();
@@ -107,7 +107,7 @@ void Application::startup() {
} }
applicationEventListener->registerCallbackForEventType<Events::TargetControllerStateChanged>( applicationEventListener->registerCallbackForEventType<Events::TargetControllerStateChanged>(
std::bind(&Application::handleTargetControllerStateChangedEvent, this, std::placeholders::_1) std::bind(&Application::onTargetControllerStateChanged, this, std::placeholders::_1)
); );
applicationEventListener->registerCallbackForEventType<Events::DebugServerStateChanged>( applicationEventListener->registerCallbackForEventType<Events::DebugServerStateChanged>(
@@ -316,14 +316,14 @@ void Application::stopDebugServer() {
} }
} }
void Application::handleTargetControllerStateChangedEvent(EventPointer<Events::TargetControllerStateChanged> event) { void Application::onTargetControllerStateChanged(EventPointer<Events::TargetControllerStateChanged> event) {
if (event->getState() == ThreadState::STOPPED || event->getState() == ThreadState::SHUTDOWN_INITIATED) { if (event->getState() == ThreadState::STOPPED || event->getState() == ThreadState::SHUTDOWN_INITIATED) {
// TargetController has unexpectedly shutdown - it must have encountered a fatal error. // TargetController has unexpectedly shutdown - it must have encountered a fatal error.
this->shutdown(); this->shutdown();
} }
} }
void Application::handleShutdownApplicationEvent(EventPointer<Events::ShutdownApplication>) { void Application::onShutdownApplicationRequest(EventPointer<Events::ShutdownApplication>) {
Logger::debug("ShutdownApplication event received."); Logger::debug("ShutdownApplication event received.");
this->shutdown(); this->shutdown();
} }

View File

@@ -228,7 +228,7 @@ namespace Bloom
* *
* @param event * @param event
*/ */
void handleTargetControllerStateChangedEvent(EventPointer<Events::TargetControllerStateChanged> event); void onTargetControllerStateChanged(EventPointer<Events::TargetControllerStateChanged> event);
/** /**
* Same goes for the DebugServer - it should never shutdown unless a shutdown request was issued. If it does, * Same goes for the DebugServer - it should never shutdown unless a shutdown request was issued. If it does,
@@ -241,7 +241,7 @@ namespace Bloom
/** /**
* Triggers a shutdown of Bloom and all of its components. * Triggers a shutdown of Bloom and all of its components.
*/ */
void handleShutdownApplicationEvent(EventPointer<Events::ShutdownApplication>); void onShutdownApplicationRequest(EventPointer<Events::ShutdownApplication>);
/** /**
* Returns the path to the directory in which the Bloom binary resides. * Returns the path to the directory in which the Bloom binary resides.