using boost uuid

This commit is contained in:
Martin Brodbeck 2018-07-06 10:54:44 +02:00
parent 60365877d6
commit 0104e72997
3 changed files with 14 additions and 4 deletions

View File

@ -1,4 +1,7 @@
find_package(Boost 1.62 REQUIRED)
set(CORE_HEADERS
entity.h
)
@ -6,4 +9,5 @@ set(CORE_SOURCES
entity.cpp
)
add_library(core STATIC ${CORE_SOURCES})
add_library(core STATIC ${CORE_SOURCES})
target_link_libraries(core Boost::boost)

View File

@ -1,6 +1,7 @@
#include "entity.h"
Entity::Entity()
{
#include <boost/uuid/uuid_generators.hpp>
Entity::Entity() : uuid(boost::uuids::random_generator()())
{
}

View File

@ -1,13 +1,18 @@
#ifndef ENTITY_H
#define ENTITY_H
#include <string>
#include <boost/uuid/uuid.hpp>
class Entity
{
public:
Entity();
~Entity();
const boost::uuids::uuid& getUuid() {return uuid;};
private:
int uuid{-1};
boost::uuids::uuid uuid;
};
#endif //ENTITY_H