activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r559250 - /activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/UUID.h
Date Tue, 24 Jul 2007 22:54:49 GMT
Author: tabish
Date: Tue Jul 24 15:54:47 2007
New Revision: 559250

URL: http://svn.apache.org/viewvc?view=rev&rev=559250
Log:
http://issues.apache.org/activemq/browse/AMQCPP-103

Modified:
    activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/UUID.h

Modified: activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/UUID.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/UUID.h?view=diff&rev=559250&r1=559249&r2=559250
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/UUID.h (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/UUID.h Tue Jul 24 15:54:47 2007
@@ -26,6 +26,10 @@
 namespace decaf{
 namespace util{
 
+    /**
+     * A class that represents an immutable universally unique identifier (UUID).
+     * A UUID represents a 128-bit value.
+     */
     class UUID : public Comparable<UUID> {
     private:
 
@@ -38,9 +42,39 @@
     public:
 
         /**
-         * Default Constructor
+         * Static factory to retrieve a type 4 (pseudo randomly generated) UUID.
+         * The UUID is generated using a cryptographically strong pseudo random
+         * number generator.
+         * @return type 4 UUID
          */
-        UUID();
+        static UUID randomUUID();
+
+        /**
+         * Static factory to retrieve a type 3 (name based) UUID based on the
+         * specified byte array.
+         * @param name - a byte array to be used to construct a UUID.
+         * @return type 3 UUID
+         */
+        static UUID nameUUIDFromBytes( const char* name );
+
+        /**
+         * Creates a UUID from the string standard representation as described
+         * in the toString() method.
+         * @param name - a string to be used to construct a UUID.
+         * @return type 3 UUID
+         */
+        static UUID fromString( const std::string& name );
+
+    public:
+
+        /**
+         * Constructs a new UUID using the specified data. mostSigBits is used
+         * for the most significant 64 bits of the UUID and leastSigBits becomes
+         * the least significant 64 bits of the UUID.
+         * @param mostSigBits
+         * @param leastSigBits
+         */
+        UUID( long mostSigBits, long leastSigBits );
 
         virtual ~UUID();
 
@@ -49,6 +83,16 @@
          * @param value - the UUID to compare to
          */
         virtual int compareTo( const UUID& value );
+
+        /**
+         * @returns the most significant 64 bits of this UUID's 128 bit value.
+         */
+        virtual long getLeastSignificantBits() const;
+
+        /**
+         * @returns the most significant 64 bits of this UUID's 128 bit value.
+         */
+        virtual long getMostSignificantBits() const;
 
     };
 



Mime
View raw message