diff options
author | Kevron Rees <kevron_m_rees@linux.intel.com> | 2012-12-05 14:26:28 -0800 |
---|---|---|
committer | Kevron Rees <kevron_m_rees@linux.intel.com> | 2012-12-05 14:26:28 -0800 |
commit | 65df90bd9ddb07d26f23e60588f97d26643f1261 (patch) | |
tree | 51c101f1dc4d283284f4245609990645db9ee2cc | |
parent | 18ef1c73a2d65539b71a9a676c07bd95bd10fcd2 (diff) | |
download | automotive-message-broker-0.6.1.tar.gz |
uuidhelper0.6.1
-rw-r--r-- | lib/CMakeLists.txt | 6 | ||||
-rw-r--r-- | lib/uuidhelper.cpp | 12 | ||||
-rw-r--r-- | lib/uuidhelper.h | 17 |
3 files changed, 32 insertions, 3 deletions
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index b8fe9151..64c35ab7 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,9 +1,9 @@ -set(amb_sources abstractpropertytype.cpp abstractroutingengine.cpp listplusplus.cpp abstractsink.cpp vehicleproperty.cpp abstractsource.cpp debugout.cpp timestamp.cpp) -set(amb_headers_install abstractpropertytype.h nullptr.h abstractroutingengine.h listplusplus.h abstractsink.h vehicleproperty.h debugout.h abstractsource.h timestamp.h) +set(amb_sources abstractpropertytype.cpp abstractroutingengine.cpp listplusplus.cpp abstractsink.cpp vehicleproperty.cpp abstractsource.cpp debugout.cpp timestamp.cpp uuidhelper.cpp) +set(amb_headers_install abstractpropertytype.h nullptr.h abstractroutingengine.h listplusplus.h abstractsink.h vehicleproperty.h debugout.h abstractsource.h timestamp.h uuidhelper.h) include_directories( ${include_dirs} ) add_library(amb SHARED ${amb_sources}) -target_link_libraries(amb ${libtool_LIBRARY} ${glib_LIBRARIES} ${gio_LIBRARIES}) +target_link_libraries(amb uuid ${libtool_LIBRARY} ${glib_LIBRARIES} ${gio_LIBRARIES}) configure_file (${CMAKE_CURRENT_SOURCE_DIR}/automotive-message-broker.pc.in ${CMAKE_CURRENT_BINARY_DIR}/automotive-message-broker.pc @ONLY) diff --git a/lib/uuidhelper.cpp b/lib/uuidhelper.cpp new file mode 100644 index 00000000..3a53b96c --- /dev/null +++ b/lib/uuidhelper.cpp @@ -0,0 +1,12 @@ +#include "uuidhelper.h" + +std::string amb::createUuid() +{ + uuid_t id; + uuid_generate_random(id); + + char* out; + uuid_unparse(id, out); + + return out; +} diff --git a/lib/uuidhelper.h b/lib/uuidhelper.h new file mode 100644 index 00000000..15bc55b9 --- /dev/null +++ b/lib/uuidhelper.h @@ -0,0 +1,17 @@ +#ifndef _UUIDHELPER__H_ +#define _UUIDHELPER__H_ + + +#include <uuid/uuid.h> +#include <string> + +namespace amb +{ + +std::string createUuid(); + +} + + +#endif + |