Moved away from shared pointers in event handlers - didn't make sense to expose the event management implementation to handlers.

Also some other bits of tidying.
This commit is contained in:
Nav
2021-06-22 03:06:20 +01:00
parent 139e880646
commit a7df862d36
19 changed files with 193 additions and 212 deletions

View File

@@ -323,20 +323,20 @@ void Application::stopDebugServer() {
}
}
void Application::onTargetControllerThreadStateChanged(EventPointer<Events::TargetControllerThreadStateChanged> event) {
if (event->getState() == ThreadState::STOPPED || event->getState() == ThreadState::SHUTDOWN_INITIATED) {
void Application::onTargetControllerThreadStateChanged(EventRef<Events::TargetControllerThreadStateChanged> event) {
if (event.getState() == ThreadState::STOPPED || event.getState() == ThreadState::SHUTDOWN_INITIATED) {
// TargetController has unexpectedly shutdown - it must have encountered a fatal error.
this->shutdown();
}
}
void Application::onShutdownApplicationRequest(EventPointer<Events::ShutdownApplication>) {
void Application::onShutdownApplicationRequest(EventRef<Events::ShutdownApplication>) {
Logger::debug("ShutdownApplication event received.");
this->shutdown();
}
void Application::onDebugServerThreadStateChanged(EventPointer<Events::DebugServerThreadStateChanged> event) {
if (event->getState() == ThreadState::STOPPED || event->getState() == ThreadState::SHUTDOWN_INITIATED) {
void Application::onDebugServerThreadStateChanged(EventRef<Events::DebugServerThreadStateChanged> event) {
if (event.getState() == ThreadState::STOPPED || event.getState() == ThreadState::SHUTDOWN_INITIATED) {
// DebugServer has unexpectedly shutdown - it must have encountered a fatal error.
this->shutdown();
}