33 lines
673 B
C++
33 lines
673 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 uuid_; };
|
|
std::string getUuidAsString() const { return boost::uuids::to_string(uuid_); }
|
|
virtual int getSourceNo() const;
|
|
|
|
protected:
|
|
int sourceNo_{};
|
|
|
|
private:
|
|
boost::uuids::uuid uuid_{};
|
|
};
|
|
|
|
#endif // ENTITY_UUID_H
|