2018-07-05 16:29:43 +02:00
|
|
|
#include "entity.h"
|
|
|
|
|
2018-07-09 13:03:25 +02:00
|
|
|
#include <iostream>
|
|
|
|
|
2018-07-06 10:54:44 +02:00
|
|
|
#include <boost/uuid/uuid_generators.hpp>
|
2018-07-09 13:03:25 +02:00
|
|
|
#include <boost/uuid/uuid_io.hpp>
|
|
|
|
|
2018-07-20 11:52:26 +02:00
|
|
|
Entity::~Entity() = default;
|
2018-07-09 20:51:33 +02:00
|
|
|
|
2018-07-09 13:03:25 +02:00
|
|
|
void Entity::createUuid()
|
|
|
|
{
|
|
|
|
static boost::uuids::random_generator generator{};
|
2018-07-10 12:51:03 +02:00
|
|
|
uuid_ = generator();
|
2018-07-09 13:03:25 +02:00
|
|
|
}
|
2018-07-05 16:29:43 +02:00
|
|
|
|
2018-07-12 14:38:22 +02:00
|
|
|
void Entity::setUuidFromString(const std::string& uuidString)
|
2018-07-06 10:54:44 +02:00
|
|
|
{
|
2018-07-09 13:03:25 +02:00
|
|
|
boost::uuids::string_generator generator{};
|
2018-07-10 12:51:03 +02:00
|
|
|
uuid_ = generator(uuidString);
|
|
|
|
}
|
|
|
|
|
2018-07-20 11:52:26 +02:00
|
|
|
Entity::State Entity::getState() const
|
2018-07-10 12:51:03 +02:00
|
|
|
{
|
|
|
|
return state_;
|
2018-07-13 13:05:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Entity::setSourceNo(int sourceNo) {
|
|
|
|
sourceNo_ = sourceNo;
|
|
|
|
}
|
|
|
|
|
|
|
|
int Entity::getSourceNo() const {
|
|
|
|
return sourceNo_;
|
2018-07-05 16:29:43 +02:00
|
|
|
}
|