From 98fdffe5fb414fe6ce3abdc83adb63cf7e58a7fb Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Mon, 7 Oct 2019 10:51:13 +0200 Subject: [PATCH] having fun with virtual dtors --- src/core/entity.h | 2 +- src/core/entityint.h | 1 + src/core/entityuuid.cpp | 2 -- src/core/entityuuid.h | 4 ++-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core/entity.h b/src/core/entity.h index 68b3ba7..ca48f47 100644 --- a/src/core/entity.h +++ b/src/core/entity.h @@ -5,7 +5,7 @@ class Entity { public: enum class State { NEW, UPDATE, DELETE, OK }; - //virtual ~Entity() = 0; + virtual ~Entity() = default; void setState(State state) { state_ = state; } virtual State getState() const; diff --git a/src/core/entityint.h b/src/core/entityint.h index 9430a70..06a332b 100644 --- a/src/core/entityint.h +++ b/src/core/entityint.h @@ -7,6 +7,7 @@ class EntityInt : public Entity { public: EntityInt() = default; + virtual ~EntityInt() = default; EntityInt(int id); void setId(int id); int getId() const { return id_; }; diff --git a/src/core/entityuuid.cpp b/src/core/entityuuid.cpp index 4ec15ab..07eaf8d 100644 --- a/src/core/entityuuid.cpp +++ b/src/core/entityuuid.cpp @@ -5,8 +5,6 @@ #include #include -EntityUuid::~EntityUuid() = default; - void EntityUuid::createUuid() { static boost::uuids::random_generator generator{}; diff --git a/src/core/entityuuid.h b/src/core/entityuuid.h index 9b99ba7..c9491a6 100644 --- a/src/core/entityuuid.h +++ b/src/core/entityuuid.h @@ -11,8 +11,8 @@ class EntityUuid : public Entity { public: - // Entity() = default; - virtual ~EntityUuid() = 0; + EntityUuid() = default; + virtual ~EntityUuid() = default; void createUuid(); void setUuidFromString(const std::string& uuidString);