kima2/src/core/entityuuid.h

33 lines
671 B
C
Raw Normal View History

2019-10-04 14:05:19 +02:00
#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
{
2022-07-07 15:21:46 +02:00
public:
2019-10-07 10:51:13 +02:00
EntityUuid() = default;
virtual ~EntityUuid() = default;
2019-10-04 14:05:19 +02:00
void createUuid();
2022-07-07 15:21:46 +02:00
void setUuidFromString(const std::string &uuidString);
2019-10-04 14:05:19 +02:00
void setSourceNo(int sourceNo);
2022-07-07 15:21:46 +02:00
const boost::uuids::uuid &getUuid() const { return m_uuid; };
2022-07-07 15:03:39 +02:00
std::string getUuidAsString() const { return boost::uuids::to_string(m_uuid); }
2019-10-04 14:05:19 +02:00
virtual int getSourceNo() const;
2022-07-07 15:21:46 +02:00
protected:
2022-07-07 15:03:39 +02:00
int m_sourceNo{};
2019-10-04 14:05:19 +02:00
2022-07-07 15:21:46 +02:00
private:
2022-07-07 15:03:39 +02:00
boost::uuids::uuid m_uuid{};
2019-10-04 14:05:19 +02:00
};
#endif // ENTITY_UUID_H