From b6b0d83965352bec76ede5e69b8ea99da100749c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 8 Feb 2011 02:21:15 +0000 Subject: revert earlier changes to uuid class, but keep boost version in svn for the future git-svn-id: svn://localhost/ardour2/branches/3.0@8763 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/pbd/pbd/uuid.h | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) (limited to 'libs/pbd/pbd/uuid.h') diff --git a/libs/pbd/pbd/uuid.h b/libs/pbd/pbd/uuid.h index 275b72648a..16a67436b7 100644 --- a/libs/pbd/pbd/uuid.h +++ b/libs/pbd/pbd/uuid.h @@ -22,35 +22,29 @@ #define __pbd_uuid_h__ #include -#include -#include +#include namespace PBD { -class UUID : public boost::uuids::uuid { +class UUID { public: - UUID () - : boost::uuids::uuid (boost::uuids::random_generator()()) {} - UUID (std::string const & str) - : boost::uuids::uuid (boost::uuids::string_generator()(str)) {} - - explicit UUID (boost::uuids::uuid const& u) - : boost::uuids::uuid(u) - {} - - operator boost::uuids::uuid() { - return static_cast(*this); - } - - operator boost::uuids::uuid() const { - return static_cast(*this); - } - - UUID& operator= (std::string const & str); - std::string to_s () const; - - operator bool() const { return !is_nil(); } + UUID () { uuid_generate (id); } + UUID (UUID const & other) { uuid_copy (id, other.id); } + UUID (std::string const & str) { uuid_parse (str.c_str(), id); } + + UUID& operator= (std::string const & str); + std::string to_s () const; + + bool operator== (UUID const & other) const { return !uuid_compare (id, other.id); } + bool operator!= (UUID const & other) const { return uuid_compare (id, other.id); } + bool operator< (UUID const & other) const { return uuid_compare (id, other.id) < 0; } + + operator bool() const { return !uuid_is_null (id); } + + private: + uuid_t id; + }; } // namespace PBD -- cgit v1.2.3