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);
|
||||
}
|
||||
|
||||
inline Entity::State Entity::getState()
|
||||
inline Entity::State Entity::getState() const
|
||||
{
|
||||
return state_;
|
||||
}
|
|
@ -4,17 +4,19 @@
|
|||
#include <string>
|
||||
|
||||
#include <boost/uuid/uuid.hpp>
|
||||
#include <boost/uuid/uuid_io.hpp>
|
||||
|
||||
class Entity
|
||||
{
|
||||
public:
|
||||
enum class State { NEW, UPDATED, READ };
|
||||
// Entity();
|
||||
enum class State { NEW, UPDATED, CLEAN };
|
||||
|
||||
virtual ~Entity() = 0;
|
||||
const boost::uuids::uuid& getUuid() const { return uuid_; };
|
||||
void createUuid();
|
||||
void createUuidFromString(const std::string& uuidString);
|
||||
State getState();
|
||||
virtual State getState() const;
|
||||
void setState(State state) { state_ = state; }
|
||||
|
||||
private:
|
||||
boost::uuids::uuid uuid_{};
|
||||
|
|
Loading…
Reference in a new issue