#pragma once #include #include #include #include #include "src/Helpers/DateTime.hpp" namespace Bloom::Events { static_assert(std::atomic::is_always_lock_free); class Event { private: QDateTime createdTimestamp = DateTime::currentDateTime(); static inline std::atomic lastEventId = 0; public: int id = ++(this->lastEventId); std::optional correlationId; static inline const std::string name = "GenericEvent"; virtual std::string getName() const { return Event::name; } long getCreatedEpochTimestamp() const { return this->createdTimestamp.toMSecsSinceEpoch(); } }; }