33 lines
671 B
C++
33 lines
671 B
C++
#ifndef ENTITY_UUID_H
|
|
#define ENTITY_UUID_H
|
|
|
|
#include "entity.h"
|
|
|
|
#include <string>
|
|
|
|
#include <boost/uuid/uuid.hpp>
|
|
#include <boost/uuid/uuid_io.hpp>
|
|
|
|
class EntityUuid : public Entity
|
|
{
|
|
public:
|
|
EntityUuid() = default;
|
|
virtual ~EntityUuid() = default;
|
|
|
|
void createUuid();
|
|
void setUuidFromString(const std::string &uuidString);
|
|
void setSourceNo(int sourceNo);
|
|
|
|
const boost::uuids::uuid &getUuid() const { return m_uuid; };
|
|
std::string getUuidAsString() const { return boost::uuids::to_string(m_uuid); }
|
|
virtual int getSourceNo() const;
|
|
|
|
protected:
|
|
int m_sourceNo{};
|
|
|
|
private:
|
|
boost::uuids::uuid m_uuid{};
|
|
};
|
|
|
|
#endif // ENTITY_UUID_H
|