From d061fe55de758aafdec3b1ef378d83e0bee94242 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 27 Jul 2011 17:20:12 +0000 Subject: More features for uuids, including hashing and comparison. --- src/uuid.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/uuid.cpp') diff --git a/src/uuid.cpp b/src/uuid.cpp index bcaf377..088450b 100644 --- a/src/uuid.cpp +++ b/src/uuid.cpp @@ -100,3 +100,18 @@ void Bu::Uuid::set( const Bu::String &sSrc ) } } +bool Bu::Uuid::operator==( const Uuid &rhs ) const +{ + return memcmp( data, rhs.data, 16 ) == 0; +} + +template<> uint32_t Bu::__calcHashCode( const Bu::Uuid &k ) +{ + return __calcHashCode( k.toRawString() ); +} + +template<> bool Bu::__cmpHashKeys( const Bu::Uuid &a, const Bu::Uuid &b ) +{ + return a == b; +} + -- cgit v1.2.3