Initial commit
This commit is contained in:
16
src/EventManager/Events/BreakpointRemovedOnTarget.hpp
Normal file
16
src/EventManager/Events/BreakpointRemovedOnTarget.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class BreakpointRemovedOnTarget: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "BreakpointRemovedOnTarget";
|
||||
|
||||
std::string getName() const override {
|
||||
return BreakpointRemovedOnTarget::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
17
src/EventManager/Events/BreakpointSetOnTarget.hpp
Normal file
17
src/EventManager/Events/BreakpointSetOnTarget.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <set>
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class BreakpointSetOnTarget: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "BreakpointSetOnTarget";
|
||||
|
||||
std::string getName() const override {
|
||||
return BreakpointSetOnTarget::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
25
src/EventManager/Events/DebugServerStateChanged.hpp
Normal file
25
src/EventManager/Events/DebugServerStateChanged.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include <src/Helpers/Thread.hpp>
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class DebugServerStateChanged: public Event
|
||||
{
|
||||
private:
|
||||
ThreadState state;
|
||||
public:
|
||||
DebugServerStateChanged(ThreadState state) : state(state) {};
|
||||
|
||||
static inline const std::string name = "DebugServerStateChanged";
|
||||
|
||||
std::string getName() const override {
|
||||
return DebugServerStateChanged::name;
|
||||
}
|
||||
|
||||
ThreadState getState() const {
|
||||
return this->state;
|
||||
}
|
||||
};
|
||||
}
|
||||
16
src/EventManager/Events/DebugSessionFinished.hpp
Normal file
16
src/EventManager/Events/DebugSessionFinished.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class DebugSessionFinished: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "DebugSessionFinished";
|
||||
|
||||
std::string getName() const override {
|
||||
return DebugSessionFinished::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
16
src/EventManager/Events/DebugSessionStarted.hpp
Normal file
16
src/EventManager/Events/DebugSessionStarted.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class DebugSessionStarted: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "DebugSessionStarted";
|
||||
|
||||
std::string getName() const override {
|
||||
return DebugSessionStarted::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
34
src/EventManager/Events/Event.hpp
Normal file
34
src/EventManager/Events/Event.hpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <atomic>
|
||||
#include <optional>
|
||||
|
||||
#include "src/Helpers/DateTime.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
static_assert(std::atomic<int>::is_always_lock_free);
|
||||
|
||||
class Event
|
||||
{
|
||||
private:
|
||||
QDateTime createdTimestamp = DateTime::currentDateTime();
|
||||
static inline std::atomic<int> lastEventId = 0;
|
||||
|
||||
public:
|
||||
int id = ++(this->lastEventId);
|
||||
std::optional<int> correlationId;
|
||||
|
||||
static inline const std::string name = "GenericEvent";
|
||||
|
||||
virtual std::string getName() const {
|
||||
return Event::name;
|
||||
}
|
||||
|
||||
long getCreatedEpochTimestamp() const {
|
||||
return this->createdTimestamp.toMSecsSinceEpoch();
|
||||
}
|
||||
};
|
||||
}
|
||||
49
src/EventManager/Events/Events.hpp
Normal file
49
src/EventManager/Events/Events.hpp
Normal file
@@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Event.hpp"
|
||||
#include "StopTargetExecution.hpp"
|
||||
#include "ResumeTargetExecution.hpp"
|
||||
#include "ResetTarget.hpp"
|
||||
#include "DebugSessionStarted.hpp"
|
||||
#include "DebugSessionFinished.hpp"
|
||||
#include "TargetControllerStateChanged.hpp"
|
||||
#include "TargetControllerStopped.hpp"
|
||||
#include "ShutdownTargetController.hpp"
|
||||
#include "TargetControllerErrorOccurred.hpp"
|
||||
#include "ShutdownApplication.hpp"
|
||||
#include "DebugServerStateChanged.hpp"
|
||||
#include "ShutdownDebugServer.hpp"
|
||||
#include "RetrieveRegistersFromTarget.hpp"
|
||||
#include "RegistersRetrievedFromTarget.hpp"
|
||||
#include "WriteRegistersToTarget.hpp"
|
||||
#include "RegistersWrittenToTarget.hpp"
|
||||
#include "TargetExecutionResumed.hpp"
|
||||
#include "TargetExecutionStopped.hpp"
|
||||
#include "RetrieveMemoryFromTarget.hpp"
|
||||
#include "MemoryRetrievedFromTarget.hpp"
|
||||
#include "WriteMemoryToTarget.hpp"
|
||||
#include "MemoryWrittenToTarget.hpp"
|
||||
#include "SetBreakpointOnTarget.hpp"
|
||||
#include "RemoveBreakpointOnTarget.hpp"
|
||||
#include "BreakpointSetOnTarget.hpp"
|
||||
#include "BreakpointRemovedOnTarget.hpp"
|
||||
#include "StepTargetExecution.hpp"
|
||||
#include "SetProgramCounterOnTarget.hpp"
|
||||
#include "ProgramCounterSetOnTarget.hpp"
|
||||
#include "ExtractTargetDescriptor.hpp"
|
||||
#include "TargetDescriptorExtracted.hpp"
|
||||
#include "InsightStateChanged.hpp"
|
||||
#include "RetrieveTargetPinStates.hpp"
|
||||
#include "TargetPinStatesRetrieved.hpp"
|
||||
#include "SetTargetPinState.hpp"
|
||||
#include "TargetIoPortsUpdated.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
template <class EventType>
|
||||
using EventPointer = std::shared_ptr<const EventType>;
|
||||
|
||||
using GenericEventPointer = EventPointer<Event>;
|
||||
}
|
||||
18
src/EventManager/Events/ExtractTargetDescriptor.hpp
Normal file
18
src/EventManager/Events/ExtractTargetDescriptor.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class ExtractTargetDescriptor: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "ExtractTargetDescriptor";
|
||||
|
||||
std::string getName() const override {
|
||||
return ExtractTargetDescriptor::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
27
src/EventManager/Events/InsightStateChanged.hpp
Normal file
27
src/EventManager/Events/InsightStateChanged.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include "Event.hpp"
|
||||
#include "src/Helpers/Thread.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class InsightStateChanged: public Event
|
||||
{
|
||||
private:
|
||||
ThreadState state;
|
||||
public:
|
||||
InsightStateChanged(ThreadState state) : state(state) {
|
||||
|
||||
};
|
||||
|
||||
static inline const std::string name = "InsightStateChanged";
|
||||
|
||||
std::string getName() const override {
|
||||
return InsightStateChanged::name;
|
||||
}
|
||||
|
||||
ThreadState getState() const {
|
||||
return this->state;
|
||||
}
|
||||
};
|
||||
}
|
||||
21
src/EventManager/Events/MemoryRetrievedFromTarget.hpp
Normal file
21
src/EventManager/Events/MemoryRetrievedFromTarget.hpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "Event.hpp"
|
||||
#include "src/Targets/TargetMemory.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
using Targets::TargetMemoryBuffer;
|
||||
class MemoryRetrievedFromTarget: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "MemoryRetrievedFromTarget";
|
||||
TargetMemoryBuffer data;
|
||||
|
||||
std::string getName() const override {
|
||||
return MemoryRetrievedFromTarget::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
21
src/EventManager/Events/MemoryWrittenToTarget.hpp
Normal file
21
src/EventManager/Events/MemoryWrittenToTarget.hpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include "Event.hpp"
|
||||
#include "src/Targets/TargetMemory.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
using Bloom::Targets::TargetMemoryBuffer;
|
||||
|
||||
class MemoryWrittenToTarget: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "MemoryWrittenToTarget";
|
||||
|
||||
std::string getName() const override {
|
||||
return MemoryWrittenToTarget::name;
|
||||
}
|
||||
|
||||
MemoryWrittenToTarget() = default;
|
||||
};
|
||||
}
|
||||
16
src/EventManager/Events/ProgramCounterSetOnTarget.hpp
Normal file
16
src/EventManager/Events/ProgramCounterSetOnTarget.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class ProgramCounterSetOnTarget: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "ProgramCounterSetOnTarget";
|
||||
|
||||
std::string getName() const override {
|
||||
return ProgramCounterSetOnTarget::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
22
src/EventManager/Events/RegistersRetrievedFromTarget.hpp
Normal file
22
src/EventManager/Events/RegistersRetrievedFromTarget.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "Event.hpp"
|
||||
#include "src/Targets/TargetRegister.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
using Targets::TargetRegisters;
|
||||
|
||||
class RegistersRetrievedFromTarget: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "RegistersRetrievedFromTarget";
|
||||
TargetRegisters registers;
|
||||
|
||||
std::string getName() const override {
|
||||
return RegistersRetrievedFromTarget::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
18
src/EventManager/Events/RegistersWrittenToTarget.hpp
Normal file
18
src/EventManager/Events/RegistersWrittenToTarget.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <set>
|
||||
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class RegistersWrittenToTarget: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "RegistersWrittenToTarget";
|
||||
|
||||
std::string getName() const override {
|
||||
return RegistersWrittenToTarget::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
23
src/EventManager/Events/RemoveBreakpointOnTarget.hpp
Normal file
23
src/EventManager/Events/RemoveBreakpointOnTarget.hpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "Event.hpp"
|
||||
#include "src/Targets/TargetBreakpoint.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
using Targets::TargetBreakpoint;
|
||||
|
||||
class RemoveBreakpointOnTarget: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "RemoveBreakpointOnTarget";
|
||||
std::uint32_t address;
|
||||
TargetBreakpoint breakpoint;
|
||||
|
||||
std::string getName() const override {
|
||||
return RemoveBreakpointOnTarget::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
16
src/EventManager/Events/ResetTarget.hpp
Normal file
16
src/EventManager/Events/ResetTarget.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class ResetTarget: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "ResetTargetEvent";
|
||||
|
||||
std::string getName() const override {
|
||||
return ResetTarget::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
22
src/EventManager/Events/ResumeTargetExecution.hpp
Normal file
22
src/EventManager/Events/ResumeTargetExecution.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class ResumeTargetExecution: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "ResumeTargetExecutionEvent";
|
||||
std::optional<std::uint32_t> fromProgramCounter;
|
||||
|
||||
std::string getName() const override {
|
||||
return ResumeTargetExecution::name;
|
||||
}
|
||||
|
||||
ResumeTargetExecution() = default;
|
||||
ResumeTargetExecution(std::uint32_t fromProgramCounter) : fromProgramCounter(fromProgramCounter) {};
|
||||
};
|
||||
}
|
||||
24
src/EventManager/Events/RetrieveMemoryFromTarget.hpp
Normal file
24
src/EventManager/Events/RetrieveMemoryFromTarget.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "Event.hpp"
|
||||
#include "src/Targets/TargetMemory.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
using Targets::TargetMemoryType;
|
||||
|
||||
class RetrieveMemoryFromTarget: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "RetrieveMemoryFromTarget";
|
||||
TargetMemoryType memoryType = TargetMemoryType::RAM;
|
||||
std::uint32_t startAddress;
|
||||
std::uint32_t bytes;
|
||||
|
||||
std::string getName() const override {
|
||||
return RetrieveMemoryFromTarget::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
22
src/EventManager/Events/RetrieveRegistersFromTarget.hpp
Normal file
22
src/EventManager/Events/RetrieveRegistersFromTarget.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <set>
|
||||
|
||||
#include "Event.hpp"
|
||||
#include "src/Targets/TargetRegister.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
using Bloom::Targets::TargetRegisterDescriptors;
|
||||
|
||||
class RetrieveRegistersFromTarget: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "RetrieveRegistersFromTarget";
|
||||
TargetRegisterDescriptors descriptors;
|
||||
|
||||
std::string getName() const override {
|
||||
return RetrieveRegistersFromTarget::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
19
src/EventManager/Events/RetrieveTargetPinStates.hpp
Normal file
19
src/EventManager/Events/RetrieveTargetPinStates.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class RetrieveTargetPinStates: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "RetrieveTargetPinStates";
|
||||
int variantId;
|
||||
|
||||
std::string getName() const override {
|
||||
return RetrieveTargetPinStates::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
23
src/EventManager/Events/SetBreakpointOnTarget.hpp
Normal file
23
src/EventManager/Events/SetBreakpointOnTarget.hpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "Event.hpp"
|
||||
#include "src/Targets/TargetBreakpoint.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
using Targets::TargetBreakpoint;
|
||||
|
||||
class SetBreakpointOnTarget: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "SetBreakpointOnTarget";
|
||||
std::uint32_t address;
|
||||
TargetBreakpoint breakpoint;
|
||||
|
||||
std::string getName() const override {
|
||||
return SetBreakpointOnTarget::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
17
src/EventManager/Events/SetProgramCounterOnTarget.hpp
Normal file
17
src/EventManager/Events/SetProgramCounterOnTarget.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class SetProgramCounterOnTarget: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "SetProgramCounterOnTarget";
|
||||
std::uint32_t address;
|
||||
|
||||
std::string getName() const override {
|
||||
return SetProgramCounterOnTarget::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
22
src/EventManager/Events/SetTargetPinState.hpp
Normal file
22
src/EventManager/Events/SetTargetPinState.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "Event.hpp"
|
||||
#include "src/Targets/TargetPinDescriptor.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class SetTargetPinState: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "SetTargetPinState";
|
||||
int variantId;
|
||||
Targets::TargetPinDescriptor pinDescriptor;
|
||||
Targets::TargetPinState pinState;
|
||||
|
||||
std::string getName() const override {
|
||||
return SetTargetPinState::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
16
src/EventManager/Events/ShutdownApplication.hpp
Normal file
16
src/EventManager/Events/ShutdownApplication.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class ShutdownApplication: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "ShutdownApplicationEvent";
|
||||
|
||||
std::string getName() const override {
|
||||
return ShutdownApplication::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
16
src/EventManager/Events/ShutdownDebugServer.hpp
Normal file
16
src/EventManager/Events/ShutdownDebugServer.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class ShutdownDebugServer: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "ShutdownDebugServer";
|
||||
|
||||
std::string getName() const override {
|
||||
return ShutdownDebugServer::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
16
src/EventManager/Events/ShutdownTargetController.hpp
Normal file
16
src/EventManager/Events/ShutdownTargetController.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class ShutdownTargetController: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "ShutdownTargetControllerEvent";
|
||||
|
||||
std::string getName() const override {
|
||||
return ShutdownTargetController::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
22
src/EventManager/Events/StepTargetExecution.hpp
Normal file
22
src/EventManager/Events/StepTargetExecution.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class StepTargetExecution: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "StepTargetExecution";
|
||||
std::optional<std::uint32_t> fromProgramCounter;
|
||||
|
||||
std::string getName() const override {
|
||||
return StepTargetExecution::name;
|
||||
}
|
||||
|
||||
StepTargetExecution() = default;
|
||||
StepTargetExecution(std::uint32_t fromProgramCounter) : fromProgramCounter(fromProgramCounter) {};
|
||||
};
|
||||
}
|
||||
16
src/EventManager/Events/StopTargetExecution.hpp
Normal file
16
src/EventManager/Events/StopTargetExecution.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class StopTargetExecution: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "StopTargetEvent";
|
||||
|
||||
std::string getName() const override {
|
||||
return StopTargetExecution::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
18
src/EventManager/Events/TargetControllerErrorOccurred.hpp
Normal file
18
src/EventManager/Events/TargetControllerErrorOccurred.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class TargetControllerErrorOccurred: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "TargetControllerErrorOccurred";
|
||||
|
||||
TargetControllerErrorOccurred() = default;
|
||||
|
||||
std::string getName() const override {
|
||||
return TargetControllerErrorOccurred::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
28
src/EventManager/Events/TargetControllerStateChanged.hpp
Normal file
28
src/EventManager/Events/TargetControllerStateChanged.hpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include "Event.hpp"
|
||||
#include "src/Helpers/Thread.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
|
||||
class TargetControllerStateChanged: public Event
|
||||
{
|
||||
private:
|
||||
ThreadState state;
|
||||
public:
|
||||
TargetControllerStateChanged(ThreadState state) : state(state) {
|
||||
|
||||
};
|
||||
|
||||
static inline const std::string name = "TargetControllerStateChanged";
|
||||
|
||||
std::string getName() const override {
|
||||
return TargetControllerStateChanged::name;
|
||||
}
|
||||
|
||||
ThreadState getState() const {
|
||||
return this->state;
|
||||
}
|
||||
};
|
||||
}
|
||||
21
src/EventManager/Events/TargetControllerStopped.hpp
Normal file
21
src/EventManager/Events/TargetControllerStopped.hpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <src/Exceptions/Exception.hpp>
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class TargetControllerStopped: public Event
|
||||
{
|
||||
private:
|
||||
bool stoppedAbruptly = false;
|
||||
std::optional<Exceptions::Exception> caughtException;
|
||||
|
||||
public:
|
||||
static inline const std::string name = "TargetControllerStoppedEvent";
|
||||
|
||||
std::string getName() const override {
|
||||
return TargetControllerStopped::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
20
src/EventManager/Events/TargetDescriptorExtracted.hpp
Normal file
20
src/EventManager/Events/TargetDescriptorExtracted.hpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "Event.hpp"
|
||||
#include "src/Targets/TargetDescriptor.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class TargetDescriptorExtracted: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "TargetDescriptorExtracted";
|
||||
Targets::TargetDescriptor targetDescriptor;
|
||||
|
||||
std::string getName() const override {
|
||||
return TargetDescriptorExtracted::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
18
src/EventManager/Events/TargetExecutionResumed.hpp
Normal file
18
src/EventManager/Events/TargetExecutionResumed.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class TargetExecutionResumed: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "TargetExecutionResumed";
|
||||
|
||||
TargetExecutionResumed() = default;
|
||||
|
||||
std::string getName() const override {
|
||||
return TargetExecutionResumed::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
26
src/EventManager/Events/TargetExecutionStopped.hpp
Normal file
26
src/EventManager/Events/TargetExecutionStopped.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "Event.hpp"
|
||||
#include "src/Targets/Target.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
using Targets::TargetBreakCause;
|
||||
|
||||
class TargetExecutionStopped: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "TargetExecutionStopped";
|
||||
std::uint32_t programCounter;
|
||||
TargetBreakCause breakCause;
|
||||
|
||||
TargetExecutionStopped(std::uint32_t programCounter, TargetBreakCause breakCause) :
|
||||
programCounter(programCounter), breakCause(breakCause) {}
|
||||
|
||||
std::string getName() const override {
|
||||
return TargetExecutionStopped::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
18
src/EventManager/Events/TargetIoPortsUpdated.hpp
Normal file
18
src/EventManager/Events/TargetIoPortsUpdated.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "Event.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class TargetIoPortsUpdated: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "TargetIoPortsUpdated";
|
||||
|
||||
std::string getName() const override {
|
||||
return TargetIoPortsUpdated::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
22
src/EventManager/Events/TargetPinStatesRetrieved.hpp
Normal file
22
src/EventManager/Events/TargetPinStatesRetrieved.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <map>
|
||||
|
||||
#include "Event.hpp"
|
||||
#include "src/Targets/TargetPinDescriptor.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
class TargetPinStatesRetrieved: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "TargetPinStatesRetrieved";
|
||||
int variantId;
|
||||
std::map<int, Targets::TargetPinState> pinSatesByNumber;
|
||||
|
||||
std::string getName() const override {
|
||||
return TargetPinStatesRetrieved::name;
|
||||
}
|
||||
};
|
||||
}
|
||||
28
src/EventManager/Events/WriteMemoryToTarget.hpp
Normal file
28
src/EventManager/Events/WriteMemoryToTarget.hpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "Event.hpp"
|
||||
#include "src/Targets/TargetMemory.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
using Bloom::Targets::TargetMemoryBuffer;
|
||||
|
||||
class WriteMemoryToTarget: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "WriteMemoryToTarget";
|
||||
TargetMemoryType memoryType;
|
||||
std::uint32_t startAddress;
|
||||
TargetMemoryBuffer buffer;
|
||||
|
||||
std::string getName() const override {
|
||||
return WriteMemoryToTarget::name;
|
||||
}
|
||||
|
||||
WriteMemoryToTarget() = default;
|
||||
WriteMemoryToTarget(TargetMemoryType memoryType, std::uint32_t startAddress, const TargetMemoryBuffer& buffer)
|
||||
: memoryType(memoryType), startAddress(startAddress), buffer(buffer) {};
|
||||
};
|
||||
}
|
||||
25
src/EventManager/Events/WriteRegistersToTarget.hpp
Normal file
25
src/EventManager/Events/WriteRegistersToTarget.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include <set>
|
||||
|
||||
#include "Event.hpp"
|
||||
#include "src/Targets/TargetRegister.hpp"
|
||||
|
||||
namespace Bloom::Events
|
||||
{
|
||||
using Bloom::Targets::TargetRegister;
|
||||
|
||||
class WriteRegistersToTarget: public Event
|
||||
{
|
||||
public:
|
||||
static inline const std::string name = "WriteRegistersToTarget";
|
||||
TargetRegisters registers;
|
||||
|
||||
std::string getName() const override {
|
||||
return WriteRegistersToTarget::name;
|
||||
}
|
||||
|
||||
WriteRegistersToTarget() = default;
|
||||
WriteRegistersToTarget(const TargetRegisters& registers) : registers(registers) {};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user