having fun with virtual dtors
This commit is contained in:
parent
847e8aa8ba
commit
98fdffe5fb
4 changed files with 4 additions and 5 deletions
|
@ -5,7 +5,7 @@ class Entity
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum class State { NEW, UPDATE, DELETE, OK };
|
enum class State { NEW, UPDATE, DELETE, OK };
|
||||||
//virtual ~Entity() = 0;
|
virtual ~Entity() = default;
|
||||||
void setState(State state) { state_ = state; }
|
void setState(State state) { state_ = state; }
|
||||||
virtual State getState() const;
|
virtual State getState() const;
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ class EntityInt : public Entity
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EntityInt() = default;
|
EntityInt() = default;
|
||||||
|
virtual ~EntityInt() = default;
|
||||||
EntityInt(int id);
|
EntityInt(int id);
|
||||||
void setId(int id);
|
void setId(int id);
|
||||||
int getId() const { return id_; };
|
int getId() const { return id_; };
|
||||||
|
|
|
@ -5,8 +5,6 @@
|
||||||
#include <boost/uuid/uuid_generators.hpp>
|
#include <boost/uuid/uuid_generators.hpp>
|
||||||
#include <boost/uuid/uuid_io.hpp>
|
#include <boost/uuid/uuid_io.hpp>
|
||||||
|
|
||||||
EntityUuid::~EntityUuid() = default;
|
|
||||||
|
|
||||||
void EntityUuid::createUuid()
|
void EntityUuid::createUuid()
|
||||||
{
|
{
|
||||||
static boost::uuids::random_generator generator{};
|
static boost::uuids::random_generator generator{};
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
class EntityUuid : public Entity
|
class EntityUuid : public Entity
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Entity() = default;
|
EntityUuid() = default;
|
||||||
virtual ~EntityUuid() = 0;
|
virtual ~EntityUuid() = default;
|
||||||
|
|
||||||
void createUuid();
|
void createUuid();
|
||||||
void setUuidFromString(const std::string& uuidString);
|
void setUuidFromString(const std::string& uuidString);
|
||||||
|
|
Loading…
Reference in a new issue