mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-28 16:17:28 -04:00
Enforce RsEvent not being instantiable without inheriting
This commit is contained in:
parent
5554f799c0
commit
9aa116b885
1 changed files with 6 additions and 2 deletions
|
@ -59,11 +59,13 @@ enum class RsEventType : uint32_t
|
||||||
*/
|
*/
|
||||||
struct RsEvent : RsSerializable
|
struct RsEvent : RsSerializable
|
||||||
{
|
{
|
||||||
RsEvent() = delete;
|
protected:
|
||||||
RsEvent(RsEventType type) :
|
RsEvent(RsEventType type) :
|
||||||
mType(type), mTimePoint(std::chrono::system_clock::now()) {}
|
mType(type), mTimePoint(std::chrono::system_clock::now()) {}
|
||||||
virtual ~RsEvent();
|
|
||||||
|
|
||||||
|
RsEvent() = delete;
|
||||||
|
|
||||||
|
public:
|
||||||
RsEventType mType;
|
RsEventType mType;
|
||||||
std::chrono::system_clock::time_point mTimePoint;
|
std::chrono::system_clock::time_point mTimePoint;
|
||||||
|
|
||||||
|
@ -81,6 +83,8 @@ struct RsEvent : RsSerializable
|
||||||
RS_SERIAL_PROCESS(mTime);
|
RS_SERIAL_PROCESS(mTime);
|
||||||
mTimePoint = std::chrono::system_clock::from_time_t(mTime);
|
mTimePoint = std::chrono::system_clock::from_time_t(mTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual ~RsEvent();
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef uint32_t RsEventsHandlerId_t;
|
typedef uint32_t RsEventsHandlerId_t;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue