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

@@ -14,21 +14,17 @@ namespace Bloom::Events
class Event
{
private:
QDateTime createdTimestamp = DateTime::currentDateTime();
static inline std::atomic<int> lastEventId = 0;
public:
int id = ++(this->lastEventId);
int id = ++(Event::lastEventId);
QDateTime createdTimestamp = DateTime::currentDateTime();
std::optional<int> correlationId;
static inline const std::string name = "GenericEvent";
virtual std::string getName() const {
[[nodiscard]] virtual std::string getName() const {
return Event::name;
}
long getCreatedEpochTimestamp() const {
return this->createdTimestamp.toMSecsSinceEpoch();
}
};
}