having fun with virtual dtors

This commit is contained in:
Martin Brodbeck 2019-10-07 10:51:13 +02:00
parent 847e8aa8ba
commit 98fdffe5fb
4 changed files with 4 additions and 5 deletions

View file

@ -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;

View file

@ -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_; };

View file

@ -5,8 +5,6 @@
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
EntityUuid::~EntityUuid() = default;
void EntityUuid::createUuid()
{
static boost::uuids::random_generator generator{};

View file

@ -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);