diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-02-08 02:21:15 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-02-08 02:21:15 +0000 |
commit | b6b0d83965352bec76ede5e69b8ea99da100749c (patch) | |
tree | bb37613639cd45debd64035ec581727099c02e6f /libs/pbd/pbd/uuid.h | |
parent | 25a7bb4825397d9c9f0a4c217aa4b3248b3c868c (diff) |
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
Diffstat (limited to 'libs/pbd/pbd/uuid.h')
-rw-r--r-- | libs/pbd/pbd/uuid.h | 42 |
1 files changed, 18 insertions, 24 deletions
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 <string> -#include <boost/uuid/uuid.hpp> -#include <boost/uuid/uuid_generators.hpp> +#include <uuid/uuid.h> 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<boost::uuids::uuid&>(*this); - } - - operator boost::uuids::uuid() const { - return static_cast<boost::uuids::uuid const&>(*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 |