Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54584 - in sandbox/cloneable/libs/cloneable/doc: . html html/cloneable html/cloneable/tutorial html/images
From: christian.schladetsch_at_[hidden]
Date: 2009-07-02 02:11:06


Author: cschladetsch
Date: 2009-07-02 02:11:04 EDT (Thu, 02 Jul 2009)
New Revision: 54584
URL: http://svn.boost.org/trac/boost/changeset/54584

Log:
added quickbook based docs

Added:
   sandbox/cloneable/libs/cloneable/doc/
   sandbox/cloneable/libs/cloneable/doc/Jamfile.v2 (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/cloneable.qbk (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/
   sandbox/cloneable/libs/cloneable/doc/html/boostbook.css (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/cloneable/
   sandbox/cloneable/libs/cloneable/doc/html/cloneable/change_log.html (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/cloneable/containers.html (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/cloneable/intro.html (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/cloneable/tests.html (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/
   sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial.html (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/customising_the_cloning_process.html (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/simple_hierarchical_cloning.html (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/using_custom_allocators.html (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/using_external_types.html (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/images/
   sandbox/cloneable/libs/cloneable/doc/html/images/alert.png (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/images/blank.png (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/images/caution.png (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/images/draft.png (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/images/home.png (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/images/important.png (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/images/next.png (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/images/next_disabled.png (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/images/note.png (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/images/prev.png (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/images/prev_disabled.png (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/images/smiley.png (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/images/tip.png (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/images/toc-blank.png (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/images/toc-minus.png (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/images/toc-plus.png (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/images/up.png (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/images/up_disabled.png (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/images/warning.png (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/index.html (contents, props changed)
   sandbox/cloneable/libs/cloneable/doc/html/standalone_HTML.manifest (contents, props changed)

Added: sandbox/cloneable/libs/cloneable/doc/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/Jamfile.v2 2009-07-02 02:11:04 EDT (Thu, 02 Jul 2009)
@@ -0,0 +1,24 @@
+project boost/monotonic/doc ;
+
+import boostbook : boostbook ;
+using quickbook ;
+
+xml cloneable : cloneable.qbk ;
+
+path-constant images : . ;
+
+boostbook standalone
+ :
+ cloneable
+ :
+ <xsl:param>boost.root=../../../..
+ <xsl:param>boost.libraries=../../../../libs/libraries.htm
+ <xsl:param>html.stylesheet=boostbook.css
+ <xsl:param>generate.section.toc.level=3
+ <xsl:param>chunk.section.depth=2
+ <xsl:param>chunk.first.sections=1
+
+ #<xsl:param>callout.graphics.path=../../images/callouts//
+ <format>pdf:<xsl:param>img.src.path=$(images)/
+ <format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/doc/html
+ ;

Added: sandbox/cloneable/libs/cloneable/doc/cloneable.qbk
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/cloneable.qbk 2009-07-02 02:11:04 EDT (Thu, 02 Jul 2009)
@@ -0,0 +1,314 @@
+[article Cloneable
+ [quickbook 1.4]
+ [version 0.1]
+ [authors [Schladetsch, Christian]]
+ [copyright 2009 Christian Schladetsch]
+ [purpose /WikiWiki/ Generalised cloning system for hierachical objects]
+ [license
+ 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])
+ ]
+]
+
+[/ QuickBook Document version 1.4 ]
+[/ Sept 24, 2002 ]
+[/ Sept 2, 2004 ]
+[/ Feb 14, 2005 ]
+[/ Sept 13, 2005 ]
+
+[/ Some links]
+
+[def __note__ [$images/note.png]]
+[def __alert__ [$images/alert.png]]
+[def __tip__ [$images/tip.png]]
+[def :-) [$images/smiley.png]]
+[def __spirit__ [@http://spirit.sourceforge.net Spirit]]
+[def __boostbook__ [@http://www.boost.org/doc/html/boostbook.html BoostBook]]
+[def __docbook__ [@http://www.docbook.org/ DocBook]]
+
+[section:intro Introduction]
+
+The [*Boost.Cloneable] library provides a means for creating,
+duplicating, and querying instances of object types that are specified
+in class hierarchies, and a set of containers[1] for those objects.
+
+Cloneable objects can create clones of derived types from base types,
+can do so given any STL-compliant allocator, and support multiple clone type targets.
+
+The user of the libray is able to override the default cloning process,
+ and may supply custom allocators. Cloneable types can derive from other cloneable
+types, in which case the user can specify which subobject type to duplicate or create when
+making a new clone or new object from an existing instance.
+
+You can use [*Boost.Cloneable] with existing, external types without modification
+to those types by using the supplied ['adaptor] mechanism. [*Boost.Cloneable] also
+supports types that are not default-constructable.
+
+There is a fundamental requirement that a common base class type is shared for
+each type in a given class hierarchy. The user can supply their own base classes,
+or sensible defaults are generated.
+
+[1] Cloneable objects can be used in containers-of-pointers (based on a modified <emphasis>Boost.PtrContainer</emphasis> implementation), producing a 'heterogenous' container system with value semantics for comparison and copying, and emplace semantics for insertion. These containers are currently a part of the proposal as well, however it is intended that they eventually form a distinct library. This proposal will focus mostly on the single-object aspect of the system.
+
+[endsect]
+
+[section:change_log Change Log]
+
+[h3 Version 0.1]
+
+* Created
+
+[endsect]
+
+[section:tutorial Basic Usage]
+
+This tutorial progresses through the basic usage of the library, demonstrating how
+to make a new Cloneable type, how to make an exsiting, external type Cloneable,
+and how to deal with multiple inheritance in type hierarchies.
+
+The following is a very quick introduction to [*Boost.Cloneable]:
+
+``
+#include <boost/cloneable.hpp>;
+
+using namespace boost;
+
+class Foo : cloneable::base<Foo> { };
+
+int main()
+{
+ Foo *foo = new Foo();
+ cloneable::default_base_type *cloned = foo->clone();
+ assert(typeid(*cloned) == typeid(Foo));
+ return 0;
+}
+``
+
+Here we have made a class and derived from `cloneable::base`, passing the
+type of thing to clone as a type parameter. Because we didn't supply a base
+type to use, we were given `default_base_type`. Although it is fine to use
+this default base class, we shall see that in general it is better to provide
+our own base classes as this gives us much flexibility when it comes to
+associative containers and resource management.
+
+But we'll get to that later. For now, let's move on to some slightly less trivial examples.
+
+[section Simple Hierarchical Cloning]
+
+``
+#include <string>
+#include <boost/cloneable.hpp>
+
+using namespace boost;
+using namespace std;
+
+class Animal
+{
+ virtual ~Animal() { }
+ virtual string get_name() const = 0;
+};
+
+class Cat : public cloneable::base<Cat, Animal>
+{
+ string name;
+
+public:
+ Cat() {}
+ Cat(string n) : name(n) { }
+ string get_name() const { return name; }
+};
+
+int main()
+{
+ Cat *cat = new Cat("sam");
+
+ // clone the cat. returns a pointer to the base class
+ Animal *animal = cat->clone();
+ assert(typeid(*animal) == typeid(Cat));
+
+ // downcast to our derived type
+ Cat *cloned = dynamic_cast<Cat *>(animal);
+ assert(cloned->get_name() == "sam");
+
+ return 0;
+};
+``
+
+In this example, we note that the `clone()` method returns
+a pointer to the base class of the type hierarchy. If you know
+the derived type that you wish to be cloned, you can use the
+`clone_as<T>()` method instead and save some typing:
+
+``
+Cat *cloned = cat->clone_as<Cat>();
+``
+
+We now add other animals to the hierachy, including the use of multiple inheritance:
+
+``
+class Dog : public cloneable::base<Dog, Animal>
+{
+};
+
+class Labrador : public Dog, public cloneable::base<Labrador, Animal>
+{
+};
+
+int main()
+{
+ Labrador *lab = new Labrador();
+ Dog *dog = lab->clone_as<Dog>();
+ Labrador *cloned_lab = lab->clone_as<Labrador>();
+ return 0;
+}
+``
+
+Here we see that class Labrador is-a Dog, and is also cloneable as a Labrador.
+When cloning this class, we specify which sub-object we wish to duplicate. Note that when using `clone_as<T>`, we actually are making a type of T, rather than making another type and casting up.
+
+We can also use the Cloneable library to make a new instance, without duplication:
+
+``
+Animal *MakeNew(const cloneable::abstract_base<Animal> &animal)
+{
+ return animal.create_new();
+}
+
+int main()
+{
+ Cat *cat = new Cat();
+ Animal *new_animal = MakeNew(*cat);
+ assert(typeid(*new_animal) == typeid(Cat));
+ return 0;
+}
+``
+
+This will create a new derived animal type (not a new base), and return a pointer
+to the base. Here we used a free-function to make the new object, to show how
+to use the `abstract_base` template. We used `abstract_base<Animal>`, rather than
+just `Animal`, as the base type argument for the `MakeNew` function. This is because
+the base class we provided, `Animal`, does not derive from anything and does not
+have any clone-related methods. These methods are added by the `abstract_base<>` mixin,
+which all derived `Animal`s are implicitly convertible to.
+
+[endsect]
+
+[section Using External Types]
+
+Quite often we find ourselves using classes that are defined in an external library.
+These are not open to be changed, but we would still like them to be Cloneable.
+To address this issue, we can use the `cloneable::adaptor<Type,Base>` structure:
+
+``
+class External { }; // cannot be modified
+
+class MyBase { virtual ~MyBase() { } };
+
+typedef cloneable::adaptor<External, MyBase> MyExternal;
+
+int main()
+{
+ MyExternal *ex = new MyExternal();
+ MyExternal *cloned = ex->clone_as<MyExternal>();
+ return 0;
+}
+``
+
+Alternatively of course, we could just make a new structure which either derives
+from or encapsulates the external class. This will be necessary if you wish to
+pass construction arguments to the external type, or provide a custom clone
+method for it.
+
+[endsect]
+
+[section Customising the Cloning Process]
+
+So far, we have been making clones using the default cloning process.
+This uses the copy-constructor of the given type to generate the clone.
+However, quite often we will want to have greater control over this process,
+and sometimes we don't want to or cannot use a copy constructor at all.
+
+To customise the cloning process, it is a simple matter of providing a `make_copy`
+method overload in your derived class:
+
+``
+class Foo : public cloneable::base<Foo>
+{
+ // over-ride the make_copy method, providing our own means to make a clone
+ Foo *make_copy() const
+ {
+ Foo *copy = new Foo();
+ // write values to copy from this
+ return copy;
+ }
+};
+``
+
+Please ensure that you override the `make_copy()` method correctly. It must return
+a type that is co-variant with the base you used for the derived type, and must be
+`const`. This example uses the heap to make clones; now we will see how to make
+clones using any standard-compliant allocator type.
+
+[endsect]
+
+[section Using Custom Allocators]
+
+The entire ['Cloneable] system was designed to support general allocators. This provides
+more fine-tuned control for the cloning and creation operations, and ensures Cloneable
+types work well in containers. When making a new object or sub-object or clone or sub-clone,
+the underlying `abstract_base` is given a reference to an `abstract_allocator`. This is
+an interface (containing only pure virtual methods) that is used to expose a specialised
+`allocator<T>` to the non-specific `abstract_base`. This process is easy to understand with some examples:
+
+``
+int main()
+{
+ std::allocator<int> alloc;
+ Cat *cat = cloneable::create<Cat>(alloc); // create a Cat using the allocator
+ Cat *dupe = cat->clone_as<Cat>(alloc); // clone using the same allocator
+
+ my_allocator<int> my_alloc;
+ Cat *dup2 = cat->clone_as<Cat>(my_alloc); // clone using another allocator
+ return 0;
+}
+``
+
+As you can see, most of the internals can be safely ignored. From this, it becomes clear
+that if you write a clone override, you should do so for the method that takes an `abstract_allocator &`,
+rather than just always use the heap:
+
+``
+class Foo : public cloneable::base<Foo>
+{
+ // over-ride the make_copy method, providing our own means to make a clone
+ Foo *make_copy(cloneable::abstract_allocator &amp;alloc) const
+ {
+ Foo *copy = cloneable::create<Foo>(alloc);
+
+ // write values to copy from this; use alloc for any further required allocations
+
+ return copy;
+ }
+};
+``
+
+Recall that if your class can be correctly copy-constructed, you do not need to
+provide a custom clone override at all. If your class members that have value
+semantics and can be copy-constructed (including `std::containers`, and heterogenous::containers),
+then you do not need to provide any customisation.
+
+However, if your class containers pointers of any description, or references,
+then you will in general have to provide a sensible copy-constructor, or provide a custom clone override.
+
+In summary, there are three stages of customisation:
+
+* If your class has types with value semantics, the compiler-generated default copy constructor will suffice.
+* If your class has types that need explicit construction, making a copy-constructor for your class will suffice to make clones.
+* If your class has members that contain references, or require allocation, then you should override `make_copy` and construct the members in the copy instance, using the supplied abstract_allocator.
+
+[endsect]
+
+
+[endsect]
+

Added: sandbox/cloneable/libs/cloneable/doc/html/boostbook.css
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/html/boostbook.css 2009-07-02 02:11:04 EDT (Thu, 02 Jul 2009)
@@ -0,0 +1,594 @@
+/*=============================================================================
+ Copyright (c) 2004 Joel de Guzman
+ http://spirit.sourceforge.net/
+
+ Distributed under the Boost Software License, Version 1.0. (See accompany-
+ ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+
+/*=============================================================================
+ Body defaults
+=============================================================================*/
+
+ body
+ {
+ margin: 1em;
+ font-family: sans-serif;
+ }
+
+/*=============================================================================
+ Paragraphs
+=============================================================================*/
+
+ p
+ {
+ text-align: left;
+ font-size: 10pt;
+ line-height: 1.15;
+ }
+
+/*=============================================================================
+ Program listings
+=============================================================================*/
+
+ /* Code on paragraphs */
+ p tt.computeroutput
+ {
+ font-size: 9pt;
+ }
+
+ pre.synopsis
+ {
+ font-size: 90%;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ .programlisting,
+ .screen
+ {
+ font-size: 9pt;
+ display: block;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ /* Program listings in tables don't get borders */
+ td .programlisting,
+ td .screen
+ {
+ margin: 0pc 0pc 0pc 0pc;
+ padding: 0pc 0pc 0pc 0pc;
+ }
+
+/*=============================================================================
+ Headings
+=============================================================================*/
+
+ h1, h2, h3, h4, h5, h6
+ {
+ text-align: left;
+ margin: 1em 0em 0.5em 0em;
+ font-weight: bold;
+ }
+
+ h1 { font: 140% }
+ h2 { font: bold 140% }
+ h3 { font: bold 130% }
+ h4 { font: bold 120% }
+ h5 { font: italic 110% }
+ h6 { font: italic 100% }
+
+ /* Top page titles */
+ title,
+ h1.title,
+ h2.title
+ h3.title,
+ h4.title,
+ h5.title,
+ h6.title,
+ .refentrytitle
+ {
+ font-weight: bold;
+ margin-bottom: 1pc;
+ }
+
+ h1.title { font-size: 140% }
+ h2.title { font-size: 140% }
+ h3.title { font-size: 130% }
+ h4.title { font-size: 120% }
+ h5.title { font-size: 110% }
+ h6.title { font-size: 100% }
+
+ .section h1
+ {
+ margin: 0em 0em 0.5em 0em;
+ font-size: 140%;
+ }
+
+ .section h2 { font-size: 140% }
+ .section h3 { font-size: 130% }
+ .section h4 { font-size: 120% }
+ .section h5 { font-size: 110% }
+ .section h6 { font-size: 100% }
+
+ /* Code on titles */
+ h1 tt.computeroutput { font-size: 140% }
+ h2 tt.computeroutput { font-size: 140% }
+ h3 tt.computeroutput { font-size: 130% }
+ h4 tt.computeroutput { font-size: 120% }
+ h5 tt.computeroutput { font-size: 110% }
+ h6 tt.computeroutput { font-size: 100% }
+
+/*=============================================================================
+ Author
+=============================================================================*/
+
+ h3.author
+ {
+ font-size: 100%
+ }
+
+/*=============================================================================
+ Lists
+=============================================================================*/
+
+ li
+ {
+ font-size: 10pt;
+ line-height: 1.3;
+ }
+
+ /* Unordered lists */
+ ul
+ {
+ text-align: left;
+ }
+
+ /* Ordered lists */
+ ol
+ {
+ text-align: left;
+ }
+
+/*=============================================================================
+ Links
+=============================================================================*/
+
+ a
+ {
+ text-decoration: none; /* no underline */
+ }
+
+ a:hover
+ {
+ text-decoration: underline;
+ }
+
+/*=============================================================================
+ Spirit style navigation
+=============================================================================*/
+
+ .spirit-nav
+ {
+ text-align: right;
+ }
+
+ .spirit-nav a
+ {
+ color: white;
+ padding-left: 0.5em;
+ }
+
+ .spirit-nav img
+ {
+ border-width: 0px;
+ }
+
+/*=============================================================================
+ Copyright footer
+=============================================================================*/
+ .copyright-footer
+ {
+ text-align: right;
+ font-size: 70%;
+ }
+
+ .copyright-footer p
+ {
+ text-align: right;
+ font-size: 80%;
+ }
+
+/*=============================================================================
+ Table of contents
+=============================================================================*/
+
+ .toc
+ {
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.1pc 1pc 0.1pc 1pc;
+ font-size: 80%;
+ line-height: 1.15;
+ }
+
+ .boost-toc
+ {
+ float: right;
+ padding: 0.5pc;
+ }
+
+/*=============================================================================
+ Tables
+=============================================================================*/
+
+ .table-title,
+ div.table p.title
+ {
+ margin-left: 4%;
+ padding-right: 0.5em;
+ padding-left: 0.5em;
+ }
+
+ .informaltable table,
+ .table table
+ {
+ width: 92%;
+ margin-left: 4%;
+ margin-right: 4%;
+ }
+
+ div.informaltable table,
+ div.table table
+ {
+ padding: 4px;
+ }
+
+ /* Table Cells */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ padding: 0.5em;
+ text-align: left;
+ font-size: 9pt;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ padding: 0.5em 0.5em 0.5em 0.5em;
+ border: 1pt solid white;
+ font-size: 80%;
+ }
+
+ table.simplelist
+ {
+ width: auto !important;
+ margin: 0em !important;
+ padding: 0em !important;
+ border: none !important;
+ }
+ table.simplelist td
+ {
+ margin: 0em !important;
+ padding: 0em !important;
+ text-align: left !important;
+ font-size: 9pt !important;
+ border: none !important;
+ }
+
+/*=============================================================================
+ Blurbs
+=============================================================================*/
+
+ div.note,
+ div.tip,
+ div.important,
+ div.caution,
+ div.warning,
+ p.blurb
+ {
+ font-size: 9pt; /* A little bit smaller than the main text */
+ line-height: 1.2;
+ display: block;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ p.blurb img
+ {
+ padding: 1pt;
+ }
+
+/*=============================================================================
+ Variable Lists
+=============================================================================*/
+
+ div.variablelist
+ {
+ margin: 1em 0;
+ }
+
+ /* Make the terms in definition lists bold */
+ div.variablelist dl dt,
+ span.term
+ {
+ font-weight: bold;
+ font-size: 10pt;
+ }
+
+ div.variablelist table tbody tr td
+ {
+ text-align: left;
+ vertical-align: top;
+ padding: 0em 2em 0em 0em;
+ font-size: 10pt;
+ margin: 0em 0em 0.5em 0em;
+ line-height: 1;
+ }
+
+ div.variablelist dl dt
+ {
+ margin-bottom: 0.2em;
+ }
+
+ div.variablelist dl dd
+ {
+ margin: 0em 0em 0.5em 2em;
+ font-size: 10pt;
+ }
+
+ div.variablelist table tbody tr td p,
+ div.variablelist dl dd p
+ {
+ margin: 0em 0em 0.5em 0em;
+ line-height: 1;
+ }
+
+/*=============================================================================
+ Misc
+=============================================================================*/
+
+ /* Title of books and articles in bibliographies */
+ span.title
+ {
+ font-style: italic;
+ }
+
+ span.underline
+ {
+ text-decoration: underline;
+ }
+
+ span.strikethrough
+ {
+ text-decoration: line-through;
+ }
+
+ /* Copyright, Legal Notice */
+ div div.legalnotice p
+ {
+ text-align: left
+ }
+
+/*=============================================================================
+ Colors
+=============================================================================*/
+
+ @media screen
+ {
+ body {
+ background-color: #FFFFFF;
+ color: #000000;
+ }
+
+ /* Links */
+ a
+ {
+ color: #005a9c;
+ }
+
+ a:visited
+ {
+ color: #9c5a9c;
+ }
+
+ h1 a, h2 a, h3 a, h4 a, h5 a, h6 a,
+ h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover,
+ h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited
+ {
+ text-decoration: none; /* no underline */
+ color: #000000;
+ }
+
+ /* Syntax Highlighting */
+ .keyword { color: #0000AA; }
+ .identifier { color: #000000; }
+ .special { color: #707070; }
+ .preprocessor { color: #402080; }
+ .char { color: teal; }
+ .comment { color: #800000; }
+ .string { color: teal; }
+ .number { color: teal; }
+ .white_bkd { background-color: #FFFFFF; }
+ .dk_grey_bkd { background-color: #999999; }
+
+ /* Copyright, Legal Notice */
+ .copyright
+ {
+ color: #666666;
+ font-size: small;
+ }
+
+ div div.legalnotice p
+ {
+ color: #666666;
+ }
+
+ /* Program listing */
+ pre.synopsis
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ .programlisting,
+ .screen
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ td .programlisting,
+ td .screen
+ {
+ border: 0px solid #DCDCDC;
+ }
+
+ /* Blurbs */
+ div.note,
+ div.tip,
+ div.important,
+ div.caution,
+ div.warning,
+ p.blurb
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ /* Table of contents */
+ .toc
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ /* Tables */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ background-color: #F0F0F0;
+ border: 1px solid #DCDCDC;
+ }
+
+ .copyright-footer
+ {
+ color: #8F8F8F;
+ }
+
+ /* Misc */
+ span.highlight
+ {
+ color: #00A000;
+ }
+ }
+
+ @media print
+ {
+ /* Links */
+ a
+ {
+ color: black;
+ }
+
+ a:visited
+ {
+ color: black;
+ }
+
+ .spirit-nav
+ {
+ display: none;
+ }
+
+ /* Program listing */
+ pre.synopsis
+ {
+ border: 1px solid gray;
+ }
+
+ .programlisting,
+ .screen
+ {
+ border: 1px solid gray;
+ }
+
+ td .programlisting,
+ td .screen
+ {
+ border: 0px solid #DCDCDC;
+ }
+
+ /* Table of contents */
+ .toc
+ {
+ border: 1px solid gray;
+ }
+
+ .informaltable table,
+ .table table
+ {
+ border: 1px solid gray;
+ border-collapse: collapse;
+ }
+
+ /* Tables */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ border: 1px solid gray;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ border: 1px solid gray;
+ }
+
+ table.simplelist tr td
+ {
+ border: none !important;
+ }
+
+ /* Misc */
+ span.highlight
+ {
+ font-weight: bold;
+ }
+ }
+
+/*=============================================================================
+ Images
+=============================================================================*/
+
+ span.inlinemediaobject img
+ {
+ vertical-align: middle;
+ }
+
+/*==============================================================================
+ Super and Subscript: style so that line spacing isn't effected, see
+ http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=1&postId=5341
+==============================================================================*/
+
+sup,
+sub {
+ height: 0;
+ line-height: 1;
+ vertical-align: baseline;
+ _vertical-align: bottom;
+ position: relative;
+
+}
+
+sup {
+ bottom: 1ex;
+}
+
+sub {
+ top: .5ex;
+}
+

Added: sandbox/cloneable/libs/cloneable/doc/html/cloneable/change_log.html
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/change_log.html 2009-07-02 02:11:04 EDT (Thu, 02 Jul 2009)
@@ -0,0 +1,50 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Change Log</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<link rel="home" href="../index.html" title="Cloneable 0.1">
+<link rel="up" href="../index.html" title="Cloneable 0.1">
+<link rel="prev" href="intro.html" title="Introduction">
+<link rel="next" href="tutorial.html" title="Basic Usage">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="intro.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="tutorial.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Change Log">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="cloneable.change_log"></a><a class="link" href="change_log.html" title="Change Log"> Change Log</a>
+</h2></div></div></div>
+<a name="cloneable.change_log.version_0_1"></a><h4>
+<a name="id669928"></a>
+ <a class="link" href="change_log.html#cloneable.change_log.version_0_1">Version 0.1</a>
+ </h4>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+ Created
+ </li></ul></div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 Christian Schladetsch<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="intro.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="tutorial.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/cloneable/libs/cloneable/doc/html/cloneable/containers.html
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/containers.html 2009-07-02 02:11:04 EDT (Thu, 02 Jul 2009)
@@ -0,0 +1,48 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Heterogenous Containers</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<link rel="home" href="../index.html" title="Chapter 1. Boost.Cloneable">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Cloneable">
+<link rel="prev" href="tutorial.html" title="Tutorial">
+<link rel="next" href="../index/s04.html" title="Frequently Asked Questions">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="tutorial.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../index/s04.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Heterogenous Containers">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="cloneable.containers"></a>Heterogenous Containers</h2></div></div></div>
+<div class="toc"><dl><dt><span class="section">Overview</span></dt></dl></div>
+<div class="section" title="Overview">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id667056"></a>Overview</h3></div></div></div>
+<p>This tutorial demonstrates the use of the <span class="emphasis"><em>heterogenous</em></span> container system provided in the Cloneable library.
+ </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"><p><small>Last revised: , at </small></p></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 Christian Schladetsch<p>Use, modification and distribution is subject to the Boost
+ Software License, Version 1.0. (See accompanying file
+ <code class="filename">LICENSE_1_0.txt</code> or copy at http://www.boost.org/LICENSE_1_0.txt)</p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="tutorial.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../index/s04.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/cloneable/libs/cloneable/doc/html/cloneable/intro.html
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/intro.html 2009-07-02 02:11:04 EDT (Thu, 02 Jul 2009)
@@ -0,0 +1,78 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Introduction</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<link rel="home" href="../index.html" title="Cloneable 0.1">
+<link rel="up" href="../index.html" title="Cloneable 0.1">
+<link rel="prev" href="../index.html" title="Cloneable 0.1">
+<link rel="next" href="change_log.html" title="Change Log">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../index.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="change_log.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Introduction">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="cloneable.intro"></a><a class="link" href="intro.html" title="Introduction"> Introduction</a>
+</h2></div></div></div>
+<p>
+ The <span class="bold"><strong>Boost.Cloneable</strong></span> library provides a means
+ for creating, duplicating, and querying instances of object types that are
+ specified in class hierarchies, and a set of containers[1] for those objects.
+ </p>
+<p>
+ Cloneable objects can create clones of derived types from base types, can do
+ so given any STL-compliant allocator, and support multiple clone type targets.
+ </p>
+<p>
+ The user of the libray is able to override the default cloning process, and
+ may supply custom allocators. Cloneable types can derive from other cloneable
+ types, in which case the user can specify which subobject type to duplicate
+ or create when making a new clone or new object from an existing instance.
+ </p>
+<p>
+ You can use <span class="bold"><strong>Boost.Cloneable</strong></span> with existing,
+ external types without modification to those types by using the supplied <span class="emphasis"><em>adaptor</em></span>
+ mechanism. <span class="bold"><strong>Boost.Cloneable</strong></span> also supports types
+ that are not default-constructable.
+ </p>
+<p>
+ There is a fundamental requirement that a common base class type is shared
+ for each type in a given class hierarchy. The user can supply their own base
+ classes, or sensible defaults are generated.
+ </p>
+<p>
+ [1] Cloneable objects can be used in containers-of-pointers (based on a modified
+ &lt;emphasis&gt;Boost.PtrContainer&lt;/emphasis&gt; implementation), producing
+ a 'heterogenous' container system with value semantics for comparison and copying,
+ and emplace semantics for insertion. These containers are currently a part
+ of the proposal as well, however it is intended that they eventually form a
+ distinct library. This proposal will focus mostly on the single-object aspect
+ of the system.
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 Christian Schladetsch<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../index.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="change_log.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/cloneable/libs/cloneable/doc/html/cloneable/tests.html
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/tests.html 2009-07-02 02:11:04 EDT (Thu, 02 Jul 2009)
@@ -0,0 +1,104 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Testsuite</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<link rel="home" href="../index.html" title="Chapter 1. Boost.Cloneable">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Cloneable">
+<link rel="prev" href="../index/s05.html" title="Design Overview">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../index/s05.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a>
+</div>
+<div class="section" title="Testsuite">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="cloneable.tests"></a>Testsuite</h2></div></div></div>
+<div class="toc"><dl><dt><span class="section">Acceptance tests</span></dt></dl></div>
+<div class="section" title="Acceptance tests">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="id667131"></a>Acceptance tests</h3></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col width="1in">
+<col>
+</colgroup>
+<thead><tr>
+<th>Test</th>
+<th>Type</th>
+<th>Description</th>
+<th>If failing...</th>
+</tr></thead>
+<tbody>
+<tr>
+<td><p>dead_slot_test.cpp</p></td>
+<td><p>run</p></td>
+<td><p>Ensure that calling <code class="computeroutput">connect</code> with a slot
+that has already been disconnected via deletion does not actually
+connect to the slot.</p></td>
+<td> </td>
+</tr>
+<tr>
+<td><p>deletion_test.cpp</p></td>
+<td><p>run</p></td>
+<td><p>Test deletion of slots.</p></td>
+<td> </td>
+</tr>
+<tr>
+<td><p>ordering_test.cpp</p></td>
+<td><p>run</p></td>
+<td><p>Test slot group ordering.</p></td>
+<td> </td>
+</tr>
+<tr>
+<td><p>signal_n_test.cpp</p></td>
+<td><p>run</p></td>
+<td><p>Basic test of signal/slot connections and invocation using the
+<code class="computeroutput">boost::signalN</code> class templates.</p></td>
+<td> </td>
+</tr>
+<tr>
+<td><p>signal_test.cpp</p></td>
+<td><p>run</p></td>
+<td><p>Basic test of signal/slot connections and invocation using the
+<code class="computeroutput">boost::signal</code> class template.</p></td>
+<td><p>The <code class="computeroutput">boost::signal</code> class template may not
+be usable on your compiler. However, the
+<code class="computeroutput">boost::signalN</code> class templates may still be
+usable.</p></td>
+</tr>
+<tr>
+<td><p>trackable_test.cpp</p></td>
+<td><p>run</p></td>
+<td><p>Test automatic lifetime management using
+ <code class="computeroutput">boost::trackable</code> objects.</p></td>
+<td> </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 Christian Schladetsch<p>Use, modification and distribution is subject to the Boost
+ Software License, Version 1.0. (See accompanying file
+ <code class="filename">LICENSE_1_0.txt</code> or copy at http://www.boost.org/LICENSE_1_0.txt)</p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../index/s05.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a>
+</div>
+</body>
+</html>

Added: sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial.html
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial.html 2009-07-02 02:11:04 EDT (Thu, 02 Jul 2009)
@@ -0,0 +1,92 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Basic Usage</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<link rel="home" href="../index.html" title="Cloneable 0.1">
+<link rel="up" href="../index.html" title="Cloneable 0.1">
+<link rel="prev" href="change_log.html" title="Change Log">
+<link rel="next" href="tutorial/simple_hierarchical_cloning.html" title="Simple Hierarchical Cloning">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="change_log.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="tutorial/simple_hierarchical_cloning.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Basic Usage">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="cloneable.tutorial"></a><a class="link" href="tutorial.html" title="Basic Usage"> Basic Usage</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="tutorial/simple_hierarchical_cloning.html">Simple
+ Hierarchical Cloning</a></span></dt>
+<dt><span class="section"><a href="tutorial/using_external_types.html">Using External
+ Types</a></span></dt>
+<dt><span class="section"><a href="tutorial/customising_the_cloning_process.html">Customising
+ the Cloning Process</a></span></dt>
+<dt><span class="section"><a href="tutorial/using_custom_allocators.html">Using Custom
+ Allocators</a></span></dt>
+</dl></div>
+<p>
+ This tutorial progresses through the basic usage of the library, demonstrating
+ how to make a new Cloneable type, how to make an exsiting, external type Cloneable,
+ and how to deal with multiple inheritance in type hierarchies.
+ </p>
+<p>
+ The following is a very quick introduction to <span class="bold"><strong>Boost.Cloneable</strong></span>:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">cloneable</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;;</span>
+
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">;</span>
+
+<span class="keyword">class</span> <span class="identifier">Foo</span> <span class="special">:</span> <span class="identifier">cloneable</span><span class="special">::</span><span class="identifier">base</span><span class="special">&lt;</span><span class="identifier">Foo</span><span class="special">&gt;</span> <span class="special">{</span> <span class="special">};</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">Foo</span> <span class="special">*</span><span class="identifier">foo</span> <span class="special">=</span> <span class="keyword">new</span> <span class="identifier">Foo</span><span class="special">();</span>
+ <span class="identifier">cloneable</span><span class="special">::</span><span class="identifier">default_base_type</span> <span class="special">*</span><span class="identifier">cloned</span> <span class="special">=</span> <span class="identifier">foo</span><span class="special">-&gt;</span><span class="identifier">clone</span><span class="special">();</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="keyword">typeid</span><span class="special">(*</span><span class="identifier">cloned</span><span class="special">)</span> <span class="special">==</span> <span class="keyword">typeid</span><span class="special">(</span><span class="identifier">Foo</span><span class="special">));</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ Here we have made a class and derived from <code class="computeroutput"><span class="identifier">cloneable</span><span class="special">::</span><span class="identifier">base</span></code>, passing
+ the type of thing to clone as a type parameter. Because we didn't supply a
+ base type to use, we were given <code class="computeroutput"><span class="identifier">default_base_type</span></code>.
+ Although it is fine to use this default base class, we shall see that in general
+ it is better to provide our own base classes as this gives us much flexibility
+ when it comes to associative containers and resource management.
+ </p>
+<p>
+ But we'll get to that later. For now, let's move on to some slightly less trivial
+ examples.
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 Christian Schladetsch<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="change_log.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="tutorial/simple_hierarchical_cloning.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/customising_the_cloning_process.html
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/customising_the_cloning_process.html 2009-07-02 02:11:04 EDT (Thu, 02 Jul 2009)
@@ -0,0 +1,77 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Customising the Cloning Process</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<link rel="home" href="../../index.html" title="Cloneable 0.1">
+<link rel="up" href="../tutorial.html" title="Basic Usage">
+<link rel="prev" href="using_external_types.html" title="Using External Types">
+<link rel="next" href="using_custom_allocators.html" title="Using Custom Allocators">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="using_external_types.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="using_custom_allocators.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Customising the Cloning Process">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="cloneable.tutorial.customising_the_cloning_process"></a><a class="link" href="customising_the_cloning_process.html" title="Customising the Cloning Process">Customising
+ the Cloning Process</a>
+</h3></div></div></div>
+<p>
+ So far, we have been making clones using the default cloning process. This
+ uses the copy-constructor of the given type to generate the clone. However,
+ quite often we will want to have greater control over this process, and sometimes
+ we don't want to or cannot use a copy constructor at all.
+ </p>
+<p>
+ To customise the cloning process, it is a simple matter of providing a <code class="computeroutput"><span class="identifier">make_copy</span></code> method overload in your derived
+ class:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">Foo</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">cloneable</span><span class="special">::</span><span class="identifier">base</span><span class="special">&lt;</span><span class="identifier">Foo</span><span class="special">&gt;</span>
+<span class="special">{</span>
+ <span class="comment">// over-ride the make_copy method, providing our own means to make a clone
+</span> <span class="identifier">Foo</span> <span class="special">*</span><span class="identifier">make_copy</span><span class="special">()</span> <span class="keyword">const</span>
+ <span class="special">{</span>
+ <span class="identifier">Foo</span> <span class="special">*</span><span class="identifier">copy</span> <span class="special">=</span> <span class="keyword">new</span> <span class="identifier">Foo</span><span class="special">();</span>
+ <span class="comment">// write values to copy from this
+</span> <span class="keyword">return</span> <span class="identifier">copy</span><span class="special">;</span>
+ <span class="special">}</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<p>
+ Please ensure that you override the <code class="computeroutput"><span class="identifier">make_copy</span><span class="special">()</span></code> method correctly. It must return a type
+ that is co-variant with the base you used for the derived type, and must
+ be <code class="computeroutput"><span class="keyword">const</span></code>. This example uses
+ the heap to make clones; now we will see how to make clones using any standard-compliant
+ allocator type.
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 Christian Schladetsch<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="using_external_types.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="using_custom_allocators.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/simple_hierarchical_cloning.html
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/simple_hierarchical_cloning.html 2009-07-02 02:11:04 EDT (Thu, 02 Jul 2009)
@@ -0,0 +1,161 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Simple Hierarchical Cloning</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<link rel="home" href="../../index.html" title="Cloneable 0.1">
+<link rel="up" href="../tutorial.html" title="Basic Usage">
+<link rel="prev" href="../tutorial.html" title="Basic Usage">
+<link rel="next" href="using_external_types.html" title="Using External Types">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../tutorial.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="using_external_types.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Simple Hierarchical Cloning">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="cloneable.tutorial.simple_hierarchical_cloning"></a><a class="link" href="simple_hierarchical_cloning.html" title="Simple Hierarchical Cloning">Simple
+ Hierarchical Cloning</a>
+</h3></div></div></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">string</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">cloneable</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">;</span>
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">std</span><span class="special">;</span>
+
+<span class="keyword">class</span> <span class="identifier">Animal</span>
+<span class="special">{</span>
+ <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">Animal</span><span class="special">()</span> <span class="special">{</span> <span class="special">}</span>
+ <span class="keyword">virtual</span> <span class="identifier">string</span> <span class="identifier">get_name</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">};</span>
+
+<span class="keyword">class</span> <span class="identifier">Cat</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">cloneable</span><span class="special">::</span><span class="identifier">base</span><span class="special">&lt;</span><span class="identifier">Cat</span><span class="special">,</span> <span class="identifier">Animal</span><span class="special">&gt;</span>
+<span class="special">{</span>
+ <span class="identifier">string</span> <span class="identifier">name</span><span class="special">;</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">Cat</span><span class="special">()</span> <span class="special">{}</span>
+ <span class="identifier">Cat</span><span class="special">(</span><span class="identifier">string</span> <span class="identifier">n</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">name</span><span class="special">(</span><span class="identifier">n</span><span class="special">)</span> <span class="special">{</span> <span class="special">}</span>
+ <span class="identifier">string</span> <span class="identifier">get_name</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">name</span><span class="special">;</span> <span class="special">}</span>
+<span class="special">};</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">Cat</span> <span class="special">*</span><span class="identifier">cat</span> <span class="special">=</span> <span class="keyword">new</span> <span class="identifier">Cat</span><span class="special">(</span><span class="string">"sam"</span><span class="special">);</span>
+
+ <span class="comment">// clone the cat. returns a pointer to the base class
+</span> <span class="identifier">Animal</span> <span class="special">*</span><span class="identifier">animal</span> <span class="special">=</span> <span class="identifier">cat</span><span class="special">-&gt;</span><span class="identifier">clone</span><span class="special">();</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="keyword">typeid</span><span class="special">(*</span><span class="identifier">animal</span><span class="special">)</span> <span class="special">==</span> <span class="keyword">typeid</span><span class="special">(</span><span class="identifier">Cat</span><span class="special">));</span>
+
+ <span class="comment">// downcast to our derived type
+</span> <span class="identifier">Cat</span> <span class="special">*</span><span class="identifier">cloned</span> <span class="special">=</span> <span class="keyword">dynamic_cast</span><span class="special">&lt;</span><span class="identifier">Cat</span> <span class="special">*&gt;(</span><span class="identifier">animal</span><span class="special">);</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">cloned</span><span class="special">-&gt;</span><span class="identifier">get_name</span><span class="special">()</span> <span class="special">==</span> <span class="string">"sam"</span><span class="special">);</span>
+
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<p>
+ In this example, we note that the <code class="computeroutput"><span class="identifier">clone</span><span class="special">()</span></code> method returns a pointer to the base class
+ of the type hierarchy. If you know the derived type that you wish to be cloned,
+ you can use the <code class="computeroutput"><span class="identifier">clone_as</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;()</span></code>
+ method instead and save some typing:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">Cat</span> <span class="special">*</span><span class="identifier">cloned</span> <span class="special">=</span> <span class="identifier">cat</span><span class="special">-&gt;</span><span class="identifier">clone_as</span><span class="special">&lt;</span><span class="identifier">Cat</span><span class="special">&gt;();</span>
+</pre>
+<p>
+ </p>
+<p>
+ We now add other animals to the hierachy, including the use of multiple inheritance:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">Dog</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">cloneable</span><span class="special">::</span><span class="identifier">base</span><span class="special">&lt;</span><span class="identifier">Dog</span><span class="special">,</span> <span class="identifier">Animal</span><span class="special">&gt;</span>
+<span class="special">{</span>
+<span class="special">};</span>
+
+<span class="keyword">class</span> <span class="identifier">Labrador</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">Dog</span><span class="special">,</span> <span class="keyword">public</span> <span class="identifier">cloneable</span><span class="special">::</span><span class="identifier">base</span><span class="special">&lt;</span><span class="identifier">Labrador</span><span class="special">,</span> <span class="identifier">Animal</span><span class="special">&gt;</span>
+<span class="special">{</span>
+<span class="special">};</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">Labrador</span> <span class="special">*</span><span class="identifier">lab</span> <span class="special">=</span> <span class="keyword">new</span> <span class="identifier">Labrador</span><span class="special">();</span>
+ <span class="identifier">Dog</span> <span class="special">*</span><span class="identifier">dog</span> <span class="special">=</span> <span class="identifier">lab</span><span class="special">-&gt;</span><span class="identifier">clone_as</span><span class="special">&lt;</span><span class="identifier">Dog</span><span class="special">&gt;();</span>
+ <span class="identifier">Labrador</span> <span class="special">*</span><span class="identifier">cloned_lab</span> <span class="special">=</span> <span class="identifier">lab</span><span class="special">-&gt;</span><span class="identifier">clone_as</span><span class="special">&lt;</span><span class="identifier">Labrador</span><span class="special">&gt;();</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ Here we see that class Labrador is-a Dog, and is also cloneable as a Labrador.
+ When cloning this class, we specify which sub-object we wish to duplicate.
+ Note that when using <code class="computeroutput"><span class="identifier">clone_as</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span></code>,
+ we actually are making a type of T, rather than making another type and casting
+ up.
+ </p>
+<p>
+ We can also use the Cloneable library to make a new instance, without duplication:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">Animal</span> <span class="special">*</span><span class="identifier">MakeNew</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">cloneable</span><span class="special">::</span><span class="identifier">abstract_base</span><span class="special">&lt;</span><span class="identifier">Animal</span><span class="special">&gt;</span> <span class="special">&amp;</span><span class="identifier">animal</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">animal</span><span class="special">.</span><span class="identifier">create_new</span><span class="special">();</span>
+<span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">Cat</span> <span class="special">*</span><span class="identifier">cat</span> <span class="special">=</span> <span class="keyword">new</span> <span class="identifier">Cat</span><span class="special">();</span>
+ <span class="identifier">Animal</span> <span class="special">*</span><span class="identifier">new_animal</span> <span class="special">=</span> <span class="identifier">MakeNew</span><span class="special">(*</span><span class="identifier">cat</span><span class="special">);</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="keyword">typeid</span><span class="special">(*</span><span class="identifier">new_animal</span><span class="special">)</span> <span class="special">==</span> <span class="keyword">typeid</span><span class="special">(</span><span class="identifier">Cat</span><span class="special">));</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ This will create a new derived animal type (not a new base), and return a
+ pointer to the base. Here we used a free-function to make the new object,
+ to show how to use the <code class="computeroutput"><span class="identifier">abstract_base</span></code>
+ template. We used <code class="computeroutput"><span class="identifier">abstract_base</span><span class="special">&lt;</span><span class="identifier">Animal</span><span class="special">&gt;</span></code>, rather than just <code class="computeroutput"><span class="identifier">Animal</span></code>,
+ as the base type argument for the <code class="computeroutput"><span class="identifier">MakeNew</span></code>
+ function. This is because the base class we provided, <code class="computeroutput"><span class="identifier">Animal</span></code>,
+ does not derive from anything and does not have any clone-related methods.
+ These methods are added by the <code class="computeroutput"><span class="identifier">abstract_base</span><span class="special">&lt;&gt;</span></code> mixin, which all derived <code class="computeroutput"><span class="identifier">Animal</span></code>s are implicitly convertible to.
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 Christian Schladetsch<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../tutorial.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="using_external_types.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/using_custom_allocators.html
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/using_custom_allocators.html 2009-07-02 02:11:04 EDT (Thu, 02 Jul 2009)
@@ -0,0 +1,125 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Using Custom Allocators</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<link rel="home" href="../../index.html" title="Cloneable 0.1">
+<link rel="up" href="../tutorial.html" title="Basic Usage">
+<link rel="prev" href="customising_the_cloning_process.html" title="Customising the Cloning Process">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="customising_the_cloning_process.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a>
+</div>
+<div class="section" title="Using Custom Allocators">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="cloneable.tutorial.using_custom_allocators"></a><a class="link" href="using_custom_allocators.html" title="Using Custom Allocators">Using Custom
+ Allocators</a>
+</h3></div></div></div>
+<p>
+ The entire <span class="emphasis"><em>Cloneable</em></span> system was designed to support
+ general allocators. This provides more fine-tuned control for the cloning
+ and creation operations, and ensures Cloneable types work well in containers.
+ When making a new object or sub-object or clone or sub-clone, the underlying
+ <code class="computeroutput"><span class="identifier">abstract_base</span></code> is given a
+ reference to an <code class="computeroutput"><span class="identifier">abstract_allocator</span></code>.
+ This is an interface (containing only pure virtual methods) that is used
+ to expose a specialised <code class="computeroutput"><span class="identifier">allocator</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span></code>
+ to the non-specific <code class="computeroutput"><span class="identifier">abstract_base</span></code>.
+ This process is easy to understand with some examples:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;</span> <span class="identifier">alloc</span><span class="special">;</span>
+ <span class="identifier">Cat</span> <span class="special">*</span><span class="identifier">cat</span> <span class="special">=</span> <span class="identifier">cloneable</span><span class="special">::</span><span class="identifier">create</span><span class="special">&lt;</span><span class="identifier">Cat</span><span class="special">&gt;(</span><span class="identifier">alloc</span><span class="special">);</span> <span class="comment">// create a Cat using the allocator
+</span> <span class="identifier">Cat</span> <span class="special">*</span><span class="identifier">dupe</span> <span class="special">=</span> <span class="identifier">cat</span><span class="special">-&gt;</span><span class="identifier">clone_as</span><span class="special">&lt;</span><span class="identifier">Cat</span><span class="special">&gt;(</span><span class="identifier">alloc</span><span class="special">);</span> <span class="comment">// clone using the same allocator
+</span>
+ <span class="identifier">my_allocator</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;</span> <span class="identifier">my_alloc</span><span class="special">;</span>
+ <span class="identifier">Cat</span> <span class="special">*</span><span class="identifier">dup2</span> <span class="special">=</span> <span class="identifier">cat</span><span class="special">-&gt;</span><span class="identifier">clone_as</span><span class="special">&lt;</span><span class="identifier">Cat</span><span class="special">&gt;(</span><span class="identifier">my_alloc</span><span class="special">);</span> <span class="comment">// clone using another allocator
+</span> <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ As you can see, most of the internals can be safely ignored. From this, it
+ becomes clear that if you write a clone override, you should do so for the
+ method that takes an <code class="computeroutput"><span class="identifier">abstract_allocator</span>
+ <span class="special">&amp;</span></code>, rather than just always use
+ the heap:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">Foo</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">cloneable</span><span class="special">::</span><span class="identifier">base</span><span class="special">&lt;</span><span class="identifier">Foo</span><span class="special">&gt;</span>
+<span class="special">{</span>
+ <span class="comment">// over-ride the make_copy method, providing our own means to make a clone
+</span> <span class="identifier">Foo</span> <span class="special">*</span><span class="identifier">make_copy</span><span class="special">(</span><span class="identifier">cloneable</span><span class="special">::</span><span class="identifier">abstract_allocator</span> <span class="special">&amp;</span><span class="identifier">amp</span><span class="special">;</span><span class="identifier">alloc</span><span class="special">)</span> <span class="keyword">const</span>
+ <span class="special">{</span>
+ <span class="identifier">Foo</span> <span class="special">*</span><span class="identifier">copy</span> <span class="special">=</span> <span class="identifier">cloneable</span><span class="special">::</span><span class="identifier">create</span><span class="special">&lt;</span><span class="identifier">Foo</span><span class="special">&gt;(</span><span class="identifier">alloc</span><span class="special">);</span>
+
+ <span class="comment">// write values to copy from this; use alloc for any further required allocations
+</span>
+ <span class="keyword">return</span> <span class="identifier">copy</span><span class="special">;</span>
+ <span class="special">}</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<p>
+ Recall that if your class can be correctly copy-constructed, you do not need
+ to provide a custom clone override at all. If your class members that have
+ value semantics and can be copy-constructed (including <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">containers</span></code>,
+ and heterogenous::containers), then you do not need to provide any customisation.
+ </p>
+<p>
+ However, if your class containers pointers of any description, or references,
+ then you will in general have to provide a sensible copy-constructor, or
+ provide a custom clone override.
+ </p>
+<p>
+ In summary, there are three stages of customisation:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ If your class has types with value semantics, the compiler-generated default
+ copy constructor will suffice.
+ </li>
+<li class="listitem">
+ If your class has types that need explicit construction, making a copy-constructor
+ for your class will suffice to make clones.
+ </li>
+<li class="listitem">
+ If your class has members that contain references, or require allocation,
+ then you should override <code class="computeroutput"><span class="identifier">make_copy</span></code>
+ and construct the members in the copy instance, using the supplied abstract_allocator.
+ </li>
+</ul></div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 Christian Schladetsch<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="customising_the_cloning_process.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a>
+</div>
+</body>
+</html>

Added: sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/using_external_types.html
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/html/cloneable/tutorial/using_external_types.html 2009-07-02 02:11:04 EDT (Thu, 02 Jul 2009)
@@ -0,0 +1,74 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Using External Types</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<link rel="home" href="../../index.html" title="Cloneable 0.1">
+<link rel="up" href="../tutorial.html" title="Basic Usage">
+<link rel="prev" href="simple_hierarchical_cloning.html" title="Simple Hierarchical Cloning">
+<link rel="next" href="customising_the_cloning_process.html" title="Customising the Cloning Process">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="simple_hierarchical_cloning.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="customising_the_cloning_process.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Using External Types">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="cloneable.tutorial.using_external_types"></a><a class="link" href="using_external_types.html" title="Using External Types">Using External
+ Types</a>
+</h3></div></div></div>
+<p>
+ Quite often we find ourselves using classes that are defined in an external
+ library. These are not open to be changed, but we would still like them to
+ be Cloneable. To address this issue, we can use the <code class="computeroutput"><span class="identifier">cloneable</span><span class="special">::</span><span class="identifier">adaptor</span><span class="special">&lt;</span><span class="identifier">Type</span><span class="special">,</span><span class="identifier">Base</span><span class="special">&gt;</span></code>
+ structure:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">External</span> <span class="special">{</span> <span class="special">};</span> <span class="comment">// cannot be modified
+</span>
+<span class="keyword">class</span> <span class="identifier">MyBase</span> <span class="special">{</span> <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">MyBase</span><span class="special">()</span> <span class="special">{</span> <span class="special">}</span> <span class="special">};</span>
+
+<span class="keyword">typedef</span> <span class="identifier">cloneable</span><span class="special">::</span><span class="identifier">adaptor</span><span class="special">&lt;</span><span class="identifier">External</span><span class="special">,</span> <span class="identifier">MyBase</span><span class="special">&gt;</span> <span class="identifier">MyExternal</span><span class="special">;</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">MyExternal</span> <span class="special">*</span><span class="identifier">ex</span> <span class="special">=</span> <span class="keyword">new</span> <span class="identifier">MyExternal</span><span class="special">();</span>
+ <span class="identifier">MyExternal</span> <span class="special">*</span><span class="identifier">cloned</span> <span class="special">=</span> <span class="identifier">ex</span><span class="special">-&gt;</span><span class="identifier">clone_as</span><span class="special">&lt;</span><span class="identifier">MyExternal</span><span class="special">&gt;();</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ Alternatively of course, we could just make a new structure which either
+ derives from or encapsulates the external class. This will be necessary if
+ you wish to pass construction arguments to the external type, or provide
+ a custom clone method for it.
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 Christian Schladetsch<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="simple_hierarchical_cloning.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorial.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="customising_the_cloning_process.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/cloneable/libs/cloneable/doc/html/images/alert.png
==============================================================================
Binary file. No diff available.

Added: sandbox/cloneable/libs/cloneable/doc/html/images/blank.png
==============================================================================
Binary file. No diff available.

Added: sandbox/cloneable/libs/cloneable/doc/html/images/caution.png
==============================================================================
Binary file. No diff available.

Added: sandbox/cloneable/libs/cloneable/doc/html/images/draft.png
==============================================================================
Binary file. No diff available.

Added: sandbox/cloneable/libs/cloneable/doc/html/images/home.png
==============================================================================
Binary file. No diff available.

Added: sandbox/cloneable/libs/cloneable/doc/html/images/important.png
==============================================================================
Binary file. No diff available.

Added: sandbox/cloneable/libs/cloneable/doc/html/images/next.png
==============================================================================
Binary file. No diff available.

Added: sandbox/cloneable/libs/cloneable/doc/html/images/next_disabled.png
==============================================================================
Binary file. No diff available.

Added: sandbox/cloneable/libs/cloneable/doc/html/images/note.png
==============================================================================
Binary file. No diff available.

Added: sandbox/cloneable/libs/cloneable/doc/html/images/prev.png
==============================================================================
Binary file. No diff available.

Added: sandbox/cloneable/libs/cloneable/doc/html/images/prev_disabled.png
==============================================================================
Binary file. No diff available.

Added: sandbox/cloneable/libs/cloneable/doc/html/images/smiley.png
==============================================================================
Binary file. No diff available.

Added: sandbox/cloneable/libs/cloneable/doc/html/images/tip.png
==============================================================================
Binary file. No diff available.

Added: sandbox/cloneable/libs/cloneable/doc/html/images/toc-blank.png
==============================================================================
Binary file. No diff available.

Added: sandbox/cloneable/libs/cloneable/doc/html/images/toc-minus.png
==============================================================================
Binary file. No diff available.

Added: sandbox/cloneable/libs/cloneable/doc/html/images/toc-plus.png
==============================================================================
Binary file. No diff available.

Added: sandbox/cloneable/libs/cloneable/doc/html/images/up.png
==============================================================================
Binary file. No diff available.

Added: sandbox/cloneable/libs/cloneable/doc/html/images/up_disabled.png
==============================================================================
Binary file. No diff available.

Added: sandbox/cloneable/libs/cloneable/doc/html/images/warning.png
==============================================================================
Binary file. No diff available.

Added: sandbox/cloneable/libs/cloneable/doc/html/index.html
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/html/index.html 2009-07-02 02:11:04 EDT (Thu, 02 Jul 2009)
@@ -0,0 +1,65 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Cloneable 0.1</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<link rel="home" href="index.html" title="Cloneable 0.1">
+<link rel="next" href="cloneable/intro.html" title="Introduction">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav"><a accesskey="n" href="cloneable/intro.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a></div>
+<div class="article" title="Cloneable 0.1">
+<div class="titlepage">
+<div>
+<div><h2 class="title">
+<a name="cloneable"></a>Cloneable 0.1</h2></div>
+<div><div class="authorgroup"><div class="author"><h3 class="author">
+<span class="firstname">Christian</span> <span class="surname">Schladetsch</span>
+</h3></div></div></div>
+<div><p class="copyright">Copyright © 2009 Christian Schladetsch</p></div>
+<div><div class="legalnotice" title="Legal Notice">
+<a name="id669843"></a><p>
+ 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)
+ </p>
+</div></div>
+</div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"> Introduction</span></dt>
+<dt><span class="section"> Change Log</span></dt>
+<dt><span class="section"> Basic Usage</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="cloneable/tutorial/simple_hierarchical_cloning.html">Simple
+ Hierarchical Cloning</a></span></dt>
+<dt><span class="section"><a href="cloneable/tutorial/using_external_types.html">Using External
+ Types</a></span></dt>
+<dt><span class="section"><a href="cloneable/tutorial/customising_the_cloning_process.html">Customising
+ the Cloning Process</a></span></dt>
+<dt><span class="section"><a href="cloneable/tutorial/using_custom_allocators.html">Using Custom
+ Allocators</a></span></dt>
+</dl></dd>
+</dl>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"><p><small>Last revised: July 02, 2009 at 06:05:29 GMT</small></p></td>
+<td align="right"><div class="copyright-footer"></div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav"><a accesskey="n" href="cloneable/intro.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a></div>
+</body>
+</html>

Added: sandbox/cloneable/libs/cloneable/doc/html/standalone_HTML.manifest
==============================================================================
--- (empty file)
+++ sandbox/cloneable/libs/cloneable/doc/html/standalone_HTML.manifest 2009-07-02 02:11:04 EDT (Thu, 02 Jul 2009)
@@ -0,0 +1,8 @@
+index.html
+cloneable/intro.html
+cloneable/change_log.html
+cloneable/tutorial.html
+cloneable/tutorial/simple_hierarchical_cloning.html
+cloneable/tutorial/using_external_types.html
+cloneable/tutorial/customising_the_cloning_process.html
+cloneable/tutorial/using_custom_allocators.html


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk