kima2/src/core/entity.h

24 lines
468 B
C
Raw Normal View History

2018-07-05 16:29:43 +02:00
#ifndef ENTITY_H
#define ENTITY_H
2018-07-06 10:54:44 +02:00
#include <string>
#include <boost/uuid/uuid.hpp>
2018-07-05 16:29:43 +02:00
class Entity
{
2018-07-09 13:03:25 +02:00
public:
2018-07-10 12:51:03 +02:00
enum class State { NEW, UPDATED, READ };
// Entity();
2018-07-09 20:51:33 +02:00
virtual ~Entity() = 0;
2018-07-10 12:51:03 +02:00
const boost::uuids::uuid& getUuid() const { return uuid_; };
2018-07-09 13:03:25 +02:00
void createUuid();
2018-07-09 16:07:04 +02:00
void createUuidFromString(const std::string& uuidString);
2018-07-10 12:51:03 +02:00
State getState();
2018-07-09 13:03:25 +02:00
private:
2018-07-10 12:51:03 +02:00
boost::uuids::uuid uuid_{};
State state_{State::NEW};
2018-07-05 16:29:43 +02:00
};
2018-07-09 13:03:25 +02:00
#endif // ENTITY_H