Enforce RsEvent not being instantiable without inheriting

This commit is contained in:
Gioacchino Mazzurco 2019-04-15 11:17:26 +02:00
parent 5554f799c0
commit 9aa116b885
No known key found for this signature in database
GPG Key ID: A1FBCA3872E87051

View File

@ -59,11 +59,13 @@ enum class RsEventType : uint32_t
*/
struct RsEvent : RsSerializable
{
RsEvent() = delete;
protected:
RsEvent(RsEventType type) :
mType(type), mTimePoint(std::chrono::system_clock::now()) {}
virtual ~RsEvent();
RsEvent() = delete;
public:
RsEventType mType;
std::chrono::system_clock::time_point mTimePoint;
@ -81,6 +83,8 @@ struct RsEvent : RsSerializable
RS_SERIAL_PROCESS(mTime);
mTimePoint = std::chrono::system_clock::from_time_t(mTime);
}
virtual ~RsEvent();
};
typedef uint32_t RsEventsHandlerId_t;