35 lines
No EOL
773 B
C++
35 lines
No EOL
773 B
C++
#ifndef ENTITY_H
|
|
#define ENTITY_H
|
|
|
|
#include <string>
|
|
|
|
#include <boost/uuid/uuid.hpp>
|
|
#include <boost/uuid/uuid_io.hpp>
|
|
|
|
class Entity
|
|
{
|
|
public:
|
|
enum class State { NEW, UPDATE, DELETE, OK };
|
|
|
|
// Entity() = default;
|
|
virtual ~Entity() = 0;
|
|
|
|
void createUuid();
|
|
void setUuidFromString(const std::string& uuidString);
|
|
void setState(State state) { state_ = state; }
|
|
void setSourceNo(int sourceNo);
|
|
|
|
const boost::uuids::uuid& getUuid() const { return uuid_; };
|
|
std::string getUuidAsString() const { return boost::uuids::to_string(uuid_); }
|
|
virtual State getState() const;
|
|
virtual int getSourceNo() const;
|
|
|
|
protected:
|
|
int sourceNo_{};
|
|
|
|
private:
|
|
boost::uuids::uuid uuid_{};
|
|
State state_{State::NEW};
|
|
};
|
|
|
|
#endif // ENTITY_H
|