Refactored insight startup code to accommodate on-demand activation.

Also created new event for activation request
This commit is contained in:
Nav
2023-05-24 23:12:36 +01:00
parent 088a8e30ae
commit f980d960b7
8 changed files with 118 additions and 26 deletions

View File

@@ -32,6 +32,7 @@ namespace Bloom::Events
TARGET_RESET,
PROGRAMMING_MODE_ENABLED,
PROGRAMMING_MODE_DISABLED,
INSIGHT_ACTIVATION_REQUESTED,
};
class Event

View File

@@ -20,6 +20,10 @@
#include "ProgrammingModeEnabled.hpp"
#include "ProgrammingModeDisabled.hpp"
#ifndef EXCLUDE_INSIGHT
#include "InsightActivationRequested.hpp"
#endif
namespace Bloom::Events
{
template <class EventType>

View File

@@ -0,0 +1,26 @@
#pragma once
#include <cstdint>
#include <string>
#include "Event.hpp"
namespace Bloom::Events
{
class InsightActivationRequested: public Event
{
public:
static constexpr EventType type = EventType::INSIGHT_ACTIVATION_REQUESTED;
static const inline std::string name = "InsightActivationRequested";
InsightActivationRequested() = default;
[[nodiscard]] EventType getType() const override {
return InsightActivationRequested::type;
}
[[nodiscard]] std::string getName() const override {
return InsightActivationRequested::name;
}
};
}