more on states
This commit is contained in:
parent
976dcbcbeb
commit
4fdbc268a5
2 changed files with 6 additions and 4 deletions
|
@ -19,7 +19,7 @@ void Entity::createUuidFromString(const std::string& uuidString)
|
||||||
uuid_ = generator(uuidString);
|
uuid_ = generator(uuidString);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Entity::State Entity::getState()
|
inline Entity::State Entity::getState() const
|
||||||
{
|
{
|
||||||
return state_;
|
return state_;
|
||||||
}
|
}
|
|
@ -4,17 +4,19 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include <boost/uuid/uuid.hpp>
|
#include <boost/uuid/uuid.hpp>
|
||||||
|
#include <boost/uuid/uuid_io.hpp>
|
||||||
|
|
||||||
class Entity
|
class Entity
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum class State { NEW, UPDATED, READ };
|
enum class State { NEW, UPDATED, CLEAN };
|
||||||
// Entity();
|
|
||||||
virtual ~Entity() = 0;
|
virtual ~Entity() = 0;
|
||||||
const boost::uuids::uuid& getUuid() const { return uuid_; };
|
const boost::uuids::uuid& getUuid() const { return uuid_; };
|
||||||
void createUuid();
|
void createUuid();
|
||||||
void createUuidFromString(const std::string& uuidString);
|
void createUuidFromString(const std::string& uuidString);
|
||||||
State getState();
|
virtual State getState() const;
|
||||||
|
void setState(State state) { state_ = state; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
boost::uuids::uuid uuid_{};
|
boost::uuids::uuid uuid_{};
|
||||||
|
|
Loading…
Reference in a new issue