Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54733 - in sandbox/monotonic/libs/monotonic/doc: . html html/images html/monotonic_storage html/monotonic_storage/containers html/monotonic_storage/tutorial
From: christian.schladetsch_at_[hidden]
Date: 2009-07-06 18:16:30


Author: cschladetsch
Date: 2009-07-06 18:16:28 EDT (Mon, 06 Jul 2009)
New Revision: 54733
URL: http://svn.boost.org/trac/boost/changeset/54733

Log:
added docs

Added:
   sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/containers/
   sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/containers.html (contents, props changed)
   sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/containers/chain.html (contents, props changed)
   sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/tutorial/monotonic_stack.html (contents, props changed)
Removed:
   sandbox/monotonic/libs/monotonic/doc/html/images/
Properties modified:
   sandbox/monotonic/libs/monotonic/doc/html/boostbook.css (props changed)
Text files modified:
   sandbox/monotonic/libs/monotonic/doc/html/index.html | 10 +-
   sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/change_log.html | 4
   sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/tutorial.html | 4
   sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/tutorial/using_multiple_containers.html | 12 +-
   sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/tutorial/using_regions.html | 22 +++---
   sandbox/monotonic/libs/monotonic/doc/html/standalone_HTML.manifest | 4
   sandbox/monotonic/libs/monotonic/doc/monotonic.qbk | 123 ++++++++++++++++++++++++++++-----------
   7 files changed, 119 insertions(+), 60 deletions(-)

Modified: sandbox/monotonic/libs/monotonic/doc/html/index.html
==============================================================================
--- sandbox/monotonic/libs/monotonic/doc/html/index.html (original)
+++ sandbox/monotonic/libs/monotonic/doc/html/index.html 2009-07-06 18:16:28 EDT (Mon, 06 Jul 2009)
@@ -28,7 +28,7 @@
 </h3></div></div></div>
 <div><p class="copyright">Copyright © 2009 Christian Schladetsch</p></div>
 <div><div class="legalnotice" title="Legal Notice">
-<a name="id674212"></a><p>
+<a name="id648979"></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>
@@ -47,14 +47,16 @@
 <dt><span class="section"><a href="monotonic_storage/tutorial/using_multiple_containers.html">Using
       Multiple Containers</a></span></dt>
 <dt><span class="section">Using Regions</span></dt>
-<dt><span class="section"><a href="monotonic_storage/tutorial/using_monotonic_storage.html">Using
- Monotonic Storage</a></span></dt>
+<dt><span class="section"><a href="monotonic_storage/tutorial/monotonic_stack.html">Monotonic
+ Stack</a></span></dt>
 </dl></dd>
+<dt><span class="section">Containers</span></dt>
+<dd><dl><dt><span class="section">Chain</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 05:34:02 GMT</small></p></td>
+<td align="left"><p><small>Last revised: July 06, 2009 at 21:55:04 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>

Modified: sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/change_log.html
==============================================================================
--- sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/change_log.html (original)
+++ sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/change_log.html 2009-07-06 18:16:28 EDT (Mon, 06 Jul 2009)
@@ -27,14 +27,14 @@
 <a name="monotonic_storage.change_log"></a><a class="link" href="change_log.html" title="Change Log"> Change Log</a>
 </h2></div></div></div>
 <a name="monotonic_storage.change_log.version_0_4"></a><h4>
-<a name="id674318"></a>
+<a name="id649084"></a>
       <a class="link" href="change_log.html#monotonic_storage.change_log.version_0_4">Version 0.4</a>
     </h4>
 <div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
         Added reclaimable storage
       </li></ul></div>
 <a name="monotonic_storage.change_log.version_0_3"></a><h4>
-<a name="id674338"></a>
+<a name="id649105"></a>
       <a class="link" href="change_log.html#monotonic_storage.change_log.version_0_3">Version 0.3</a>
     </h4>
 <div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">

Added: sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/containers.html
==============================================================================
--- (empty file)
+++ sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/containers.html 2009-07-06 18:16:28 EDT (Mon, 06 Jul 2009)
@@ -0,0 +1,105 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>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="Monotonic Storage 0.3">
+<link rel="up" href="../index.html" title="Monotonic Storage 0.3">
+<link rel="prev" href="tutorial/monotonic_stack.html" title="Monotonic Stack">
+<link rel="next" href="containers/chain.html" title="Chain">
+</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/monotonic_stack.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="containers/chain.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Containers">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="monotonic_storage.containers"></a><a class="link" href="containers.html" title="Containers">Containers</a>
+</h2></div></div></div>
+<div class="toc"><dl><dt><span class="section">Chain</span></dt></dl></div>
+<p>
+ Along with an allocator, storage and stack system, the Monotonic library provides
+ a set of containers that use stateful monotonic allocators
+ <sup>[<a name="id654617" href="#ftn.id654617" class="footnote">1</a>]</sup>
+ .
+ </p>
+<p>
+ These containers are able to use locally defined monotonic storage that is
+ not visible outside of a given stack-frame. As such, these are ideal for small,
+ fast, short-lived containers.
+ </p>
+<p>
+ An example:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">monotonic</span><span class="special">::</span><span class="identifier">storage</span><span class="special">&lt;&gt;</span> <span class="identifier">storage</span><span class="special">;</span>
+<span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">monotonic</span><span class="special">::</span><span class="identifier">list</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;</span> <span class="identifier">List</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">monotonic</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">monotonic</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">Map</span><span class="special">;</span>
+
+ <span class="identifier">Map</span> <span class="identifier">map</span><span class="special">(</span><span class="identifier">storage</span><span class="special">);</span>
+ <span class="identifier">List</span> <span class="identifier">list</span><span class="special">(</span><span class="identifier">storage</span><span class="special">);</span>
+
+ <span class="identifier">generate_n</span><span class="special">(</span><span class="identifier">back_inserter</span><span class="special">(</span><span class="identifier">list</span><span class="special">),</span> <span class="number">100</span><span class="special">,</span> <span class="identifier">rand</span><span class="special">);</span>
+ <span class="keyword">for</span> <span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">n</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">n</span> <span class="special">&lt;</span> <span class="number">100</span><span class="special">;</span> <span class="special">++</span><span class="identifier">n</span><span class="special">)</span>
+ <span class="special">{</span>
+ <span class="keyword">int</span> <span class="identifier">random</span> <span class="special">=</span> <span class="identifier">rand</span><span class="special">()</span> <span class="special">%</span> <span class="number">10</span><span class="special">;</span>
+
+ <span class="identifier">Map</span><span class="special">::</span><span class="identifier">iterator</span> <span class="identifier">iter</span> <span class="special">=</span> <span class="identifier">map</span><span class="special">.</span><span class="identifier">find</span><span class="special">(</span><span class="identifier">random</span><span class="special">);</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">iter</span> <span class="special">==</span> <span class="identifier">map</span><span class="special">.</span><span class="identifier">end</span><span class="special">())</span>
+ <span class="special">{</span>
+ <span class="identifier">iter</span> <span class="special">=</span> <span class="identifier">map</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span><span class="identifier">make_pair</span><span class="special">(</span><span class="identifier">random</span><span class="special">,</span> <span class="identifier">monotonic</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;(</span><span class="identifier">storage</span><span class="special">)).</span><span class="identifier">first</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="identifier">iter</span><span class="special">-&gt;</span><span class="identifier">second</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">rand</span><span class="special">);</span>
+ <span class="special">}</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ All of the standard containers are so adapted.
+ </p>
+<div class="note" title="Note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../doc/html/images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ If you have nested containers, and you wish them to use the same storage
+ as the parent container, you must initialise them with the storage as shown
+ in the example
+ </p></td></tr>
+</table></div>
+<div class="footnotes">
+<br><hr width="100" align="left">
+<div class="footnote"><p><sup>[<a name="ftn.id654617" href="#id654617" class="para">1</a>] </sup>
+ these are based on boost::interprocess::containers
+ </p></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>
+ 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/monotonic_stack.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="containers/chain.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/containers/chain.html
==============================================================================
--- (empty file)
+++ sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/containers/chain.html 2009-07-06 18:16:28 EDT (Mon, 06 Jul 2009)
@@ -0,0 +1,40 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Chain</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="Monotonic Storage 0.3">
+<link rel="up" href="../containers.html" title="Containers">
+<link rel="prev" href="../containers.html" title="Containers">
+</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="../containers.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../containers.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="Chain"><div class="titlepage"><div><div><h3 class="title">
+<a name="monotonic_storage.containers.chain"></a><a class="link" href="chain.html" title="Chain">Chain</a>
+</h3></div></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>
+ 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="../containers.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../containers.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>

Modified: sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/tutorial.html
==============================================================================
--- sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/tutorial.html (original)
+++ sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/tutorial.html 2009-07-06 18:16:28 EDT (Mon, 06 Jul 2009)
@@ -31,8 +31,8 @@
 <dt><span class="section"><a href="tutorial/using_multiple_containers.html">Using
       Multiple Containers</a></span></dt>
 <dt><span class="section">Using Regions</span></dt>
-<dt><span class="section"><a href="tutorial/using_monotonic_storage.html">Using
- Monotonic Storage</a></span></dt>
+<dt><span class="section"><a href="tutorial/monotonic_stack.html">Monotonic
+ Stack</a></span></dt>
 </dl></div>
 <p>
       This tutorial progresses through the basic usage of the library, demonstrating

Added: sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/tutorial/monotonic_stack.html
==============================================================================
--- (empty file)
+++ sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/tutorial/monotonic_stack.html 2009-07-06 18:16:28 EDT (Mon, 06 Jul 2009)
@@ -0,0 +1,105 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Monotonic Stack</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="Monotonic Storage 0.3">
+<link rel="up" href="../tutorial.html" title="Tutorial">
+<link rel="prev" href="using_regions.html" title="Using Regions">
+<link rel="next" href="../containers.html" title="Containers">
+</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_regions.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="../containers.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Monotonic Stack">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="monotonic_storage.tutorial.monotonic_stack"></a><a class="link" href="monotonic_stack.html" title="Monotonic Stack">Monotonic
+ Stack</a>
+</h3></div></div></div>
+<p>
+ While monotonic allocators use monotonic storage, we can also use this storage
+ directly and wherever we want efficient resource management.
+ </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="comment">// define local storage of 4k on the stack.
+</span> <span class="comment">// allocations will use the heap after the inline stack-based storage
+</span> <span class="comment">// has been exhausted.
+</span> <span class="keyword">typedef</span> <span class="identifier">monotonic</span><span class="special">::</span><span class="identifier">stack</span><span class="special">&lt;</span><span class="number">4</span><span class="special">*</span><span class="number">1024</span><span class="special">&gt;</span> <span class="identifier">Stack</span><span class="special">;</span>
+ <span class="identifier">Stack</span> <span class="identifier">stack</span><span class="special">;</span>
+ <span class="special">{</span>
+ <span class="keyword">int</span> <span class="special">&amp;</span><span class="identifier">num</span> <span class="special">=</span> <span class="identifier">stack</span><span class="special">.</span><span class="identifier">push</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;();</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span><span class="identifier">str</span> <span class="special">=</span> <span class="identifier">stack</span><span class="special">.</span><span class="identifier">push</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&gt;(</span><span class="string">"foo"</span><span class="special">);</span> <span class="comment">// objects are created in-place on the stack
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">array</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">,</span> <span class="number">1000</span><span class="special">&gt;</span> <span class="special">&amp;</span><span class="identifier">bytes</span> <span class="special">=</span> <span class="identifier">stack</span><span class="special">.</span><span class="identifier">push_array</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">,</span> <span class="number">1000</span><span class="special">&gt;();</span>
+
+ <span class="comment">// use bytes
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">generate_n</span><span class="special">(</span><span class="identifier">bytes</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="number">1000</span><span class="special">,</span> <span class="identifier">rand</span><span class="special">);</span>
+
+ <span class="comment">// pop them off the stack
+</span> <span class="identifier">stack</span><span class="special">.</span><span class="identifier">pop</span><span class="special">();</span>
+
+ <span class="keyword">float</span> <span class="special">&amp;</span><span class="identifier">num2</span> <span class="special">=</span> <span class="identifier">stack</span><span class="special">.</span><span class="identifier">push</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">&gt;();</span>
+ <span class="identifier">stack</span><span class="special">.</span><span class="identifier">pop</span><span class="special">();</span>
+
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">stack</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">2</span><span class="special">);</span>
+
+ <span class="identifier">BOOST_FOREACH</span><span class="special">(</span><span class="identifier">Stack</span><span class="special">::</span><span class="identifier">value_type</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="identifier">elem</span><span class="special">,</span> <span class="identifier">stack</span><span class="special">)</span>
+ <span class="special">{</span>
+ <span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">elem</span><span class="special">.</span><span class="identifier">get_type</span><span class="special">().</span><span class="identifier">name</span><span class="special">()</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
+ <span class="special">}</span>
+
+ <span class="identifier">DoSomethingElseWith</span><span class="special">(</span><span class="identifier">stack</span><span class="special">);</span>
+
+ <span class="comment">// can copy stacks, but cannot compare them
+</span> <span class="identifier">Stack</span> <span class="identifier">copy</span> <span class="special">=</span> <span class="identifier">stack</span><span class="special">;</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>
+ <code class="computeroutput"><span class="identifier">monotonic</span><span class="special">::</span><span class="identifier">stack</span><span class="special">&lt;&gt;</span></code>
+ is just like your very own C++ stack which you can share between objects
+ and functions and even across process boundaries, independantly of the underlying
+ machine-based stack. They can be copied and compared and iterated over.
+ </p>
+<p>
+ Also unlike the stack, storage will use the heap when its local inline stack-based
+ buffer is exhuasted. This makes it ideal for using things like local buffers
+ and containers that generally will be small enough to fit onto the stack,
+ but with the fallback safety of transparently using the heap to service later
+ requests for the cases where that inline buffer is not large enough.
+ </p>
+<p>
+ When the stack goes out of scope, all objects are automatically destroyed.
+ </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_regions.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="../containers.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Modified: sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/tutorial/using_multiple_containers.html
==============================================================================
--- sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/tutorial/using_multiple_containers.html (original)
+++ sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/tutorial/using_multiple_containers.html 2009-07-06 18:16:28 EDT (Mon, 06 Jul 2009)
@@ -37,13 +37,13 @@
 <pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
 <span class="special">{</span>
     <span class="special">{</span>
- <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">monotonic</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="special">&gt;</span> <span class="identifier">Vector</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">Vector</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">less</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;,</span> <span class="identifier">monotonic</span><span class="special">::</span><span class="identifier">allocator</span><span class="special">&lt;</span><span class="identifier">Vector</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">Map</span><span class="special">;</span>
- <span class="identifier">Map</span> <span class="identifier">map</span><span class="special">;</span>
- <span class="keyword">for</span> <span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">n</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">n</span> <span class="special">&lt;</span> <span class="number">10000</span><span class="special">;</span> <span class="special">++</span><span class="identifier">n</span><span class="special">)</span>
- <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">monotonic</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="special">&gt;</span> <span class="identifier">Vector</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">Vector</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">less</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;,</span> <span class="identifier">monotonic</span><span class="special">::</span><span class="identifier">allocator</span><span class="special">&lt;</span><span class="identifier">Vector</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">Map</span><span class="special">;</span>
+ <span class="identifier">Map</span> <span class="identifier">map</span><span class="special">;</span>
+ <span class="keyword">for</span> <span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">n</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">n</span> <span class="special">&lt;</span> <span class="number">10000</span><span class="special">;</span> <span class="special">++</span><span class="identifier">n</span><span class="special">)</span>
+ <span class="special">{</span>
             <span class="identifier">map</span><span class="special">[</span><span class="identifier">rand</span><span class="special">()%</span><span class="number">100</span><span class="special">].</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">n</span><span class="special">);</span>
- <span class="special">}</span>
+ <span class="special">}</span>
     <span class="special">}</span>
     <span class="identifier">monotonic</span><span class="special">::</span><span class="identifier">static_storage</span><span class="special">&lt;&gt;::</span><span class="identifier">release</span><span class="special">();</span>
     <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>

Modified: sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/tutorial/using_regions.html
==============================================================================
--- sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/tutorial/using_regions.html (original)
+++ sandbox/monotonic/libs/monotonic/doc/html/monotonic_storage/tutorial/using_regions.html 2009-07-06 18:16:28 EDT (Mon, 06 Jul 2009)
@@ -7,7 +7,7 @@
 <link rel="home" href="../../index.html" title="Monotonic Storage 0.3">
 <link rel="up" href="../tutorial.html" title="Tutorial">
 <link rel="prev" href="using_multiple_containers.html" title="Using Multiple Containers">
-<link rel="next" href="using_monotonic_storage.html" title="Using Monotonic Storage">
+<link rel="next" href="monotonic_stack.html" title="Monotonic Stack">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr>
@@ -20,7 +20,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="using_multiple_containers.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_monotonic_storage.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="using_multiple_containers.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="monotonic_stack.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
 </div>
 <div class="section" title="Using Regions">
 <div class="titlepage"><div><div><h3 class="title">
@@ -81,14 +81,14 @@
 <span class="keyword">public</span><span class="special">:</span>
     <span class="keyword">void</span> <span class="identifier">update</span><span class="special">()</span>
     <span class="special">{</span>
- <span class="special">{</span>
- <span class="identifier">Objects</span> <span class="identifier">objects</span><span class="special">;</span>
- <span class="identifier">GatherRelevant</span><span class="special">(</span><span class="identifier">objects</span><span class="special">);</span>
- <span class="identifier">Process</span><span class="special">(</span><span class="identifier">objects</span><span class="special">);</span>
- <span class="identifier">Update</span><span class="special">(</span><span class="identifier">objects</span><span class="special">);</span>
- <span class="special">}</span>
- <span class="comment">// reset storage, ready for next update
-</span> <span class="identifier">monotonic</span><span class="special">::</span><span class="identifier">static_storage</span><span class="special">&lt;</span><span class="identifier">region</span><span class="special">&gt;::</span><span class="identifier">reset</span><span class="special">();</span>
+ <span class="special">{</span>
+ <span class="identifier">Objects</span> <span class="identifier">objects</span><span class="special">;</span>
+ <span class="identifier">GatherRelevant</span><span class="special">(</span><span class="identifier">objects</span><span class="special">);</span>
+ <span class="identifier">Process</span><span class="special">(</span><span class="identifier">objects</span><span class="special">);</span>
+ <span class="identifier">Update</span><span class="special">(</span><span class="identifier">objects</span><span class="special">);</span>
+ <span class="special">}</span>
+ <span class="comment">// reset storage, ready for next update
+</span> <span class="identifier">monotonic</span><span class="special">::</span><span class="identifier">static_storage</span><span class="special">&lt;</span><span class="identifier">region</span><span class="special">&gt;::</span><span class="identifier">reset</span><span class="special">();</span>
     <span class="special">}</span>
 <span class="special">};</span>
 </pre>
@@ -113,7 +113,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="using_multiple_containers.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_monotonic_storage.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="using_multiple_containers.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="monotonic_stack.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Modified: sandbox/monotonic/libs/monotonic/doc/html/standalone_HTML.manifest
==============================================================================
--- sandbox/monotonic/libs/monotonic/doc/html/standalone_HTML.manifest (original)
+++ sandbox/monotonic/libs/monotonic/doc/html/standalone_HTML.manifest 2009-07-06 18:16:28 EDT (Mon, 06 Jul 2009)
@@ -5,4 +5,6 @@
 monotonic_storage/tutorial/basic_usage.html
 monotonic_storage/tutorial/using_multiple_containers.html
 monotonic_storage/tutorial/using_regions.html
-monotonic_storage/tutorial/using_monotonic_storage.html
+monotonic_storage/tutorial/monotonic_stack.html
+monotonic_storage/containers.html
+monotonic_storage/containers/chain.html

Modified: sandbox/monotonic/libs/monotonic/doc/monotonic.qbk
==============================================================================
--- sandbox/monotonic/libs/monotonic/doc/monotonic.qbk (original)
+++ sandbox/monotonic/libs/monotonic/doc/monotonic.qbk 2009-07-06 18:16:28 EDT (Mon, 06 Jul 2009)
@@ -173,13 +173,13 @@
 int main()
 {
     {
- typedef std::vector<int, monotonic::allocator<int> > Vector;
- typedef std::map<int, Vector, std::less<int>, monotonic::allocator<Vector> > Map;
- Map map;
- for (size_t n = 0; n < 10000; ++n)
- {
+ typedef std::vector<int, monotonic::allocator<int> > Vector;
+ typedef std::map<int, Vector, std::less<int>, monotonic::allocator<Vector> > Map;
+ Map map;
+ for (size_t n = 0; n < 10000; ++n)
+ {
             map[rand()%100].push_back(n);
- }
+ }
     }
     monotonic::static_storage<>::release();
     return 0;
@@ -246,14 +246,14 @@
 public:
     void update()
     {
- {
- Objects objects;
- GatherRelevant(objects);
- Process(objects);
- Update(objects);
- }
- // reset storage, ready for next update
- monotonic::static_storage<region>::reset();
+ {
+ Objects objects;
+ GatherRelevant(objects);
+ Process(objects);
+ Update(objects);
+ }
+ // reset storage, ready for next update
+ monotonic::static_storage<region>::reset();
     }
 };
 ``
@@ -266,7 +266,7 @@
 
 [endsect]
 
-[section Using Monotonic Storage]
+[section Monotonic Stack]
 
 While monotonic allocators use monotonic storage, we can also use this storage
 directly and wherever we want efficient resource management.
@@ -277,40 +277,95 @@
     // define local storage of 4k on the stack.
     // allocations will use the heap after the inline stack-based storage
     // has been exhausted.
- monotonic::storage<4*1024> storage;
+ typedef monotonic::stack<4*1024> Stack;
+ Stack stack;
     {
- int &amp;num = storage.create<int>();
- std::string &amp;str = storage.create<std::string>();
- char *bytes = storage.allocate_bytes(3000);
-
- // use num, str, bytes as needed
-
- // call std::string's destructor directly, or use storage.destroy
- storage.destroy(str);
+ int &num = stack.push<int>();
+ std::string &str = stack.push<std::string>("foo"); // objects are created in-place on the stack
+ boost::array<char, 1000> &bytes = stack.push_array<char, 1000>();
+
+ // use bytes
+ std::generate_n(bytes.begin(), 1000, rand);
+
+ // pop them off the stack
+ stack.pop();
+
+ float &num2 = stack.push<float>();
+ stack.pop();
+
+ assert(stack.size() == 2);
+
+ BOOST_FOREACH(Stack::value_type const &elem, stack)
+ {
+ cout << elem.get_type().name() << endl;
+ }
+
+ DoSomethingElseWith(stack);
+
+ // can copy stacks, but cannot compare them
+ Stack copy = stack;
     }
     return 0;
 }
 ``
 
-Of course, we could have just made `num`, `str` and `bytes` on the stack by declaring them as
-local variables and be done with it - well, except for having a dynamically-sized array of bytes
-on the stack. There is no other functional difference in this case, except that you are
-responsible for invoking object destructors. So how is this at all useful?
-
-We can use `monotonic::storage` as a form of "first-class scope" which can be created,
-manipulated, passed as as argument, returned as a value or reference, and destroyed as needed.
-
-In this sense, `monotonic::storage` is just like your very own C++ stack which you can share
+`monotonic::stack<>` is just like your very own C++ stack which you can share
 between objects and functions and even across process boundaries, independantly of the
-underlying machine-based stack.
+underlying machine-based stack. They can be copied and compared and iterated over.
 
 Also unlike the stack, storage will use the heap when its local inline stack-based buffer is exhuasted.
 This makes it ideal for using things like local buffers and containers that generally will be small
 enough to fit onto the stack, but with the fallback safety of transparently using the heap to
 service later requests for the cases where that inline buffer is not large enough.
 
+When the stack goes out of scope, all objects are automatically destroyed.
+
 [endsect]
 
 
 [endsect]
 
+[section Containers]
+
+Along with an allocator, storage and stack system, the Monotonic library provides a set of containers
+that use stateful monotonic allocators [footnote these are based on boost::interprocess::containers].
+
+These containers are able to use locally defined monotonic storage that is not visible outside
+of a given stack-frame. As such, these are ideal for small, fast, short-lived containers.
+
+An example:
+
+``
+monotonic::storage<> storage;
+{
+ typedef monotonic::list<int> List;
+ typedef monotonic::map<int, monotonic::vector<int> > Map;
+
+ Map map(storage);
+ List list(storage);
+
+ generate_n(back_inserter(list), 100, rand);
+ for (size_t n = 0; n < 100; ++n)
+ {
+ int random = rand() % 10;
+
+ Map::iterator iter = map.find(random);
+ if (iter == map.end())
+ {
+ iter = map.insert(make_pair(random, monotonic::vector<int>(storage)).first;
+ }
+ iter->second.push_back(rand);
+ }
+}
+``
+
+All of the standard containers are so adapted.
+
+[note If you have nested containers, and you wish them to use the same storage as the parent
+container, you must initialise them with the storage as shown in the example]
+
+[section Chain]
+
+[endsect]
+
+[endsect]
\ No newline at end of file


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