This commit is contained in:
Nav
2021-05-25 21:50:17 +01:00
parent c755094cd5
commit 77bcf07d6c
43 changed files with 103 additions and 49 deletions

View File

@@ -63,10 +63,11 @@ namespace Bloom
/**
* A mapping of event type names to a vector of callback functions. Events will be dispatched to these
* callback functions, during a call to EventListener::waiteAndDispatch().
* callback functions, during a call to EventListener::dispatchEvent().
*
* Each callback will be passed an std::shared_ptr<const EventType> of the event (we downcast the events in
* EventListener::waiteAndDispatch() before dispatching them).
* Each callback will be passed an std::shared_ptr<const EventType> of the event (we wrap all registered
* callbacks in a lambda, where we perform a downcast before invoking the callback.
* See EventListener::registerCallbackForEventType() for more)
*/
SyncSafe<std::map<std::string, std::vector<std::function<void(Events::GenericEventPointer)>>>> eventTypeToCallbacksMapping;
SyncSafe<std::set<std::string>> registeredEventTypes;

View File

@@ -1,5 +1,7 @@
#pragma once
#include <string>
#include "Event.hpp"
namespace Bloom::Events

View File

@@ -1,6 +1,7 @@
#pragma once
#include <set>
#include <string>
#include "Event.hpp"
namespace Bloom::Events

View File

@@ -1,5 +1,7 @@
#pragma once
#include <string>
#include "Event.hpp"
#include "src/Helpers/Thread.hpp"

View File

@@ -1,5 +1,7 @@
#pragma once
#include <string>
#include "Event.hpp"
namespace Bloom::Events

View File

@@ -1,5 +1,7 @@
#pragma once
#include <string>
#include "Event.hpp"
namespace Bloom::Events

View File

@@ -9,7 +9,6 @@
#include "DebugSessionStarted.hpp"
#include "DebugSessionFinished.hpp"
#include "TargetControllerThreadStateChanged.hpp"
#include "TargetControllerStopped.hpp"
#include "ShutdownTargetController.hpp"
#include "TargetControllerErrorOccurred.hpp"
#include "ShutdownApplication.hpp"

View File

@@ -1,6 +1,6 @@
#pragma once
#include <cstdint>
#include <string>
#include "Event.hpp"

View File

@@ -1,5 +1,7 @@
#pragma once
#include <string>
#include "Event.hpp"
#include "src/Helpers/Thread.hpp"

View File

@@ -1,6 +1,6 @@
#pragma once
#include <vector>
#include <string>
#include "Event.hpp"
#include "src/Targets/TargetMemory.hpp"

View File

@@ -1,5 +1,7 @@
#pragma once
#include <string>
#include "Event.hpp"
#include "src/Targets/TargetMemory.hpp"

View File

@@ -1,5 +1,7 @@
#pragma once
#include <string>
#include "Event.hpp"
namespace Bloom::Events

View File

@@ -1,6 +1,6 @@
#pragma once
#include <vector>
#include <string>
#include "Event.hpp"
#include "src/Targets/TargetRegister.hpp"

View File

@@ -1,6 +1,6 @@
#pragma once
#include <set>
#include <string>
#include "Event.hpp"

View File

@@ -1,6 +1,7 @@
#pragma once
#include <cstdint>
#include <string>
#include "Event.hpp"
#include "src/Targets/TargetBreakpoint.hpp"

View File

@@ -1,5 +1,7 @@
#pragma once
#include <string>
#include "Event.hpp"
namespace Bloom::Events

View File

@@ -1,6 +1,7 @@
#pragma once
#include <cstdint>
#include <string>
#include "Event.hpp"

View File

@@ -1,6 +1,7 @@
#pragma once
#include <cstdint>
#include <string>
#include "Event.hpp"
#include "src/Targets/TargetMemory.hpp"

View File

@@ -1,6 +1,6 @@
#pragma once
#include <set>
#include <string>
#include "Event.hpp"
#include "src/Targets/TargetRegister.hpp"

View File

@@ -1,6 +1,6 @@
#pragma once
#include <cstdint>
#include <string>
#include "Event.hpp"

View File

@@ -1,6 +1,7 @@
#pragma once
#include <cstdint>
#include <string>
#include "Event.hpp"
#include "src/Targets/TargetBreakpoint.hpp"

View File

@@ -1,5 +1,8 @@
#pragma once
#include <cstdint>
#include <string>
#include "Event.hpp"
namespace Bloom::Events

View File

@@ -1,6 +1,6 @@
#pragma once
#include <cstdint>
#include <string>
#include "Event.hpp"
#include "src/Targets/TargetPinDescriptor.hpp"

View File

@@ -1,5 +1,7 @@
#pragma once
#include <string>
#include "Event.hpp"
namespace Bloom::Events

View File

@@ -1,5 +1,7 @@
#pragma once
#include <string>
#include "Event.hpp"
namespace Bloom::Events

View File

@@ -1,5 +1,7 @@
#pragma once
#include <string>
#include "Event.hpp"
namespace Bloom::Events

View File

@@ -1,6 +1,7 @@
#pragma once
#include <cstdint>
#include <string>
#include "Event.hpp"

View File

@@ -1,5 +1,7 @@
#pragma once
#include <string>
#include "Event.hpp"
namespace Bloom::Events

View File

@@ -1,5 +1,7 @@
#pragma once
#include <string>
#include "Event.hpp"
namespace Bloom::Events

View File

@@ -1,21 +0,0 @@
#pragma once
#include "Event.hpp"
#include "src/Exceptions/Exception.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;
}
};
}

View File

@@ -1,6 +1,6 @@
#pragma once
#include <cstdint>
#include <string>
#include "Event.hpp"
#include "src/Targets/TargetDescriptor.hpp"

View File

@@ -1,5 +1,7 @@
#pragma once
#include <string>
#include "Event.hpp"
namespace Bloom::Events

View File

@@ -1,6 +1,7 @@
#pragma once
#include <cstdint>
#include <string>
#include "Event.hpp"
#include "src/Targets/Target.hpp"

View File

@@ -1,7 +1,7 @@
#pragma once
#include <cstdint>
#include <map>
#include <string>
#include "Event.hpp"
#include "src/Targets/TargetPinDescriptor.hpp"

View File

@@ -1,6 +1,7 @@
#pragma once
#include <cstdint>
#include <string>
#include "Event.hpp"
#include "src/Targets/TargetMemory.hpp"

View File

@@ -1,6 +1,6 @@
#pragma once
#include <set>
#include <string>
#include "Event.hpp"
#include "src/Targets/TargetRegister.hpp"