[boost-doc-zh] r373 committed - 开始升级至1.42.0,新增 uuid 库

  • From: boost-doc-zh@xxxxxxxxxxxxxx
  • To: boost-doc-zh-notify@xxxxxxxxxxxxx
  • Date: Sun, 07 Feb 2010 13:47:12 +0000

Revision: 373
Author: alai04
Date: Sun Feb  7 05:46:29 2010
Log: 开始升级至1.42.0,新增 uuid 库
http://code.google.com/p/boost-doc-zh/source/detail?r=373

Added:
 /trunk/libs/uuid
 /trunk/libs/uuid/index.html
 /trunk/libs/uuid/test
 /trunk/libs/uuid/test/Jamfile.v2
 /trunk/libs/uuid/test/compile_uuid_generators_h.cpp
 /trunk/libs/uuid/test/compile_uuid_h.cpp
 /trunk/libs/uuid/test/compile_uuid_io_h.cpp
 /trunk/libs/uuid/test/compile_uuid_serialize_h.cpp
 /trunk/libs/uuid/test/test_generators.cpp
 /trunk/libs/uuid/test/test_include1.cpp
 /trunk/libs/uuid/test/test_include2.cpp
 /trunk/libs/uuid/test/test_io.cpp
 /trunk/libs/uuid/test/test_serialization.cpp
 /trunk/libs/uuid/test/test_sha1.cpp
 /trunk/libs/uuid/test/test_tagging.cpp
 /trunk/libs/uuid/test/test_uuid.cpp
 /trunk/libs/uuid/test/test_uuid_class.cpp
 /trunk/libs/uuid/test/test_wserialization.cpp
 /trunk/libs/uuid/uuid.html
Modified:
 /trunk/libs/libraries.htm

=======================================
--- /dev/null
+++ /trunk/libs/uuid/index.html Sun Feb  7 05:46:29 2010
@@ -0,0 +1,43 @@
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>Boost Uuid Library</title>
+</head>
+
+<body bgcolor="#FFFFFF" text="#000000">
+
+<table border="1" bgcolor="#007F7F" cellpadding="2">
+  <tr>
+ <td bgcolor="#FFFFFF"><img src="../../boost.png" alt="boost.png (6897 bytes)" WIDTH="277" HEIGHT="86"></td> + <td><a href="../../index.htm"><font face="Arial" color="#FFFFFF"><big>Home </big></font></a></td> + <td><a href="../libraries.htm"><font face="Arial" color="#FFFFFF"><big>Libraries </big></font></a></td> + <td><a href="../../people/people.htm"><font face="Arial" color="#FFFFFF"><big>People </big></font></a></td> + <td><a href="../../more/faq.htm"><font face="Arial" color="#FFFFFF"><big>FAQ </big></font></a></td> + <td><a href="../../more/index.htm"><font face="Arial" color="#FFFFFF"><big>More </big></font></a></td>
+  </tr>
+</table>
+
+<h1>Uuid library</h1>
+
+<p>The header uuid.hpp provides an implementation of Universally Unique Identifiers.
+</p>
+
+<p>This implementation is intended for general use.</p>
+
+<ul>
+  <li><a href="uuid.html">Documentation</a> (HTML).</li>
+  <li>Header <a href="../../boost/uuid/uuid.hpp">uuid.hpp</a>.</li>
+ <li>See the <a href="uuid.html">documentation</a> for links to sample programs.</li>
+  <li>Submitted by Andy Tompkins</a>.</li>
+</ul>
+
+<p>Revised&nbsp; May 14, 2007</p>
+
+<hr>
+<p>© Copyright Andy Tompkins, 2006</p>
+<p> Distributed under the Boost Software
+License, Version 1.0. (See accompanying file <a href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt";>
+www.boost.org/LICENSE_1_0.txt</a>)</p>
+</body>
+</html>
=======================================
--- /dev/null
+++ /trunk/libs/uuid/test/Jamfile.v2    Sun Feb  7 05:46:29 2010
@@ -0,0 +1,58 @@
+# Copyright 2007 Andy Tompkins.
+# Distributed under the Boost Software License, Version 1.0. (See
+# accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+
+import testing ;
+
+{
+  test-suite uuid :
+      # make sure uuid.hpp is self-contained
+      [ compile compile_uuid_h.cpp ]
+
+      # make sure uuid_io.hpp is self-contained
+      [ compile compile_uuid_io_h.cpp ]
+
+      # make sure uuid_serialize.hpp is self-contained
+      [ compile compile_uuid_serialize_h.cpp ]
+
+      # make sure uuid_generators.hpp is self-contained
+      [ compile compile_uuid_generators_h.cpp ]
+
+      # I want to look for issues when multiple translation units include
+ # uuid header files. For example missing inline on non-template functions + #[ link test_uuid.cpp compile_uuid_h.cpp : : multiple_translation_units ]
+
+      # main test - added compile_uuid_header.cpp in lue of above test
+      [ run test_uuid.cpp compile_uuid_h.cpp ]
+
+      # test inclucing all .hpp files in 2 translations units
+      # to make sure a inline state is not missing
+      [ run test_include1.cpp test_include2.cpp ]
+
+      # test uuid_io.hpp
+      [ run test_io.cpp ]
+
+      # test uuid_generators.hpp
+      [ run test_generators.cpp ]
+
+      # test tagging an object
+      [ run test_tagging.cpp ]
+
+      # test uuid class
+      [ run test_uuid_class.cpp ]
+
+      # test serializing uuids
+ [ run test_serialization.cpp ../../serialization/build//boost_serialization
+      ]
+      # TODO - This test fails to like with boost_wserialization
+      #[ run test_wserialization.cpp
+      #    ../../serialization/build//boost_serialization
+      #    ../../serialization/build//boost_wserialization
+      #    : : : <dependency>../../config/test/all//BOOST_NO_STD_WSTREAMBUF
+      #]
+
+      # test sha1 hash function
+      [ run test_sha1.cpp ]
+      ;
+}
=======================================
--- /dev/null
+++ /trunk/libs/uuid/test/compile_uuid_generators_h.cpp Sun Feb 7 05:46:29 2010
@@ -0,0 +1,15 @@
+// (C) Copyright Andy Tompkins 2008. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// libs/uuid/test/compile_uuid_generators_h.cpp -------------------------------//
+
+// Purpose to make sure that a translation unit consisting of just the contents
+// of the header file will compile successfully.
+
+#include <boost/uuid/uuid_generators.hpp>
=======================================
--- /dev/null
+++ /trunk/libs/uuid/test/compile_uuid_h.cpp    Sun Feb  7 05:46:29 2010
@@ -0,0 +1,15 @@
+// (C) Copyright Andy Tompkins 2008. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//  libs/uuid/test/compile_uuid_h.cpp  -------------------------------//
+
+// Purpose to make sure that a translation unit consisting of just the contents
+// of the header file will compile successfully.
+
+#include <boost/uuid/uuid.hpp>
=======================================
--- /dev/null
+++ /trunk/libs/uuid/test/compile_uuid_io_h.cpp Sun Feb  7 05:46:29 2010
@@ -0,0 +1,15 @@
+// (C) Copyright Andy Tompkins 2008. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//  libs/uuid/test/compile_uuid_io_h.cpp  -------------------------------//
+
+// Purpose to make sure that a translation unit consisting of just the contents
+// of the header file will compile successfully.
+
+#include <boost/uuid/uuid_io.hpp>
=======================================
--- /dev/null
+++ /trunk/libs/uuid/test/compile_uuid_serialize_h.cpp Sun Feb 7 05:46:29 2010
@@ -0,0 +1,15 @@
+// (C) Copyright Andy Tompkins 2008. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// libs/uuid/test/compile_uuid_serialize_h.cpp -------------------------------//
+
+// Purpose to make sure that a translation unit consisting of just the contents
+// of the header file will compile successfully.
+
+#include <boost/uuid/uuid_serialize.hpp>
=======================================
--- /dev/null
+++ /trunk/libs/uuid/test/test_generators.cpp   Sun Feb  7 05:46:29 2010
@@ -0,0 +1,137 @@
+// (C) Copyright Andy Tompkins 2009. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//  libs/uuid/test/test_generators.cpp  -------------------------------//
+
+#include <boost/uuid/uuid.hpp>
+#include <boost/uuid/uuid_generators.hpp>
+#include <boost/uuid/uuid_io.hpp>
+
+#include <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/test_tools.hpp>
+
+#include <boost/random.hpp>
+
+template <typename RandomUuidGenerator>
+void check_random_generator(RandomUuidGenerator& uuid_gen)
+{
+    boost::uuids::uuid u1 = uuid_gen();
+    boost::uuids::uuid u2 = uuid_gen();
+
+    BOOST_CHECK_NE(u1, u2);
+
+    // check variant
+    BOOST_CHECK_EQUAL(u1.variant(), boost::uuids::uuid::variant_rfc_4122);
+//    BOOST_CHECK_EQUAL( *(u1.begin()+8) & 0xC0, 0x80);
+    // version
+    BOOST_CHECK_EQUAL( *(u1.begin()+6) & 0xF0, 0x40);
+}
+
+int test_main(int, char*[])
+{
+    using namespace boost::uuids;
+    using boost::test_tools::output_test_stream;
+
+    { // test nil generator
+        uuid u1 = nil_generator()();
+        uuid u2 = {{0}};
+        BOOST_CHECK_EQUAL(u1, u2);
+
+        uuid u3 = nil_uuid();
+        BOOST_CHECK_EQUAL(u3, u2);
+    }
+
+    { // test string_generator
+        string_generator gen;
+        uuid u = gen("00000000-0000-0000-0000-000000000000");
+        BOOST_CHECK_EQUAL(u, nil_uuid());
+        BOOST_CHECK_EQUAL(u.is_nil(), true);
+
+ const uuid u_increasing = {{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }}; + const uuid u_decreasing = {{ 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }};
+
+        u = gen("0123456789abcdef0123456789ABCDEF");
+        BOOST_CHECK_EQUAL(u, u_increasing);
+
+        u = gen("{0123456789abcdef0123456789ABCDEF}");
+        BOOST_CHECK_EQUAL(u, u_increasing);
+
+        u = gen("{01234567-89AB-CDEF-0123-456789abcdef}");
+        BOOST_CHECK_EQUAL(u, u_increasing);
+
+        u = gen("01234567-89AB-CDEF-0123-456789abcdef");
+        BOOST_CHECK_EQUAL(u, u_increasing);
+
+        u = gen(std::string("fedcba98-7654-3210-fedc-ba9876543210"));
+        BOOST_CHECK_EQUAL(u, u_decreasing);
+
+#ifndef BOOST_NO_STD_WSTRING
+        u = gen(L"fedcba98-7654-3210-fedc-ba9876543210");
+        BOOST_CHECK_EQUAL(u, u_decreasing);
+
+        u = gen(std::wstring(L"01234567-89ab-cdef-0123-456789abcdef"));
+        BOOST_CHECK_EQUAL(u, u_increasing);
+#endif //BOOST_NO_STD_WSTRING
+    }
+
+    { // test name_generator
+ uuid dns_namespace_uuid = {{0x6b, 0xa7, 0xb8, 0x10, 0x9d, 0xad, 0x11, 0xd1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8}}; + uuid correct = {{0x21, 0xf7, 0xf8, 0xde, 0x80, 0x51, 0x5b, 0x89, 0x86, 0x80, 0x01, 0x95, 0xef, 0x79, 0x8b, 0x6a}}; + uuid wcorrect = {{0xb9, 0x50, 0x66, 0x13, 0x2c, 0x04, 0x51, 0x2d, 0xb8, 0xfe, 0xbf, 0x8d, 0x0b, 0xa1, 0xb2, 0x71}};
+
+        name_generator gen(dns_namespace_uuid);
+
+        uuid u = gen("www.widgets.com");
+        BOOST_CHECK_EQUAL(u, correct);
+ BOOST_CHECK_EQUAL(u.variant(), boost::uuids::uuid::variant_rfc_4122);
+
+        u = gen(L"www.widgets.com");
+        BOOST_CHECK_EQUAL(u, wcorrect);
+ BOOST_CHECK_EQUAL(u.variant(), boost::uuids::uuid::variant_rfc_4122);
+
+        u = gen(std::string("www.widgets.com"));
+        BOOST_CHECK_EQUAL(u, correct);
+ BOOST_CHECK_EQUAL(u.variant(), boost::uuids::uuid::variant_rfc_4122);
+
+        u = gen(std::wstring(L"www.widgets.com"));
+        BOOST_CHECK_EQUAL(u, wcorrect);
+ BOOST_CHECK_EQUAL(u.variant(), boost::uuids::uuid::variant_rfc_4122);
+
+        char name[] = "www.widgets.com";
+        u = gen(name, 15);
+        BOOST_CHECK_EQUAL(u, correct);
+ BOOST_CHECK_EQUAL(u.variant(), boost::uuids::uuid::variant_rfc_4122);
+    }
+
+    { // test random_generator
+        // default random number generator
+        random_generator uuid_gen1;
+        check_random_generator(uuid_gen1);
+
+        // specific random number generator
+        basic_random_generator<boost::rand48> uuid_gen2;
+        check_random_generator(uuid_gen2);
+
+        // pass by reference
+        boost::ecuyer1988 ecuyer1988_gen;
+ basic_random_generator<boost::ecuyer1988> uuid_gen3(ecuyer1988_gen);
+        check_random_generator(uuid_gen3);
+
+        // pass by pointer
+        boost::lagged_fibonacci607 lagged_fibonacci607_gen;
+ basic_random_generator<boost::lagged_fibonacci607> uuid_gen4(&lagged_fibonacci607_gen);
+        check_random_generator(uuid_gen4);
+
+        // random device
+        //basic_random_generator<boost::random_device> uuid_gen5;
+        //check_random_generator(uuid_gen5);
+    }
+
+    return 0;
+}
=======================================
--- /dev/null
+++ /trunk/libs/uuid/test/test_include1.cpp     Sun Feb  7 05:46:29 2010
@@ -0,0 +1,23 @@
+// (C) Copyright Andy Tompkins 2009. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//  libs/uuid/test/test_include1.cpp  -------------------------------//
+
+#include <boost/test/included/test_exec_monitor.hpp>
+//#include <boost/test/test_tools.hpp>
+
+#include <boost/uuid/uuid.hpp>
+#include <boost/uuid/uuid_io.hpp>
+#include <boost/uuid/uuid_generators.hpp>
+#include <boost/uuid/uuid_serialize.hpp>
+
+int test_main(int, char*[])
+{
+    return 0;
+}
=======================================
--- /dev/null
+++ /trunk/libs/uuid/test/test_include2.cpp     Sun Feb  7 05:46:29 2010
@@ -0,0 +1,15 @@
+// (C) Copyright Andy Tompkins 2009. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//  libs/uuid/test/test_include2.cpp  -------------------------------//
+
+#include <boost/uuid/uuid.hpp>
+#include <boost/uuid/uuid_io.hpp>
+#include <boost/uuid/uuid_generators.hpp>
+#include <boost/uuid/uuid_serialize.hpp>
=======================================
--- /dev/null
+++ /trunk/libs/uuid/test/test_io.cpp   Sun Feb  7 05:46:29 2010
@@ -0,0 +1,71 @@
+// (C) Copyright Andy Tompkins 2009. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//  libs/uuid/test/test_io.cpp  -------------------------------//
+
+#include <boost/uuid/uuid.hpp>
+#include <boost/uuid/uuid_io.hpp>
+
+#include <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/test_tools.hpp>
+#include <boost/test/output_test_stream.hpp>
+
+#include <boost/lexical_cast.hpp>
+#include <string>
+
+int test_main(int, char*[])
+{
+    using namespace boost::uuids;
+    using boost::test_tools::output_test_stream;
+
+    const uuid u1 = {{0}};
+    const uuid u2 = {{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}};
+ const uuid u3 = {{0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef,0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef}};
+
+    { // test insert/extract operators
+        output_test_stream output;
+        output << u1;
+        BOOST_CHECK(!output.is_empty(false));
+        BOOST_CHECK(output.check_length(36, false));
+ BOOST_CHECK(output.is_equal("00000000-0000-0000-0000-000000000000"));
+
+        output << u2;
+        BOOST_CHECK(!output.is_empty(false));
+        BOOST_CHECK(output.check_length(36, false));
+ BOOST_CHECK(output.is_equal("00010203-0405-0607-0809-0a0b0c0d0e0f"));
+
+        output << u3;
+        BOOST_CHECK(!output.is_empty(false));
+        BOOST_CHECK(output.check_length(36, false));
+ BOOST_CHECK(output.is_equal("12345678-90ab-cdef-1234-567890abcdef"));
+    }
+
+    {
+        uuid u;
+
+        std::stringstream ss;
+        ss << "00000000-0000-0000-0000-000000000000";
+        ss >> u;
+        BOOST_CHECK_EQUAL(u, u1);
+
+        ss << "12345678-90ab-cdef-1234-567890abcdef";
+        ss >> u;
+        BOOST_CHECK_EQUAL(u, u3);
+    }
+
+    { // test with lexical_cast
+ BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(u1), std::string("00000000-0000-0000-0000-000000000000")); + BOOST_CHECK_EQUAL(boost::lexical_cast<uuid>("00000000-0000-0000-0000-000000000000"), u1);
+
+ BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(u3), std::string("12345678-90ab-cdef-1234-567890abcdef")); + BOOST_CHECK_EQUAL(boost::lexical_cast<uuid>("12345678-90ab-cdef-1234-567890abcdef"), u3);
+    }
+
+   return 0;
+}
=======================================
--- /dev/null
+++ /trunk/libs/uuid/test/test_serialization.cpp        Sun Feb  7 05:46:29 2010
@@ -0,0 +1,72 @@
+// (C) Copyright Andy Tompkins 2007. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Purpose to test serializing uuids with narrow archives
+
+#include <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/test_tools.hpp>
+#include <sstream>
+#include <iostream>
+
+#include <boost/uuid/uuid.hpp>
+#include <boost/uuid/uuid_serialize.hpp>
+#include <boost/uuid/uuid_io.hpp>
+
+#include <boost/archive/text_oarchive.hpp>
+#include <boost/archive/text_iarchive.hpp>
+
+#include <boost/archive/xml_oarchive.hpp>
+#include <boost/archive/xml_iarchive.hpp>
+
+#include <boost/archive/binary_oarchive.hpp>
+#include <boost/archive/binary_iarchive.hpp>
+
+template <class OArchiveType, class IArchiveType, class OStringStreamType, class IStringStreamType>
+void test_archive()
+{
+    using namespace std;
+    using namespace boost::uuids;
+
+    OStringStreamType o_stream;
+
+ uuid u1 = {{0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef, 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef}};
+
+    uuid u2;
+
+    // save
+    {
+        OArchiveType oa(o_stream);
+
+        oa << BOOST_SERIALIZATION_NVP(u1);
+    }
+
+    //cout << "stream:" << o_stream.str() << "\n\n";
+
+    // load
+    {
+        IStringStreamType i_stream(o_stream.str());
+        IArchiveType ia(i_stream);
+
+        ia >> BOOST_SERIALIZATION_NVP(u2);
+    }
+
+    BOOST_CHECK_EQUAL(u1, u2);
+}
+
+int test_main( int /* argc */, char* /* argv */[] )
+{
+    using namespace std;
+    using namespace boost::archive;
+
+ test_archive<text_oarchive, text_iarchive, ostringstream, istringstream>(); + test_archive<xml_oarchive, xml_iarchive, ostringstream, istringstream>(); + test_archive<binary_oarchive, binary_iarchive, ostringstream, istringstream>();
+
+    return 0;
+}
=======================================
--- /dev/null
+++ /trunk/libs/uuid/test/test_sha1.cpp Sun Feb  7 05:46:29 2010
@@ -0,0 +1,239 @@
+// (C) Copyright Andy Tompkins 2007. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//  libs/uuid/test/test_sha1.cpp  -------------------------------//
+
+#include <boost/uuid/sha1.hpp>
+#include <algorithm>
+#include <cstring>
+#include <cstddef>
+
+#define BOOST_TEST_MAIN
+#include <boost/test/included/unit_test.hpp>
+
+#define BOOST_AUTO_TEST_MAIN
+#include <boost/test/auto_unit_test.hpp>
+
+#ifdef BOOST_NO_STDC_NAMESPACE
+namespace std {
+  using ::strlen;
+  using ::size_t;
+} //namespace std
+#endif
+
+void test_sha1(char const*const message, unsigned int length, const unsigned int (&correct_digest)[5])
+{
+    boost::uuids::detail::sha1 sha;
+    sha.process_bytes(message, length);
+
+    unsigned int digest[5];
+    sha.get_digest(digest);
+
+ BOOST_CHECK_EQUAL_COLLECTIONS(digest, digest+5, correct_digest, correct_digest+5);
+}
+
+BOOST_AUTO_TEST_CASE(test_quick)
+{
+    struct test_case
+    {
+        char const* message;
+        unsigned int digest[5];
+    };
+    test_case cases[] =
+    { { "",
+        { 0xda39a3ee, 0x5e6b4b0d, 0x3255bfef, 0x95601890, 0xafd80709 } }
+    , { "The quick brown fox jumps over the lazy dog",
+        { 0x2fd4e1c6, 0x7a2d28fc, 0xed849ee1, 0xbb76e739, 0x1b93eb12 } }
+    , { "The quick brown fox jumps over the lazy cog",
+        { 0xde9f2c7f, 0xd25e1b3a, 0xfad3e85a, 0x0bd17d9b, 0x100db4b3 } }
+    };
+
+    for (int i=0; i!=sizeof(cases)/sizeof(cases[0]); ++i) {
+        test_case const& tc = cases[i];
+        test_sha1(tc.message, std::strlen(tc.message), tc.digest);
+    }
+}
+
+//SHA Test Vector for Hashing Byte-Oriented Messages
+//http://csrc.nist.gov/cryptval/shs.htm
+//http://csrc.nist.gov/cryptval/shs/shabytetestvectors.zip
+//values from SHA1ShortMsg.txt
+BOOST_AUTO_TEST_CASE(test_short_messages)
+{
+    struct test_case
+    {
+        char const* message;
+        unsigned int digest[5];
+    };
+    test_case cases[] =
+    { { "",
+         { 0xda39a3ee, 0x5e6b4b0d, 0x3255bfef, 0x95601890, 0xafd80709 } }
+    , { "a8",
+         { 0x99f2aa95, 0xe36f95c2, 0xacb0eaf2, 0x3998f030, 0x638f3f15 } }
+    , { "3000",
+         { 0xf944dcd6, 0x35f9801f, 0x7ac90a40, 0x7fbc4799, 0x64dec024 } }
+    , { "42749e",
+         { 0xa444319e, 0x9b6cc1e8, 0x464c511e, 0xc0969c37, 0xd6bb2619 } }
+    , { "9fc3fe08",
+         { 0x16a0ff84, 0xfcc156fd, 0x5d3ca3a7, 0x44f20a23, 0x2d172253 } }
+    , { "b5c1c6f1af",
+         { 0xfec9deeb, 0xfcdedaf6, 0x6dda525e, 0x1be43597, 0xa73a1f93 } }
+    , { "e47571e5022e",
+         { 0x8ce05118, 0x1f0ed5e9, 0xd0c498f6, 0xbc4caf44, 0x8d20deb5 } }
+    , { "3e1b28839fb758",
+         { 0x67da5383, 0x7d89e03b, 0xf652ef09, 0xc369a341, 0x5937cfd3 } }
+    , { "a81350cbb224cb90",
+         { 0x305e4ff9, 0x888ad855, 0xa78573cd, 0xdf4c5640, 0xcce7e946 } }
+    , { "c243d167923dec3ce1",
+         { 0x5902b77b, 0x3265f023, 0xf9bbc396, 0xba1a93fa, 0x3509bde7 } }
+    , { "50ac18c59d6a37a29bf4",
+         { 0xfcade5f5, 0xd156bf6f, 0x9af97bdf, 0xa9c19bcc, 0xfb4ff6ab } }
+    , { "98e2b611ad3b1cccf634f6",
+         { 0x1d20fbe0, 0x0533c10e, 0x3cbd6b27, 0x088a5de0, 0xc632c4b5 } }
+    , { "73fe9afb68e1e8712e5d4eec",
+         { 0x7e1b7e0f, 0x7a8f3455, 0xa9c03e95, 0x80fd63ae, 0x205a2d93 } }
+    , { "9e701ed7d412a9226a2a130e66",
+         { 0x706f0677, 0x146307b2, 0x0bb0e8d6, 0x311e3299, 0x66884d13 } }
+    , { "6d3ee90413b0a7cbf69e5e6144ca",
+         { 0xa7241a70, 0x3aaf0d53, 0xfe142f86, 0xbf2e8492, 0x51fa8dff } }
+    , { "fae24d56514efcb530fd4802f5e71f",
+         { 0x400f5354, 0x6916d33a, 0xd01a5e6d, 0xf66822df, 0xbdc4e9e6 } }
+    , { "c5a22dd6eda3fe2bdc4ddb3ce6b35fd1",
+         { 0xfac8ab93, 0xc1ae6c16, 0xf0311872, 0xb984f729, 0xdc928ccd } }
+    , { "d98cded2adabf08fda356445c781802d95",
+         { 0xfba6d750, 0xc18da58f, 0x6e2aab10, 0x112b9a5e, 0xf3301b3b } }
+    , { "bcc6d7087a84f00103ccb32e5f5487a751a2",
+         { 0x29d27c2d, 0x44c205c8, 0x107f0351, 0xb05753ac, 0x708226b6 } }
+    , { "36ecacb1055434190dbbc556c48bafcb0feb0d",
+         { 0xb971bfc1, 0xebd6f359, 0xe8d74cb7, 0xecfe7f89, 0x8d0ba845 } }
+    , { "5ff9edb69e8f6bbd498eb4537580b7fba7ad31d0",
+         { 0x96d08c43, 0x0094b9fc, 0xc164ad2f, 0xb6f72d0a, 0x24268f68 } }
+    , { "c95b441d8270822a46a798fae5defcf7b26abace36",
+         { 0xa287ea75, 0x2a593d52, 0x09e28788, 0x1a09c49f, 0xa3f0beb1 } }
+    , { "83104c1d8a55b28f906f1b72cb53f68cbb097b44f860",
+         { 0xa06c7137, 0x79cbd885, 0x19ed4a58, 0x5ac0cb8a, 0x5e9d612b } }
+    , { "755175528d55c39c56493d697b790f099a5ce741f7754b",
+         { 0xbff7d52c, 0x13a36881, 0x32a1d407, 0xb1ab40f5, 0xb5ace298 } }
+    , { "088fc38128bbdb9fd7d65228b3184b3faac6c8715f07272f",
+         { 0xc7566b91, 0xd7b6f56b, 0xdfcaa978, 0x1a7b6841, 0xaacb17e9 } }
+    , { "a4a586eb9245a6c87e3adf1009ac8a49f46c07e14185016895",
+         { 0xffa30c0b, 0x5c550ea4, 0xb1e34f8a, 0x60ec9295, 0xa1e06ac1 } }
+    , { "8e7c555270c006092c2a3189e2a526b873e2e269f0fb28245256",
+         { 0x29e66ed2, 0x3e914351, 0xe872aa76, 0x1df6e4f1, 0xa07f4b81 } }
+    , { "a5f3bfa6bb0ba3b59f6b9cbdef8a558ec565e8aa3121f405e7f2f0",
+         { 0xb28cf5e5, 0xb806a014, 0x91d41f69, 0xbd924876, 0x5c5dc292 } }
+    , { "589054f0d2bd3c2c85b466bfd8ce18e6ec3e0b87d944cd093ba36469",
+         { 0x60224fb7, 0x2c460696, 0x52cd78bc, 0xd08029ef, 0x64da62f3 } }
+    , { "a0abb12083b5bbc78128601bf1cbdbc0fdf4b862b24d899953d8da0ff3",
+         { 0xb72c4a86, 0xf72608f2, 0x4c05f3b9, 0x088ef92f, 0xba431df7 } }
+    , { "82143f4cea6fadbf998e128a8811dc75301cf1db4f079501ea568da68eeb",
+         { 0x73779ad5, 0xd6b71b9b, 0x8328ef72, 0x20ff12eb, 0x167076ac } }
+    , { "9f1231dd6df1ff7bc0b0d4f989d048672683ce35d956d2f57913046267e6f3",
+         { 0xa09671d4, 0x452d7cf5, 0x0015c914, 0xa1e31973, 0xd20cc1a0 } }
+    , { "041c512b5eed791f80d3282f3a28df263bb1df95e1239a7650e5670fc2187919",
+         { 0xe88cdcd2, 0x33d99184, 0xa6fd260b, 0x8fca1b7f, 0x7687aee0 } }
+ , { "17e81f6ae8c2e5579d69dafa6e070e7111461552d314b691e7a3e7a4feb3fae418",
+         { 0x010def22, 0x850deb11, 0x68d525e8, 0xc84c2811, 0x6cb8a269 } }
+ , { "d15976b23a1d712ad28fad04d805f572026b54dd64961fda94d5355a0cc98620cf77",
+         { 0xaeaa40ba, 0x1717ed54, 0x39b1e6ea, 0x901b294b, 0xa500f9ad } }
+ , { "09fce4d434f6bd32a44e04b848ff50ec9f642a8a85b37a264dc73f130f22838443328f",
+         { 0xc6433791, 0x238795e3, 0x4f080a5f, 0x1f1723f0, 0x65463ca0 } }
+ , { "f17af27d776ec82a257d8d46d2b46b639462c56984cc1be9c1222eadb8b26594a25c709d",
+         { 0xe21e22b8, 0x9c1bb944, 0xa32932e6, 0xb2a2f20d, 0x491982c3 } }
+ , { "b13ce635d6f8758143ffb114f2f601cb20b6276951416a2f94fbf4ad081779d79f4f195b22",
+         { 0x575323a9, 0x661f5d28, 0x387964d2, 0xba6ab92c, 0x17d05a8a } }
+ , { "5498793f60916ff1c918dde572cdea76da8629ba4ead6d065de3dfb48de94d234cc1c5002910",
+         { 0xfeb44494, 0xaf72f245, 0xbfe68e86, 0xc4d7986d, 0x57c11db7 } }
+ , { "498a1e0b39fa49582ae688cd715c86fbaf8a81b8b11b4d1594c49c902d197c8ba8a621fd6e3be5",
+         { 0xcff2290b, 0x3648ba28, 0x31b98dde, 0x436a72f9, 0xebf51eee } }
+ , { "3a36ae71521f9af628b3e34dcb0d4513f84c78ee49f10416a98857150b8b15cb5c83afb4b570376e",
+         { 0x9b4efe9d, 0x27b96590, 0x5b0c3dab, 0x67b8d7c9, 0xebacd56c } }
+ , { "dcc76b40ae0ea3ba253e92ac50fcde791662c5b6c948538cffc2d95e9de99cac34dfca38910db2678f",
+         { 0xafedb0ff, 0x156205bc, 0xd831cbdb, 0xda43db8b, 0x0588c113 } }
+ , { "5b5ec6ec4fd3ad9c4906f65c747fd4233c11a1736b6b228b92e90cddabb0c7c2fcf9716d3fad261dff33",
+         { 0x8deb1e85, 0x8f88293a, 0x5e5e4d52, 0x1a34b2a4, 0xefa70fc4 } }
+ , { "df48a37b29b1d6de4e94717d60cdb4293fcf170bba388bddf7a9035a15d433f20fd697c3e4c8b8c5f590ab",
+         { 0x95cbdac0, 0xf74afa69, 0xcebd0e5c, 0x7defbc6f, 0xaf0cbeaf } }
+ , { "1f179b3b82250a65e1b0aee949e218e2f45c7a8dbfd6ba08de05c55acfc226b48c68d7f7057e5675cd96fcfc",
+         { 0xf0307bcb, 0x92842e5a, 0xe0cd4f4f, 0x14f3df7f, 0x877fbef2 } }
+ , { "ee3d72da3a44d971578972a8e6780ce64941267e0f7d0179b214fa97855e1790e888e09fbe3a70412176cb3b54",
+         { 0x7b13bb0d, 0xbf14964b, 0xd63b133a, 0xc85e2210, 0x0542ef55 } }
+ , { "d4d4c7843d312b30f610b3682254c8be96d5f6684503f8fbfbcd15774fc1b084d3741afb8d24aaa8ab9c104f7258",
+         { 0xc314d2b6, 0xcf439be6, 0x78d2a74e, 0x890d96cf, 0xac1c02ed } }
+ , { "32c094944f5936a190a0877fb9178a7bf60ceae36fd530671c5b38c5dbd5e6a6c0d615c2ac8ad04b213cc589541cf6",
+         { 0x4d0be361, 0xe410b47a, 0x9d67d8ce, 0x0bb6a8e0, 0x1c53c078 } }
+ , { "e5d3180c14bf27a5409fa12b104a8fd7e9639609bfde6ee82bbf9648be2546d29688a65e2e3f3da47a45ac14343c9c02",
+         { 0xe5353431, 0xffae097f, 0x675cbf49, 0x8869f6fb, 0xb6e1c9f2 } }
+ , { "e7b6e4b69f724327e41e1188a37f4fe38b1dba19cbf5a7311d6e32f1038e97ab506ee05aebebc1eed09fc0e357109818b9",
+         { 0xb8720a70, 0x68a085c0, 0x18ab1896, 0x1de2765a, 0xa6cd9ac4 } }
+ , { "bc880cb83b8ac68ef2fedc2da95e7677ce2aa18b0e2d8b322701f67af7d5e7a0d96e9e33326ccb7747cfff0852b961bfd475",
+         { 0xb0732181, 0x568543ba, 0x85f2b6da, 0x602b4b06, 0x5d9931aa } }
+ , { "235ea9c2ba7af25400f2e98a47a291b0bccdaad63faa2475721fda5510cc7dad814bce8dabb611790a6abe56030b798b75c944",
+         { 0x9c22674c, 0xf3222c3b, 0xa9216726, 0x94aafee4, 0xce67b96b } }
+ , { "07e3e29fed63104b8410f323b975fd9fba53f636af8c4e68a53fb202ca35dd9ee07cb169ec5186292e44c27e5696a967f5e67709",
+         { 0xd128335f, 0x4cecca90, 0x66cdae08, 0x958ce656, 0xff0b4cfc } }
+ , { "65d2a1dd60a517eb27bfbf530cf6a5458f9d5f4730058bd9814379547f34241822bf67e6335a6d8b5ed06abf8841884c636a25733f",
+         { 0x0b67c57a, 0xc578de88, 0xa2ae055c, 0xaeaec8bb, 0x9b0085a0 } }
+ , { "dcc86b3bd461615bab739d8daafac231c0f462e819ad29f9f14058f3ab5b75941d4241ea2f17ebb8a458831b37a9b16dead4a76a9b0e",
+         { 0xc766f912, 0xa89d4ccd, 0xa88e0cce, 0x6a713ef5, 0xf178b596 } }
+ , { "4627d54f0568dc126b62a8c35fb46a9ac5024400f2995e51635636e1afc4373dbb848eb32df23914230560b82477e9c3572647a7f2bb92",
+         { 0x9aa3925a, 0x9dcb177b, 0x15ccff9b, 0x78e70cf3, 0x44858779 } }
+ , { "ba531affd4381168ef24d8b275a84d9254c7f5cc55fded53aa8024b2c5c5c8aa7146fe1d1b83d62b70467e9a2e2cb67b3361830adbab28d7",
+         { 0x4811fa30, 0x042fc076, 0xacf37c8e, 0x2274d025, 0x307e5943 } }
+ , { "8764dcbcf89dcf4282eb644e3d568bdccb4b13508bfa7bfe0ffc05efd1390be22109969262992d377691eb4f77f3d59ea8466a74abf57b2ef4",
+         { 0x67430184, 0x50c97307, 0x61ee2b13, 0x0df9b91c, 0x1e118150 } }
+ , { "497d9df9ddb554f3d17870b1a31986c1be277bc44feff713544217a9f579623d18b5ffae306c25a45521d2759a72c0459b58957255ab592f3be4",
+         { 0x71ad4a19, 0xd37d92a5, 0xe6ef3694, 0xddbeb5aa, 0x61ada645 } }
+ , { "72c3c2e065aefa8d9f7a65229e818176eef05da83f835107ba90ec2e95472e73e538f783b416c04654ba8909f26a12db6e5c4e376b7615e4a25819",
+         { 0xa7d9dc68, 0xdacefb7d, 0x61161860, 0x48cb355c, 0xc548e11d } }
+ , { "7cc9894454d0055ab5069a33984e2f712bef7e3124960d33559f5f3b81906bb66fe64da13c153ca7f5cabc89667314c32c01036d12ecaf5f9a78de98",
+         { 0x142e429f, 0x0522ba5a, 0xbf5131fa, 0x81df82d3, 0x55b96909 } }
+ , { "74e8404d5a453c5f4d306f2cfa338ca65501c840ddab3fb82117933483afd6913c56aaf8a0a0a6b2a342fc3d9dc7599f4a850dfa15d06c61966d74ea59",
+         { 0xef72db70, 0xdcbcab99, 0x1e963797, 0x6c6faf00, 0xd22caae9 } }
+ , { "46fe5ed326c8fe376fcc92dc9e2714e2240d3253b105adfbb256ff7a19bc40975c604ad7c0071c4fd78a7cb64786e1bece548fa4833c04065fe593f6fb10",
+         { 0xf220a745, 0x7f4588d6, 0x39dc2140, 0x7c942e98, 0x43f8e26b } }
+ , { "836dfa2524d621cf07c3d2908835de859e549d35030433c796b81272fd8bc0348e8ddbc7705a5ad1fdf2155b6bc48884ac0cd376925f069a37849c089c8645",
+         { 0xddd2117b, 0x6e309c23, 0x3ede85f9, 0x62a0c2fc, 0x215e5c69 } }
+ , { "7e3a4c325cb9c52b88387f93d01ae86d42098f5efa7f9457388b5e74b6d28b2438d42d8b64703324d4aa25ab6aad153ae30cd2b2af4d5e5c00a8a2d0220c6116",
+         { 0xa3054427, 0xcdb13f16, 0x4a610b34, 0x8702724c, 0x808a0dcc } }
+    };
+
+    char const xdigits[17] = "0123456789abcdef";
+    char const*const xdigits_end = xdigits+16;
+
+    for (std::size_t i=0; i!=sizeof(cases)/sizeof(cases[0]); ++i) {
+        test_case const& tc = cases[i];
+
+        boost::uuids::detail::sha1 sha;
+        std::size_t message_length = std::strlen(tc.message);
+        BOOST_CHECK_EQUAL(message_length%2, 0u);
+
+        for (std::size_t b=0; b!=message_length; b+=2) {
+            char c = tc.message[b];
+            char const* f = std::find(xdigits, xdigits_end, c);
+            BOOST_CHECK(f != xdigits_end);
+
+ unsigned char byte = static_cast<unsigned char>(std::distance(&xdigits[0], f));
+
+            c = tc.message[b+1];
+            f = std::find(xdigits, xdigits_end, c);
+            BOOST_CHECK(f != xdigits_end);
+
+            byte <<= 4;
+ byte |= static_cast<unsigned char>(std::distance(&xdigits[0], f));
+
+            sha.process_byte(byte);
+        }
+
+        unsigned int digest[5];
+        sha.get_digest(digest);
+
+ BOOST_CHECK_EQUAL_COLLECTIONS(digest, digest+5, tc.digest, tc.digest+5);
+    }
+}
=======================================
--- /dev/null
+++ /trunk/libs/uuid/test/test_tagging.cpp      Sun Feb  7 05:46:29 2010
@@ -0,0 +1,81 @@
+// (C) Copyright Andy Tompkins 2009. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//  libs/uuid/test/test_tagging.cpp  -------------------------------//
+
+#include <boost/uuid/uuid.hpp>
+#include <boost/uuid/uuid_generators.hpp>
+
+#include <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/test_tools.hpp>
+
+class object
+{
+public:
+    object()
+        : tag(boost::uuids::random_generator()())
+        , state(0)
+    {}
+
+    explicit object(int state)
+        : tag(boost::uuids::random_generator()())
+        , state(state)
+    {}
+
+    object(object const& rhs)
+        : tag(rhs.tag)
+        , state(rhs.state)
+    {}
+
+    bool operator==(object const& rhs) const {
+        return tag == rhs.tag;
+    }
+
+    object& operator=(object const& rhs) {
+        tag = rhs.tag;
+        state = rhs.state;
+        return *this;
+    }
+
+    int get_state() const { return state; }
+    void set_state(int new_state) { state = new_state; }
+
+private:
+    boost::uuids::uuid tag;
+
+    int state;
+};
+
+template <typename elem, typename traits>
+std::basic_ostream<elem, traits>& operator<<(std::basic_ostream<elem, traits>& os, object const& o)
+{
+    os << o.get_state();
+    return os;
+}
+
+int test_main(int, char*[])
+{
+    //using boost::test_tools::output_test_stream;
+
+    object o1(1);
+
+    object o2 = o1;
+    BOOST_CHECK_EQUAL(o1, o2);
+
+    o2.set_state(2);
+    BOOST_CHECK_EQUAL(o1, o2);
+
+    object o3;
+    o3.set_state(3);
+
+    BOOST_CHECK_NE(o1, o3);
+    BOOST_CHECK_NE(o2, o3);
+
+    return 0;
+}
=======================================
--- /dev/null
+++ /trunk/libs/uuid/test/test_uuid.cpp Sun Feb  7 05:46:29 2010
@@ -0,0 +1,178 @@
+// (C) Copyright Andy Tompkins 2007. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//  libs/uuid/test/test_uuid.cpp  -------------------------------//
+
+#include <boost/uuid/uuid.hpp>
+
+#include <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/test_tools.hpp>
+
+#include <boost/functional/hash.hpp>
+
+#include <boost/uuid/uuid_io.hpp>
+
+int test_main(int, char*[])
+{
+    using namespace boost::uuids;
+    using boost::test_tools::output_test_stream;
+
+    // uuid::static_size
+    BOOST_CHECK_EQUAL(uuid::static_size(), 16U);
+
+    { // uuid::operator=()
+        uuid u1 = {{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}};
+        uuid u2 = u1;
+        BOOST_CHECK_EQUAL(u2, u1);
+    }
+
+    { // uuid::begin(), end()
+        uuid u = {{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}};
+        unsigned char values[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ BOOST_CHECK_EQUAL_COLLECTIONS(u.begin(), u.end(), values, values+16);
+    }
+
+    { // uuid::begin() const, end() const
+        const uuid u = {{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}};
+        unsigned char values[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ BOOST_CHECK_EQUAL_COLLECTIONS(u.begin(), u.end(), values, values+16);
+    }
+
+     { // uuid::size()
+        uuid u; // uninitialized
+        BOOST_CHECK_EQUAL(u.size(), 16U);
+    }
+
+    { // uuid::is_nil()
+        uuid u1 = {{0}};
+        BOOST_CHECK_EQUAL(u1.is_nil(), true);
+
+        uuid u2 = {{1,0}};
+        BOOST_CHECK_EQUAL(u2.is_nil(), false);
+    }
+
+    { // uuid::variant()
+        struct Test {
+            unsigned char octet7;
+            boost::uuids::uuid::variant_type variant;
+        };
+        const Test tests[] =
+            { { 0x00, boost::uuids::uuid::variant_ncs }
+            , { 0x10, boost::uuids::uuid::variant_ncs }
+            , { 0x20, boost::uuids::uuid::variant_ncs }
+            , { 0x30, boost::uuids::uuid::variant_ncs }
+            , { 0x40, boost::uuids::uuid::variant_ncs }
+            , { 0x50, boost::uuids::uuid::variant_ncs }
+            , { 0x60, boost::uuids::uuid::variant_ncs }
+            , { 0x70, boost::uuids::uuid::variant_ncs }
+            , { 0x80, boost::uuids::uuid::variant_rfc_4122 }
+            , { 0x90, boost::uuids::uuid::variant_rfc_4122 }
+            , { 0xa0, boost::uuids::uuid::variant_rfc_4122 }
+            , { 0xb0, boost::uuids::uuid::variant_rfc_4122 }
+            , { 0xc0, boost::uuids::uuid::variant_microsoft }
+            , { 0xd0, boost::uuids::uuid::variant_microsoft }
+            , { 0xe0, boost::uuids::uuid::variant_future }
+            , { 0xf0, boost::uuids::uuid::variant_future }
+            };
+        for (size_t i=0; i<sizeof(tests)/sizeof(Test); i++) {
+            uuid u = {};
+ u.data[8] = tests[i].octet7; // note that octet7 is array index 8
+
+            BOOST_CHECK_EQUAL(u.variant(), tests[i].variant);
+        }
+    }
+
+     { // uuid::version()
+        struct Test {
+            unsigned char octet9;
+            boost::uuids::uuid::version_type version;
+        };
+        const Test tests[] =
+            { { 0x00, boost::uuids::uuid::version_unknown }
+            , { 0x10, boost::uuids::uuid::version_time_based }
+            , { 0x20, boost::uuids::uuid::version_dce_security }
+            , { 0x30, boost::uuids::uuid::version_name_based_md5 }
+            , { 0x40, boost::uuids::uuid::version_random_number_based }
+            , { 0x50, boost::uuids::uuid::version_name_based_sha1 }
+            , { 0x60, boost::uuids::uuid::version_unknown }
+            , { 0x70, boost::uuids::uuid::version_unknown }
+            , { 0x80, boost::uuids::uuid::version_unknown }
+            , { 0x90, boost::uuids::uuid::version_unknown }
+            , { 0xa0, boost::uuids::uuid::version_unknown }
+            , { 0xb0, boost::uuids::uuid::version_unknown }
+            , { 0xc0, boost::uuids::uuid::version_unknown }
+            , { 0xd0, boost::uuids::uuid::version_unknown }
+            , { 0xe0, boost::uuids::uuid::version_unknown }
+            , { 0xf0, boost::uuids::uuid::version_unknown }
+            };
+        for (size_t i=0; i<sizeof(tests)/sizeof(Test); i++) {
+            uuid u = {{0}};
+ u.data[6] = tests[i].octet9; // note that octet9 is array index 8
+
+            BOOST_CHECK_EQUAL(u.version(), tests[i].version);
+        }
+    }
+
+    { // uuid::swap(), swap()
+        uuid u1 = {{0}};
+        uuid u2 = {{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}};
+        u1.swap(u2);
+
+        unsigned char values1[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+        unsigned char values2[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ BOOST_CHECK_EQUAL_COLLECTIONS(u1.begin(), u1.end(), values2, values2+16); + BOOST_CHECK_EQUAL_COLLECTIONS(u2.begin(), u2.end(), values1, values1+16);
+
+        swap(u1, u2);
+ BOOST_CHECK_EQUAL_COLLECTIONS(u1.begin(), u1.end(), values1, values1+16); + BOOST_CHECK_EQUAL_COLLECTIONS(u2.begin(), u2.end(), values2, values2+16);
+    }
+
+    { // test comparsion
+        uuid u1 = {{0}};
+        uuid u2 = {{1,0}};
+ uuid u3 = {{255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255}};
+
+        BOOST_CHECK_EQUAL(u1, u1);
+
+        BOOST_CHECK_NE(u1, u2);
+
+        BOOST_CHECK_LT(u1, u2);
+        BOOST_CHECK_LT(u2, u3);
+
+        BOOST_CHECK_LE(u1, u1);
+        BOOST_CHECK_LE(u1, u2);
+        BOOST_CHECK_LE(u2, u3);
+
+        BOOST_CHECK_GT(u2, u1);
+        BOOST_CHECK_GT(u3, u1);
+
+        BOOST_CHECK_GE(u3, u3);
+        BOOST_CHECK_GE(u2, u1);
+        BOOST_CHECK_GE(u3, u1);
+    }
+
+    { // test hash
+        uuid u1 = {{0}};
+        uuid u2 = {{1,0}};
+ uuid u3 = {{255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255}};
+
+        boost::hash<uuid> uuid_hasher;
+
+ BOOST_CHECK_EQUAL(uuid_hasher(u1), boost::hash_range(u1.begin(), u1.end())); + BOOST_CHECK_EQUAL(uuid_hasher(u2), boost::hash_range(u2.begin(), u2.end())); + BOOST_CHECK_EQUAL(uuid_hasher(u3), boost::hash_range(u3.begin(), u3.end()));
+    }
+
+    { // test is_pod
+        BOOST_CHECK_EQUAL(boost::is_pod<uuid>::value, true);
+    }
+
+    return 0;
+}
=======================================
--- /dev/null
+++ /trunk/libs/uuid/test/test_uuid_class.cpp   Sun Feb  7 05:46:29 2010
@@ -0,0 +1,43 @@
+// (C) Copyright Andy Tompkins 2009. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//  libs/uuid/test/test_uuid_class.cpp  -------------------------------//
+
+#include <boost/uuid/uuid.hpp>
+#include <boost/uuid/uuid_generators.hpp>
+#include <boost/uuid/uuid_io.hpp>
+
+#include <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/test_tools.hpp>
+
+class uuid_class : public boost::uuids::uuid
+{
+public:
+    uuid_class()
+        : boost::uuids::uuid(boost::uuids::random_generator()())
+    {}
+
+    explicit uuid_class(boost::uuids::uuid const& u)
+        : boost::uuids::uuid(u)
+    {}
+};
+
+int test_main(int, char*[])
+{
+    uuid_class u1;
+    uuid_class u2;
+    BOOST_CHECK_NE(u1, u2);
+    BOOST_CHECK_EQUAL(u1.is_nil(), false);
+    BOOST_CHECK_EQUAL(u2.is_nil(), false);
+
+    u2 = u1;
+    BOOST_CHECK_EQUAL(u1, u2);
+
+    return 0;
+}
=======================================
--- /dev/null
+++ /trunk/libs/uuid/test/test_wserialization.cpp       Sun Feb  7 05:46:29 2010
@@ -0,0 +1,72 @@
+// (C) Copyright Andy Tompkins 2008. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Purpose to test serializing uuids with wide stream archives
+
+#include <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/test_tools.hpp>
+#include <sstream>
+#include <iostream>
+
+#include <boost/uuid/uuid.hpp>
+#include <boost/uuid/uuid_serialize.hpp>
+#include <boost/uuid/uuid_io.hpp>
+
+#include <boost/archive/text_woarchive.hpp>
+#include <boost/archive/text_wiarchive.hpp>
+
+#include <boost/archive/xml_woarchive.hpp>
+#include <boost/archive/xml_wiarchive.hpp>
+
+#include <boost/archive/binary_woarchive.hpp>
+#include <boost/archive/binary_wiarchive.hpp>
+
+template <class OArchiveType, class IArchiveType, class OStringStreamType, class IStringStreamType>
+void test_archive()
+{
+    using namespace std;
+    using namespace boost::uuids;
+
+    OStringStreamType o_stream;
+
+ uuid u1 = {{0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef, 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef}};
+
+    uuid u2;
+
+    // save
+    {
+        OArchiveType oa(o_stream);
+
+        oa << BOOST_SERIALIZATION_NVP(u1);
+    }
+
+    //wcout << "stream:" << o_stream.str() << "\n\n";
+
+    // load
+    {
+        IStringStreamType i_stream(o_stream.str());
+        IArchiveType ia(i_stream);
+
+        ia >> BOOST_SERIALIZATION_NVP(u2);
+    }
+
+    BOOST_CHECK_EQUAL(u1, u2);
+}
+
+int test_main( int /* argc */, char* /* argv */[] )
+{
+    using namespace std;
+    using namespace boost::archive;
+
+ test_archive<text_woarchive, text_wiarchive, wostringstream, wistringstream>(); + test_archive<xml_woarchive, xml_wiarchive, wostringstream, wistringstream>(); + test_archive<binary_woarchive, binary_wiarchive, wostringstream, wistringstream>();
+
+    return 0;
+}
=======================================
--- /dev/null
+++ /trunk/libs/uuid/uuid.html  Sun Feb  7 05:46:29 2010
@@ -0,0 +1,561 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>Uuid Library</title>
+<style type="text/css">
+    pre { margin: 1em; padding: 1em; border: 1px solid #ddd; }
+</style>
+</head>
+<body>
+<h1><img src="../../boost.png" alt="Boost" WIDTH="277" HEIGHT="86">Uuid</h1>
+
+<h2><a name="Contents"></a>Contents</h2>
+
+<ol>
+    <li><a href="#Introduction">Introduction</a></li>
+    <li><a href="#Examples">Examples</a></li>
+    <ul>
+        <li><a href="#Tagging">Tagging</a></li>
+        <li><a href="#POD Efficiencies">POD Efficiencies</a></li>
+        <li><a href="#Byte Extraction">Byte Extraction</a></li>
+    </ul
+    <li><a href="#Reference">Reference</a></li>
+    <ul>
+        <li><a href="#boost/uuid/uuid.hpp">boost/uuid/uuid.hpp</a></li>
+        <ul>
+            <li><a href="#Synopsis">Synopsis</a></li>
+            <li><a href="#Size">Size</a></li>
+            <li><a href="#Iteration">Iteration</a></li>
+            <li><a href="#Nil">Nil uuid</a></li>
+            <li><a href="#Variant">Variant</a></li>
+            <li><a href="#Version">Version</a></li>
+            <li><a href="#Swap">Swap</a></li>
+            <li><a href="#Operators">Operators</a></li>
+            <li><a href="#Hash">Hash</a></li>
+        </ul>
+ <li><a href="#boost/uuid/uuid_generators.hpp">boost/uuid/uuid_generators.hpp</a></li>
+        <ul>
+            <li><a href="#Synopsis_generators">Synopsis</a></li>
+            <li><a href="#Nil Generator">Nil Generator</a></li>
+            <li><a href="#String Generator">String Generator</a></li>
+            <li><a href="#Name Generator">Name Generator</a></li>
+            <li><a href="#Random Generator">Random Generator</a></li>
+        </ul>
+ <li><a href="#boost/uuid/uuid_io.hpp">boost/uuid/uuid_io.hpp</a></li>
+        <ul>
+            <li><a href="#Synopsis_io">Synopsis</a></li>
+            <li><a href="#Input and Output">Input and Output</a></li>
+        </ul>
+ <li><a href="#boost/uuid/uuid_serialize.hpp">boost/uuid/uuid_serialize.hpp</a></li>
+        <ul>
+            <li><a href="#Synopsis_serialize">Synopsis</a></li>
+            <li><a href="#Serialization">Serialization</a></li>
+        </ul>
+    </ul>
+    <li><a href="#Design notes">Design notes</a></li>
+ <li><a href="#History and Acknowledgements">History and Acknowledgements</a></li>
+</ol>
+
+<h2><a name="Introduction"></a>Introduction</h2>
+<p>
+A UUID, or Universally unique identifier, is intended to uniquely identify
+information in a distributed environment without significant central
+coordination.  It can be used to tag objects with very short lifetimes, or
+to reliably identify very persistent objects across a network.
+<p>
+UUIDs have many applications. Some examples follow: Databases may use UUIDs
+to identify rows or records in order to ensure that they are unique across
+different databases, or for publication/subscription services. Network messages +may be identified with a UUID to ensure that different parts of a message are put +back together again. Distributed computing may use UUIDs to identify a remote
+procedure call.  Transactions and classes involved in serialization may be
+identified by UUIDs. Microsoft's component object model (COM) uses UUIDs to +distinguish different software component interfaces. UUIDs are inserted into
+documents from Microsoft Office programs.  UUIDs identify audio or
+video streams in the Advanced Systems Format (ASF).  UUIDs are also a basis
+for OIDs (object identifiers), and URNs (uniform resource name).
+
+<p>
+An attractive feature of UUIDs when compared to alternatives is their relative +small size, of 128-bits, or 16-bytes. Another is that the creation of UUIDs
+does not require a centralized authority.
+
+<p>When UUIDs are generated by one of the defined
+mechanisms, they are either guaranteed to be unique, different from all other
+generated UUIDs (that is, it has never been generated before and it will
+never be generated again), or it is extremely likely to be unique (depending
+on the mechanism).
+
+<h2><a name="Examples"></a>Examples</h2>
+<h3><a name="Tagging"></a>Tagging</h3>
+<pre>
+// example of tagging an object with a uuid
+// see <a href="./test/test_tagging.cpp"><tt>boost/libs/uuid/test/test_tagging.cpp</tt></a>
+
+#include &lt;<a href="./../../boost/uuid/uuid.hpp"><tt>boost/uuid/uuid.hpp</tt></a>&gt; +#include &lt;<a href="./../../boost/uuid/uuid_generators.hpp"><tt>boost/uuid/uuid_generators.hpp</tt></a>&gt;
+
+class object
+{
+public:
+    object()
+        : tag(boost::uuids::random_generator()())
+        , state(0)
+    {}
+
+    explicit object(int state)
+        : tag(boost::uuids::random_generator()())
+        , state(state)
+    {}
+
+    object(object const&amp; rhs)
+        : tag(rhs.tag)
+        , state(rhs.state)
+    {}
+
+    bool operator==(object const&amp; rhs) const {
+        return tag == rhs.tag;
+    }
+
+    object&amp; operator=(object const&amp; rhs) {
+        tag = rhs.tag;
+        state = rhs.state;
+    }
+
+    int get_state() const { return state; }
+    void set_state(int new_state) { state = new_state; }
+
+private:
+    boost::uuids::uuid tag;
+
+    int state;
+};
+
+object o1(1);
+object o2 = o1;
+o2.set_state(2);
+assert(o1 == o2);
+
+object o3(3);
+assert(o1 != o3);
+assert(o2 != o3);
+</pre>
+
+<h3><a name="POD Efficiencies"></a>POD Efficiencies</h3>
+<p>
+This library implements a UUID as a POD allowing a UUID
+to be used in the most efficient ways, including using memcpy,
+and aggregate initializers.  A drawback is that a POD can
+not have any constructors, and thus declaring a UUID will not
+initialize it to a value generated by one of the defined
+mechanisms.  But a class based on a UUID can be defined
+that does initialize itself to a value generated by one of
+the defined mechanisms.
+<pre>
+// example using memcpy and aggregate initializers
+// example of a class uuid see <a href="./test/test_uuid_class.cpp"><tt>boost/libs/uuid/test/test_uuid_class.cpp</tt></a>
+
+#include &lt;<a href="./../../boost/uuid/uuid.hpp"><tt>boost/uuid/uuid.hpp</tt></a>&gt; +#include &lt;<a href="./../../boost/uuid/uuid_generators.hpp"><tt>boost/uuid/uuid_generators.hpp</tt></a>&gt;
+
+{ // example using memcpy
+    unsigned char uuid_data[16];
+    // fill uuid_data
+
+    boost::uuids::uuid u;
+
+    memcpy(&amp;u, uuid_data, 16);
+}
+
+{ // example using aggregate initializers
+    boost::uuids::uuid u =
+    { 0x12 ,0x34, 0x56, 0x78
+    , 0x90, 0xab
+    , 0xcd, 0xef
+    , 0x12, 0x34
+    , 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef
+    };
+}
+
+// example of creating a uuid class that
+// initializes the uuid in the constructor
+// using a defined mechanism
+
+class uuid_class : public boost::uuids::uuid
+{
+public:
+    uuid_class()
+        : boost::uuids::uuid(boost::uuids::random_generator()())
+    {}
+
+    explicit uuid_class(boost::uuids::uuid const&amp; u)
+        : boost::uuids::uuid(u)
+    {}
+
+    operator boost::uuids::uuid() {
+        return static_cast&lt;boost::uuids::uuid&amp;&gt;(*this);
+    }
+
+    operator boost::uuids::uuid() const {
+        return static_cast&lt;boost::uuids::uuid const&amp;&gt;(*this);
+    }
+};
+
+uuid_class u1;
+uuid_class u2;
+
+assert(u1 != u2);
+</pre>
+
+<h3><a name="Byte Extraction"></a>Byte Extraction</h3>
+<p>It is sometimes useful to get at the 16 bytes of a <b>uuid</b> directly.
+Typical use is as follows:
+
+<pre>
+boost::uuids::uuid u;
+std::vector&lt;char&gt; v(u.size());
+std::copy(u.begin(), u.end(), v.begin());
+</pre>
+
+<p>Note: <tt>boost::uuids::uuid::size()</tt> always returns 16.
+
+<h2><a name="Reference"></a>Reference</h2>
+<h3><a name="boost/uuid/uuid.hpp"</a>boost/uuid/uuid.hpp</h3>
+<h4><a name="Synopsis"</a>Synopsis</h4>
+<pre>
+#include &lt;<a href="./../../boost/uuid/uuid.hpp"><tt>boost/uuid/uuid.hpp</tt></a>&gt;
+
+namespace boost {
+namespace uuids {
+
+class uuid {
+public:
+    typedef uint8_t value_type;
+    typedef uint8_t&amp; reference;
+    typedef uint8_t const&amp; const_reference;
+    typedef uint8_t* iterator;
+    typedef uint8_t const* const_iterator;
+    typedef std::size_t size_type;
+    typedef std::ptrdiff_t difference_type;
+
+    static size_type static_size();
+
+    // iteration
+    iterator begin();
+    iterator end();
+    const_iterator begin() const;
+    const_iterator end() const;
+
+    size_type size() const;
+
+    bool is_nil() const;
+
+    enum variant_type {
+        variant_ncs, // NCS backward compatibility
+        variant_rfc_4122, // defined in RFC 4122 document
+        variant_microsoft, // Microsoft Corporation backward compatibility
+        variant_future // future definition
+    };
+    variant_type variant() const;
+
+    enum version_type {
+        version_unknown = -1,
+        version_time_based = 1,
+        version_dce_security = 2,
+        version_name_based_md5 = 3,
+        version_random_number_based = 4,
+        version_name_based_sha1 = 5
+    };
+    version_type version() const;
+
+    // Swap function
+    void swap(uuid&amp; rhs);
+
+    uint8_t data[static_size()];
+};
+
+// standard operators
+bool operator==(uuid const&amp; lhs, uuid const&amp; rhs);
+bool operator!=(uuid const&amp; lhs, uuid const&amp; rhs);
+bool operator&lt;(uuid const&amp; lhs, uuid const&amp; rhs);
+bool operator&gt;(uuid const&amp; lhs, uuid const&amp; rhs);
+bool operator&lt;=(uuid const&amp; lhs, uuid const&amp; rhs);
+bool operator&gt;=(uuid const&amp; lhs, uuid const&amp; rhs);
+
+void swap(uuid&amp; lhs, uuid&amp; rhs);
+
+std::size_t hash_value(uuid const&amp; u);
+
+}} // namespace boost::uuids
+</pre>
+
+<h4><a name="Size"</a>Size</h4>
+
+<p>The size of a <b>uuid</b> (in bytes) can be obtained either by
+calling the function <tt>boost::uuids::uuid::size()</tt> or by
+calling the static function <tt>boost::uuids::uuid::static_size()</tt>,
+both always return 16.
+<pre>
+    boost::uuids::uuid u;
+    assert(16 == u.size());
+    assert(16 == boost::uuids::uuid::static_size());
+</pre>
+
+<h4><a name="Iteration"</a>Iteration</h4>
+
+<p>Both iterators and constant iterators are provided.
+<pre>
+    boost::uuids::uuid u;
+ for (boost::uuids::uuid::const_iterator it=u.begin(); it!=u.end(); ++it) {
+        boost::uuids::uuid::value_type v = *it;
+    }
+    for (boost::uuids::uuid::iterator it=u.begin(); it!=u.end(); ++it) {
+        *it = 0;
+    }
+</pre>
+
+<h4><a name="Nil"></a>Nil uuid</h4>
+<p>The function, <tt>boost::uuids::uuid::is_null()</tt> returns true if and
+only if the <b>uuid</b> is equal to {00000000-0000-0000-0000-000000000000}.
+</p>
+
+<h4><a name="Variant"></a>Variant</h4>
+<p>Three bits of a <b>uuid</b> determine the variant.</p>
+<pre>
+    boost::uuids::uuid u;
+    boost::uuids::uuid::variant_type v = u.variant();
+</pre>
+
+<h4><a name="Version"></a>Version</h4>
+<p>Four bits of a <b>uuid</b> determine the variant, that is the mechanism
+used to generate the <b>uuid</b>.
+</p>
+<pre>
+    boost::uuids::uuid u;
+    boost::uuids::uuid::version_type v = u.version();
+</pre>
+
+<h4><a name="Swap"></a>Swap</h4>
+<p>Both <tt>boost::uuids::uuid::swap()</tt> and <tt>boost::uuids::swap()</tt>
+are provided.
+</p>
+<pre>
+    boost::uuids::uuid u1, u2;
+    u1.swap(u2);
+    swap(u1, u2);
+</pre>
+
+<h4><a name="Operators"></a>Operators</h4>
+<p>
+All of the standard numeric operators are defined for the <b>uuid</b>
+class. These include:
+<pre>
+    operator==
+    operator!=
+    operator&lt;
+    operator&gt;
+    operator&lt;=
+    operator&gt;=
+</pre>
+
+<h4><a name="Hash"></a>Hash Function</h4>
+<p>
+This function allows <b>uuid</b>s to be used with
+<a href="http://www.boost.org/doc/html/hash.html";><b>boost::hash</b></a>
+
+<pre>
+boost::hash&lt;boost::uuids::uuid&gt; uuid_hasher;
+std::size_t uuid_hash_value = uuid_hasher(boost::uuids::uuid());
+</pre>
+
+<h3><a name="boost/uuid/uuid_generators.hpp"</a>boost/uuid/uuid_generators.hpp</h3>
+<h4><a name="Synopsis_generators"</a>Synopsis</h4>
+<pre>
+#include &lt;<a href="./../../boost/uuid/uuid_generators.hpp"><tt>boost/uuid/uuid_generators.hpp</tt></a>&gt;
+
+namespace boost {
+namespace uuids {
+
+struct nil_generator {
+    typedef uuid result_type;
+
+    uuid operator()() const;
+};
+uuid nil_uuid();
+
+struct string_generator {
+    typedef uuid result_type;
+
+    template &lt;typename ch, typename char_traits, typename alloc&gt;
+ uuid operator()(std::basic_string&lt;ch, char_traits, alloc&gt; const&amp; s) const;
+};
+
+class name_generator {
+public:
+    typedef uuid result_type;
+
+    explicit name_generator(uuid const&amp; namespace_uuid);
+
+    uuid operator()(const char* name) const;
+    uuid operator()(const wchar_t* name) const;
+    tempate &lt;typename ch, typename char_traits, typename alloc&gt;
+ uuid operator()(std::basic_string&lt;ch, char_traits, alloc&gt; const&amp; name) const;
+    uuid operator()(void const* buffer, std::size_t byte_count) const;
+};
+
+template &lt;typename UniformRandomNumberGenerator&gt;
+class basic_random_generator {
+public:
+    typedef uuid result_type;
+
+    basic_random_generator();
+    explicit basic_random_generator(UniformRandomNumberGenerator&amp; gen);
+    explicit basic_random_generator(UniformRandomNumberGenerator* pGen);
+
+    uuid operator()();
+};
+typedef basic_random_generator&lt;mt19937&gt; random_generator;
+
+}} // namespace boost::uuids
+</pre>
+
+<h4><a name="Nil Generator"</a>Nil Generator</h4>
+<p>The <tt>boost::uuids::nil_generator</tt> class always generates a nil <b>uuid</b>.
+<pre>
+boost::uuids::nil_generator gen;
+boost::uuids::uuid u = gen();
+assert(u.is_nil() == true);
+
+// or for convenience
+boost::uuids::uuid u = boost::uuids::nil_uuid();
+assert(u.is_nil() == true);
+</pre>
+
+<h4><a name="String Generator"</a>String Generator</h4>
+<p>The <tt>boost::uuids::string_generator</tt> class generates a <b>uuid</b> from a string.
+<pre>
+boost::uuids::string_generator gen;
+boost::uuids::uuid u1 = gen("{01234567-89ab-cdef-0123456789abcdef}");
+boost::uuids::uuid u2 = gen(L"01234567-89ab-cdef-0123456789abcdef");
+boost::uuids::uuid u3 = gen(std::string("0123456789abcdef0123456789abcdef")); +boost::uuids::uuid u4 = gen(std::wstring(L"01234567-89ab-cdef-0123456789abcdef"));
+</pre>
+
+<h4><a name="Name Generator"</a>Name Generator</h4>
+<p>
+The <tt>boost::uuids::name_generator</tt> class generates a name based <b>uuid</b> from a
+namespace uuid and a name.
+<pre>
+boost::uuids::uuid dns_namespace_uuid; // initialize to {6ba7b810-9dad-11d1-80b4-00c04fd430c8}
+
+boost::uuids::name_generator gen(dns_namespace_uuid);
+boost::uuids::uuid u = gen("boost.org");
+</pre>
+
+<h4><a name="Random Generator"</a>Random Generator</h4>
+<p>
+The <tt>boost::uuids::basic_random_generator</tt> class generates a random number
+based uuid from a random number generator (one that conforms to the
+<a href="http://www.boost.org/libs/random/random-concepts.html#uniform-rng";>UniformRandomNumberGenerator</a>
+concept).
+<pre>
+//default construct the random number generator and seed it
+boost::uuids::basic_random_generator&lt;boost::mt19937&gt; gen;
+boost::uuids::uuid u = gen();
+
+//for convenience boost::uuids::random_generator
+//is equivalent to boost::uuids::basic_random_generator&lt;boost::mt19937&gt;
+boost::uuids::random_generator gen;
+boost::uuids::uuid u = gen();
+
+//use an existing random number generator
+//pass either a reference or a pointer to the random number generator
+boost::mt19937 ran;
+boost::uuids::basic_random_generator&lt;boost::mt19937&gt; gen(&amp;ran);
+boost::uuids::uuid u = gen();
+</pre>
+
+<h3><a name="boost/uuid/uuid_io.hpp"</a>boost/uuid/uuid_io.hpp</h3>
+<h4><a name="Synopsis_io"</a>Synopsis</h4>
+<pre>
+#include &lt;<a href="./../../boost/uuid/uuid_io.hpp"><tt>boost/uuid/uuid_io.hpp</tt></a>&gt;
+
+namespace boost {
+namespace uuids {
+
+template &lt;typename ch, typename char_traits&gt;
+ std::basic_ostream&lt;ch, char_traits&gt;&amp; operator&lt;&lt;(std::basic_ostream&lt;ch, char_traits&gt; &amp;os, uuid const&amp; u);
+
+template &lt;typename ch, typename char_traits&gt;
+ std::basic_istream&lt;ch, char_traits&gt;&amp; operator&gt;&gt;(std::basic_istream&lt;ch, char_traits&gt; &amp;is, uuid &amp;u);
+
+}} // namespace boost::uuids
+</pre>
+
+<h4><a name="Input and Output"></a>Input and Output</h4>
+<p>
+Input and output stream operators <tt>&lt;&lt;</tt> and <tt>&gt;&gt;</tt>
+are provided by including <a href="../../boost/uuid/uuid_io.hpp"><tt>boost/uuid/uuid_io.hpp</tt></a>.
+The external representation of a <b>uuid</b> is a string of
+hexidecimal digits of the following form: <tt>hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh</tt>
+<pre>
+boost::uuids::uuid u;
+
+std::stringstream ss;
+ss &lt;&lt; u;
+ss &gt;&gt; u;
+</pre>
+
+<h3><a name="boost/uuid/uuid_serialize.hpp"</a>boost/uuid/uuid_serialize.hpp</h3>
+<h4><a name="Synopsis_serialize"</a>Synopsis</h4>
+<pre>
+#include &lt;<a href="./../../boost/uuid/uuid_serialize.hpp"><tt>boost/uuid/uuid_serialize.hpp</tt></a>&gt;
+
+namespace boost {
+namespace uuids {
+
+BOOST_CLASS_IMPLEMENTATION(boost::uuids::uuid, boost::serialization::primitive_type)
+
+}} // namespace boost::uuids
+</pre>
+
+<h4><a name="Serialization"></a>Serialization</h4>
+<p>
+Serialization is accomplished with the <a href="http://www.boost.org/libs/serialization/doc/index.html";>
+Boost Serialization</a> library.  A <b>uuid</b> is serialized as a
+<a href="http://www.boost.org/libs/serialization/doc/serialization.html#primitiveoperators";> +primitive type</a>, thus only the <b>uuid</b> value will be saved to/loaded from an archive.
+<p>
+Include <a href="../../boost/uuid/uuid_serialize.hpp"><tt>boost/uuid/uuid_serialize.hpp</tt></a> to enable serialization for <b>uuid</b>s.
+
+<h2><a name="Design notes"></a>Design notes</h2>
+<p>
+The document, <a href="http://www.itu.int/ITU-T/studygroups/com17/oid/X.667-E.pdf";> +http://www.itu.int/ITU-T/studygroups/com17/oid/X.667-E.pdf</a>, was used to design
+and implement the <b>boost::uuids::uuid</b> struct.
+
+<p>The <tt>boost::uuids::basic_random_generator</tt> class' default constructor +seeds the random number generator with a SHA-1 hash of a number of different +values including <tt>std::time(0)</tt>, <tt>std::clock()</tt>, uninitialized
+data, value return from <tt>new unsigned int</tt>, etc..
+
+<p>The <tt>boost::uuids::name_generator</tt> class uses the SHA-1 hash function to
+compute the <b>uuid</b>.
+
+<p>All functions are re-entrant. Classes are as thread-safe as an int. That is an
+instance can not be shared between threads without proper synchronization.
+
+<h2><a name="History and Acknowledgements"></a>History and Acknowledgements</h2>
+<p>
+A number of people on the <a href="http://www.boost.org/";>boost.org</a>
+mailing list provided useful comments and greatly helped to shape the library.
+
+<p>Revised&nbsp; January 1, 2010</p>
+
+<hr>
+<p>© Copyright Andy Tompkins, 2006</p>
+<p> Distributed under the Boost Software
+License, Version 1.0. (See accompanying file <a href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt";>
+www.boost.org/LICENSE_1_0.txt</a>)</p>
+</body>
+</html>
=======================================
--- /trunk/libs/libraries.htm   Thu Nov 26 23:54:32 2009
+++ /trunk/libs/libraries.htm   Sun Feb  7 05:46:29 2010
@@ -264,7 +264,8 @@
 来自 Dave Abrahams 和其它人. </li>
 <li><a href="utility/value_init.htm">value_initialized</a>
- 统一语法的数值初始化包装,来自 Fernando Cacciola, 基于 David Abrahams 的 原作. </li>
-<li><a href="variant/index.html">variant</a>
+<li><a href="uuid/index.html">uuid</a> - 一个通用的唯一标识符,来自 Andy
+Tompkins. </li><li><a href="variant/index.html">variant</a>
- 安全、泛型、基于栈的可识别联合的容器,来自 Eric Friedman 和 Itay Maman. </li>
 <li><a href="wave/index.html">wave</a> -
将委托型C99/C++预处理器的功能打包到一个符合标准的实现,有易于使用的迭代器接 口,来自 Hartmut&nbsp;Kaiser. </li>
@@ -512,7 +513,8 @@
 Sebastian Redl. </li>
 <li><a href="tuple/doc/tuple_users_guide.html">tuple</a>
 - 更易于定义返回多个数值的函数,及其它,来自 Jaakko Järvi. </li>
-<li><a href="variant/index.html">variant</a>
+<li><a href="uuid/index.html">uuid</a> - 一个通用的唯一标识符,来自 Andy
+Tompkins.</li><li><a href="variant/index.html">variant</a>
-&nbsp;安全、泛型、基于栈的可识别联合的容器,来自 Eric Friedman 和 Itay Maman. </li>
 </ul>
 <h3><a name="Image-processing">Image processing 图像处理</a></h3>
@@ -634,7 +636,7 @@
 <p>Distributed under the Boost Software License, Version 1.0.
 (See file <a href="../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
or <a href="http://www.boost.org/LICENSE_1_0.txt";>www.boost.org/LICENSE_1_0.txt</a>)</p>
-<p>本译文更新于 2009年7月8日,由 alai04, fatalerror99, felurkinda, farproc,
+<p>本译文更新于 2010年2月7日,由 alai04, fatalerror99, felurkinda, farproc,
 hzjboost, blackjazz07, xuwaters, jinq0123,
totti, jANA_cOVA, pterosaur, xiaq,&nbsp;zhaohongchao, leo, sidle, luckycat06, lixin, evy.wang, 元维,水的影子 等人翻译,各人贡献了以下译 文:</p> <p>alai04:<a href="accumulators/index.html">accumulators</a>, <a href="any/index.html">any</a>, <a href="assign/index.html">assign</a>, <a href="bimap/index.html">bimap</a>,&nbsp;<a href="utility/call_traits.htm">call_traits</a>, <a href="circular_buffer/index.html">circular_buffer</a>,

Other related posts:

  • » [boost-doc-zh] r373 committed - 开始升级至1.42.0,新增 uuid 库 - boost-doc-zh