Removed EventRef alias for clarity
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
#include "src/Targets/TargetState.hpp"
|
||||
|
||||
using namespace Bloom;
|
||||
using namespace Bloom::Events;
|
||||
using namespace Bloom::Exceptions;
|
||||
|
||||
void Insight::run() {
|
||||
@@ -38,11 +37,11 @@ void Insight::startup() {
|
||||
this->setThreadState(ThreadState::STARTING);
|
||||
this->eventManager.registerListener(this->eventListener);
|
||||
|
||||
this->eventListener->registerCallbackForEventType<ShutdownApplication>(
|
||||
this->eventListener->registerCallbackForEventType<Events::ShutdownApplication>(
|
||||
std::bind(&Insight::onShutdownApplicationEvent, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
this->eventListener->registerCallbackForEventType<TargetControllerThreadStateChanged>(
|
||||
this->eventListener->registerCallbackForEventType<Events::TargetControllerThreadStateChanged>(
|
||||
std::bind(&Insight::onTargetControllerThreadStateChangedEvent, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
@@ -119,7 +118,7 @@ void Insight::shutdown() {
|
||||
this->setThreadState(ThreadState::STOPPED);
|
||||
}
|
||||
|
||||
void Insight::onShutdownApplicationEvent(EventRef<ShutdownApplication>) {
|
||||
void Insight::onShutdownApplicationEvent(const Events::ShutdownApplication&) {
|
||||
/*
|
||||
* Once Insight shuts down, control of the main thread will be returned to Application::run(), which
|
||||
* will pickup the ShutdownApplication event and proceed with the shutdown.
|
||||
@@ -127,7 +126,7 @@ void Insight::onShutdownApplicationEvent(EventRef<ShutdownApplication>) {
|
||||
this->shutdown();
|
||||
}
|
||||
|
||||
void Insight::onTargetControllerThreadStateChangedEvent(EventRef<TargetControllerThreadStateChanged> event) {
|
||||
void Insight::onTargetControllerThreadStateChangedEvent(const Events::TargetControllerThreadStateChanged& event) {
|
||||
if (event.getState() == ThreadState::STOPPED) {
|
||||
// Something horrible has happened with the TargetController - Insight is useless without the TargetController
|
||||
this->shutdown();
|
||||
|
||||
@@ -81,16 +81,14 @@ namespace Bloom
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
void onShutdownApplicationEvent(Events::EventRef<Events::ShutdownApplication> event);
|
||||
void onShutdownApplicationEvent(const Events::ShutdownApplication& event);
|
||||
|
||||
/**
|
||||
* If the something horrible was to happen and the TC dies unexpectedly, Insight will shutdown in response.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
void onTargetControllerThreadStateChangedEvent(
|
||||
Events::EventRef<Events::TargetControllerThreadStateChanged> event
|
||||
);
|
||||
void onTargetControllerThreadStateChangedEvent(const Events::TargetControllerThreadStateChanged& event);
|
||||
|
||||
/**
|
||||
* Dispatches any events currently in the queue.
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "src/Exceptions/InvalidConfig.hpp"
|
||||
|
||||
using namespace Bloom;
|
||||
using namespace Bloom::Events;
|
||||
using namespace Bloom::Exceptions;
|
||||
|
||||
using Bloom::Targets::TargetState;
|
||||
@@ -19,23 +18,23 @@ void InsightWorker::startup() {
|
||||
Logger::debug("Starting InsightWorker thread");
|
||||
this->eventManager.registerListener(this->eventListener);
|
||||
|
||||
this->eventListener->registerCallbackForEventType<TargetControllerStateReported>(
|
||||
this->eventListener->registerCallbackForEventType<Events::TargetControllerStateReported>(
|
||||
std::bind(&InsightWorker::onTargetControllerStateReported, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
this->eventListener->registerCallbackForEventType<TargetExecutionStopped>(
|
||||
this->eventListener->registerCallbackForEventType<Events::TargetExecutionStopped>(
|
||||
std::bind(&InsightWorker::onTargetStoppedEvent, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
this->eventListener->registerCallbackForEventType<TargetExecutionResumed>(
|
||||
this->eventListener->registerCallbackForEventType<Events::TargetExecutionResumed>(
|
||||
std::bind(&InsightWorker::onTargetResumedEvent, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
this->eventListener->registerCallbackForEventType<TargetPinStatesRetrieved>(
|
||||
this->eventListener->registerCallbackForEventType<Events::TargetPinStatesRetrieved>(
|
||||
std::bind(&InsightWorker::onTargetPinStatesRetrievedEvent, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
this->eventListener->registerCallbackForEventType<TargetIoPortsUpdated>(
|
||||
this->eventListener->registerCallbackForEventType<Events::TargetIoPortsUpdated>(
|
||||
std::bind(&InsightWorker::onTargetIoPortsUpdatedEvent, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
@@ -60,7 +59,7 @@ void InsightWorker::requestPinStateUpdate(
|
||||
this->targetControllerConsole.setPinState(variantId, pinDescriptor, pinState);
|
||||
}
|
||||
|
||||
void InsightWorker::onTargetStoppedEvent(EventRef<TargetExecutionStopped> event) {
|
||||
void InsightWorker::onTargetStoppedEvent(const Events::TargetExecutionStopped& event) {
|
||||
/*
|
||||
* When we report a target halt to Insight, Insight will immediately seek more data from the target (such as GPIO
|
||||
* pin states). This can be problematic for cases where the target had halted due to a conditional breakpoint.
|
||||
@@ -82,7 +81,7 @@ void InsightWorker::onTargetStoppedEvent(EventRef<TargetExecutionStopped> event)
|
||||
* only way. It would be nice if the debug client gave us some form of indication of whether the breakpoint is a
|
||||
* conditional one.
|
||||
*/
|
||||
auto resumedEvent = this->eventListener->waitForEvent<TargetExecutionResumed>(
|
||||
auto resumedEvent = this->eventListener->waitForEvent<Events::TargetExecutionResumed>(
|
||||
std::chrono::milliseconds(650)
|
||||
);
|
||||
|
||||
@@ -92,19 +91,19 @@ void InsightWorker::onTargetStoppedEvent(EventRef<TargetExecutionStopped> event)
|
||||
}
|
||||
}
|
||||
|
||||
void InsightWorker::onTargetResumedEvent(EventRef<TargetExecutionResumed> event) {
|
||||
void InsightWorker::onTargetResumedEvent(const Events::TargetExecutionResumed& event) {
|
||||
emit this->targetStateUpdated(TargetState::RUNNING);
|
||||
}
|
||||
|
||||
void InsightWorker::onTargetPinStatesRetrievedEvent(EventRef<TargetPinStatesRetrieved> event) {
|
||||
void InsightWorker::onTargetPinStatesRetrievedEvent(const Events::TargetPinStatesRetrieved& event) {
|
||||
emit this->targetPinStatesUpdated(event.variantId, event.pinSatesByNumber);
|
||||
}
|
||||
|
||||
void InsightWorker::onTargetIoPortsUpdatedEvent(EventRef<TargetIoPortsUpdated> event) {
|
||||
void InsightWorker::onTargetIoPortsUpdatedEvent(const Events::TargetIoPortsUpdated& event) {
|
||||
emit this->targetIoPortsUpdated();
|
||||
}
|
||||
|
||||
void InsightWorker::onTargetControllerStateReported(EventRef<TargetControllerStateReported> event) {
|
||||
void InsightWorker::onTargetControllerStateReported(const Events::TargetControllerStateReported& event) {
|
||||
if (this->lastTargetControllerState == TargetControllerState::ACTIVE
|
||||
&& event.state == TargetControllerState::SUSPENDED
|
||||
) {
|
||||
|
||||
@@ -33,11 +33,11 @@ namespace Bloom
|
||||
|
||||
QTimer* eventDispatchTimer = nullptr;
|
||||
|
||||
void onTargetStoppedEvent(Events::EventRef<Events::TargetExecutionStopped> event);
|
||||
void onTargetResumedEvent(Events::EventRef<Events::TargetExecutionResumed> event);
|
||||
void onTargetPinStatesRetrievedEvent(Events::EventRef<Events::TargetPinStatesRetrieved> event);
|
||||
void onTargetIoPortsUpdatedEvent(Events::EventRef<Events::TargetIoPortsUpdated> event);
|
||||
void onTargetControllerStateReported(Events::EventRef<Events::TargetControllerStateReported> event);
|
||||
void onTargetStoppedEvent(const Events::TargetExecutionStopped& event);
|
||||
void onTargetResumedEvent(const Events::TargetExecutionResumed& event);
|
||||
void onTargetPinStatesRetrievedEvent(const Events::TargetPinStatesRetrieved& event);
|
||||
void onTargetIoPortsUpdatedEvent(const Events::TargetIoPortsUpdated& event);
|
||||
void onTargetControllerStateReported(const Events::TargetControllerStateReported& event);
|
||||
|
||||
public:
|
||||
explicit InsightWorker(EventManager& eventManager): eventManager(eventManager) {};
|
||||
|
||||
Reference in New Issue
Block a user