2
0
mirror of https://github.com/boostorg/pool.git synced 2026-02-24 04:12:11 +00:00

Fixed license & copyright issues and converted to HTML 4.01

[SVN r36274]
This commit is contained in:
Andreas Huber
2006-12-05 12:01:31 +00:00
parent 8f25aa08bf
commit 3893e9eae8
31 changed files with 4257 additions and 1929 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,24 +1,28 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>ct_gcd_lcm - Compile-Time GCD and LCM</TITLE>
<LINK HREF="../pool.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<IMG SRC="../../../../boost.png" WIDTH=276 HEIGHT=86 ALT="C++ Boost">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<link href="../pool.css" rel="stylesheet" type="text/css">
<H1 ALIGN=CENTER>ct_gcd_lcm - Compile-Time GCD and LCM</H1>
<title>ct_gcd_lcm - Compile-Time GCD and LCM</title>
</head>
<P>
<H2>Introduction</H2>
<body>
<img src="../../../../boost.png" width="276" height="86" alt="C++ Boost">
<P>
detail/ct_gcd_lcm.hpp provides two compile-time algorithms: greatest common divisor and least common multiple.
<h1 align="center">ct_gcd_lcm - Compile-Time GCD and LCM</h1>
<P>
<H2>Synopsis</H2>
<PRE CLASS="code">namespace details {
<h2>Introduction</h2>
<p>detail/ct_gcd_lcm.hpp provides two compile-time algorithms: greatest
common divisor and least common multiple.</p>
<h2>Synopsis</h2>
<pre class="code">
namespace details {
namespace pool {
template &lt;unsigned A, unsigned B&gt;
@@ -33,62 +37,120 @@ struct ct_lcm
};
} // namespace pool
} // namespace details</PRE>
} // namespace details
</pre>
<P>
<H2>Semantics</H2>
<h2>Semantics</h2>
<TABLE ALIGN=CENTER BORDER>
<CAPTION><EM>Symbol Table</EM></CAPTION>
<TR><TH>Symbol<TH>Meaning</TR>
<TR><TD CLASS="code">A, B<TD>compile-time unsigned integer constants<A HREF="#5.19/1"><SUP>[5.19/1]</SUP></A></TR>
</TABLE>
<table align="center" border summary="">
<caption>
<em>Symbol Table</em>
</caption>
<TABLE ALIGN=CENTER BORDER>
<CAPTION><EM>Semantics</EM></CAPTION>
<TR><TH>Expression<TH>Result Type<TH>Value<TH>Precondition
<TR><TD CLASS="code">ct_gcd&lt;A, B&gt;::value<TD>compile-time unsigned integer constant<TD>The greatest common divisor of <SPAN CLASS="code">A</SPAN> and <SPAN CLASS="code">B</SPAN><TD CLASS="code">A != 0 &amp;&amp; B != 0
<TR><TD CLASS="code">ct_lcm&lt;A, B&gt;::value<TD>compile-time unsigned integer constant<TD>The least common multiple of <SPAN CLASS="code">A</SPAN> and <SPAN CLASS="code">B</SPAN><TD CLASS="code">A != 0 &amp;&amp; B != 0
</TABLE>
<tr>
<th>Symbol</th>
<P>
<H2>Notes</H2>
<th>Meaning</th>
</tr>
<P>
Since these are compile-time algorithms, violation of the preconditions will result in a compile-time error.
<tr>
<td class="code">A, B</td>
<P>
<H2>Dependencies</H2>
<td>compile-time unsigned integer constants<a href=
"#s519p1"><sup>[5.19/1]</sup></a></td>
</tr>
</table><br>
<UL>
<LI>&lt;boost/static_assert.hpp&gt; (see <A HREF="../../../static_assert/static_assert.htm">Boost.Static_Assert</A>), to ensure preconditions are met.</LI>
<LI>&lt;boost/type_traits/ice.hpp&gt; (see <A HREF="../../../../more/int_const_guidelines.htm">Coding Guidelines for Integral Constant Expressions</A>), to help with portability.</LI>
</UL>
<table align="center" border summary="">
<caption>
<em>Semantics</em>
</caption>
<P>
<H2>Selected Quotations from the Standard</H2>
<tr>
<th>Expression</th>
<P>
<A NAME="5.19/1">
<STRONG>5.19/1: Expressions: Constant Expressions:</STRONG> &quot;. . . An <EM>integral constant expression</EM> can involve only literals (2.13), enumerators, <SPAN CLASS="code">const</SPAN> variables or static data members of integral or enumeration types initialized with constant expressions (8.5), non-type template parameters of integral or enumeration types, and <SPAN CLASS="code">sizeof</SPAN> expressions. Floating literals (2.13.3) can appear only if they are cast to integral or enumeration types. Only type conversions to integral or enumeration types can be used. In particular, except in <SPAN CLASS="code">sizeof</SPAN> expressions, functions, class objects, pointers, or references shall not be used, and assignment, increment, decrement, function-call, or comma operators shall not be used.&quot;</A>
<th>Result Type</th>
<P>
<H2>Future Directions</H2>
<th>Value</th>
<P>
This header may be replaced by a Boost compile-time algorithms library.
<th>Precondition</th>
</tr>
<P>
<HR>
<tr>
<td class="code">ct_gcd&lt;A, B&gt;::value</td>
<P>
Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT com)
<td>compile-time unsigned integer constant</td>
<P>
This file can be redistributed and/or modified under the terms found in <A HREF="../copyright.html">copyright.html</A>
<td>The greatest common divisor of <span class="code">A</span> and
<span class="code">B</span></td>
<P>
This software and its documentation is provided &quot;as is&quot; without express or implied warranty, and with no claim as to its suitability for any purpose.
<td class="code">A != 0 &amp;&amp; B != 0</td>
</tr>
</BODY>
</HTML>
<tr>
<td class="code">ct_lcm&lt;A, B&gt;::value</td>
<td>compile-time unsigned integer constant</td>
<td>The least common multiple of <span class="code">A</span> and
<span class="code">B</span></td>
<td class="code">A != 0 &amp;&amp; B != 0</td>
</tr>
</table>
<h2>Notes</h2>
<p>Since these are compile-time algorithms, violation of the preconditions
will result in a compile-time error.</p>
<h2>Dependencies</h2>
<ul>
<li>&lt;boost/static_assert.hpp&gt; (see <a href=
"../../../static_assert/static_assert.htm">Boost.Static_Assert</a>), to
ensure preconditions are met.</li>
<li>&lt;boost/type_traits/ice.hpp&gt; (see <a href=
"../../../../more/int_const_guidelines.htm">Coding Guidelines for
Integral Constant Expressions</a>), to help with portability.</li>
</ul>
<h2>Selected Quotations from the Standard</h2>
<p><a name="s519p1" id="s519p1"></a><strong>5.19/1: Expressions: Constant
Expressions:</strong> ". . . An <em>integral constant expression</em> can
involve only literals (2.13), enumerators, <span class="code">const</span>
variables or static data members of integral or enumeration types
initialized with constant expressions (8.5), non-type template parameters
of integral or enumeration types, and <span class="code">sizeof</span>
expressions. Floating literals (2.13.3) can appear only if they are cast to
integral or enumeration types. Only type conversions to integral or
enumeration types can be used. In particular, except in <span class=
"code">sizeof</span> expressions, functions, class objects, pointers, or
references shall not be used, and assignment, increment, decrement,
function-call, or comma operators shall not be used."</p>
<h2>Future Directions</h2>
<p>This header may be replaced by a Boost compile-time algorithms
library.</p>
<hr>
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
"http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05
December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
<p><i>Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT
com)</i></p>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
or copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>

View File

@@ -1,75 +1,179 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>for - m4 FOR Macro</TITLE>
<LINK HREF="../pool.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<IMG SRC="../../../../boost.png" WIDTH=276 HEIGHT=86 ALT="C++ Boost">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<link href="../pool.css" rel="stylesheet" type="text/css">
<H1 ALIGN=CENTER>for - m4 FOR Macro</H1>
<title>for - m4 FOR Macro</title>
</head>
<P>
<H2>Introduction</H2>
<body>
<img src="../../../../boost.png" width="276" height="86" alt="C++ Boost">
<P>
detail/for.m4 provides <SPAN CLASS="code">BOOST_M4_FOR</SPAN>, an <STRONG>m4</STRONG> macro that provides the equivalent of a <SPAN CLASS="code">#for</SPAN> preprocessor instruction.
<h1 align="center">for - m4 FOR Macro</h1>
<P>
<H2>Usage</H2>
<h2>Introduction</h2>
<P>
This macro must be used by an <STRONG>m4</STRONG> file. This file assumes that the option <SPAN CLASS="code">-P</SPAN> is used, to force an <SPAN CLASS="code">m4_</SPAN> prefix on all builtin symbols.
<p>detail/for.m4 provides <span class="code">BOOST_M4_FOR</span>, an
<strong>m4</strong> macro that provides the equivalent of a <span class=
"code">#for</span> preprocessor instruction.</p>
<P>
<H2>Arguments</H2>
<h2>Usage</h2>
<OL>
<LI>The name of a variable to hold the current value.</LI>
<LI>The starting value of the variable.</LI>
<LI>The ending value of the variable.</LI>
<LI>The text to repeat. This text may contain references to the variable, which will be replaced with the variable's current value.</LI>
<LI>The delimeter text (optional).</LI>
</OL>
<p>This macro must be used by an <strong>m4</strong> file. This file
assumes that the option <span class="code">-P</span> is used, to force an
<span class="code">m4_</span> prefix on all builtin symbols.</p>
<P>
If called with the wrong number of arguments (less than 4 or more than 5), <SPAN CLASS="code">BOOST_M4_FOR</SPAN> will exit with an error. If the starting value (<SPAN CLASS="code">$2</SPAN>) is greater than or equal to the ending value (<SPAN CLASS="code">$3</SPAN>), <SPAN CLASS="code">BOOST_M4_FOR</SPAN> will do nothing. Otherwise, it will repeat the text (<SPAN CLASS="code">$4</SPAN>), binding the variable (<SPAN CLASS="code">$1</SPAN>) to the values in the range [starting value (<SPAN CLASS="code">$2</SPAN>), ending value (<SPAN CLASS="code">$3</SPAN>)), and repeat the delimeter text (<SPAN CLASS="code">$5</SPAN>) in-between each occurrence of the repeat text (<SPAN CLASS="code">$4</SPAN>).
<h2>Arguments</h2>
<P>
<H2>Examples</H2>
<ol>
<li>The name of a variable to hold the current value.</li>
<P>
Note of the quotation marks (<SPAN CLASS="m4">&quot;</SPAN>) used in the table below are in the input or output; they are shown to delimit whitespace. All code within a pair of quotation marks is intended to be on one line.
<li>The starting value of the variable.</li>
<P>
<TABLE BORDER ALIGN="center">
<TR><TH>Input<TH>Output</TR>
<TR><TD CLASS="m4">&quot;BOOST_M4_FOR(i, 1, 3)&quot;<TD>Boost m4 script: BOOST_M4_FOR: Wrong number of arguments (3)</TR>
<TR><TD CLASS="m4">&quot;BOOST_M4_FOR(i, 1, 3, i, ` ', 13)&quot;<TD>Boost m4 script: BOOST_M4_FOR: Wrong number of arguments (6)</TR>
<TR><TD CLASS="m4">&quot;BOOST_M4_FOR(i, 7, 0, i )&quot;<TD>(nothing)</TR>
<TR><TD CLASS="m4">&quot;BOOST_M4_FOR(i, 0, 0, i )&quot;<TD>(nothing)</TR>
<TR><TD CLASS="m4">&quot;BOOST_M4_FOR(i, 0, 7, i )&quot;<TD CLASS="m4">&quot;0 1 2 3 4 5 6 &quot;</TR>
<TR><TD CLASS="m4">&quot;BOOST_M4_FOR(i, -13, -10, i )&quot;<TD CLASS="m4">&quot;-13 -12 -11 &quot;</TR>
<TR><TD CLASS="m4">&quot;BOOST_M4_FOR(i, 0, 8, BOOST_M4_FOR(j, 0, 4, (i, j) )&quot;<BR>&quot;)&quot;<TD CLASS="m4">&quot;(0, 0) (0, 1) (0, 2) (0, 3) &quot;<BR>&quot;(1, 0) (1, 1) (1, 2) (1, 3) &quot;<BR>&quot;(2, 0) (2, 1) (2, 2) (2, 3) &quot;<BR>&quot;(3, 0) (3, 1) (3, 2) (3, 3) &quot;<BR>&quot;(4, 0) (4, 1) (4, 2) (4, 3) &quot;<BR>&quot;(5, 0) (5, 1) (5, 2) (5, 3) &quot;<BR>&quot;(6, 0) (6, 1) (6, 2) (6, 3) &quot;<BR>&quot;(7, 0) (7, 1) (7, 2) (7, 3) &quot;<BR>&quot;&quot;</TR>
<TR><TD CLASS="m4">&quot;BOOST_M4_FOR(i, 7, 0, i, |)&quot;<TD>(nothing)</TR>
<TR><TD CLASS="m4">&quot;BOOST_M4_FOR(i, 0, 0, i, |)&quot;<TD>(nothing)</TR>
<TR><TD CLASS="m4">&quot;BOOST_M4_FOR(i, 0, 7, i, |)&quot;<TD CLASS="m4">&quot;0|1|2|3|4|5|6&quot;</TR>
<TR><TD CLASS="m4">&quot;BOOST_M4_FOR(i, -13, -10, i, `, ')&quot;<TD CLASS="m4">&quot;-13, -12, -11&quot;</TR>
<TR><TD CLASS="m4">&quot;BOOST_M4_FOR(i, 0, 8, `[BOOST_M4_FOR(j, 0, 4, (i, j), `, ')]', `,&quot;<BR>&quot;')&quot;<TD CLASS="m4">&quot;[(0, 0), (0, 1), (0, 2), (0, 3)],&quot;<BR>&quot;[(1, 0), (1, 1), (1, 2), (1, 3)],&quot;<BR>&quot;[(2, 0), (2, 1), (2, 2), (2, 3)],&quot;<BR>&quot;[(3, 0), (3, 1), (3, 2), (3, 3)],&quot;<BR>&quot;[(4, 0), (4, 1), (4, 2), (4, 3)],&quot;<BR>&quot;[(5, 0), (5, 1), (5, 2), (5, 3)],&quot;<BR>&quot;[(6, 0), (6, 1), (6, 2), (6, 3)],&quot;<BR>&quot;[(7, 0), (7, 1), (7, 2), (7, 3)]&quot;</TR>
</TABLE>
<li>The ending value of the variable.</li>
<P>
<HR>
<li>The text to repeat. This text may contain references to the variable,
which will be replaced with the variable's current value.</li>
<P>
Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT com)
<li>The delimeter text (optional).</li>
</ol>
<P>
This file can be redistributed and/or modified under the terms found in <A HREF="../copyright.html">copyright.html</A>
<p>If called with the wrong number of arguments (less than 4 or more than
5), <span class="code">BOOST_M4_FOR</span> will exit with an error. If the
starting value (<span class="code">$2</span>) is greater than or equal to
the ending value (<span class="code">$3</span>), <span class=
"code">BOOST_M4_FOR</span> will do nothing. Otherwise, it will repeat the
text (<span class="code">$4</span>), binding the variable (<span class=
"code">$1</span>) to the values in the range [starting value (<span class=
"code">$2</span>), ending value (<span class="code">$3</span>)), and repeat
the delimeter text (<span class="code">$5</span>) in-between each
occurrence of the repeat text (<span class="code">$4</span>).</p>
<P>
This software and its documentation is provided &quot;as is&quot; without express or implied warranty, and with no claim as to its suitability for any purpose.
<h2>Examples</h2>
</BODY>
</HTML>
<p>Note of the quotation marks (<span class="m4">"</span>) used in the
table below are in the input or output; they are shown to delimit
whitespace. All code within a pair of quotation marks is intended to be on
one line.</p>
<table border align="center" summary="">
<tr>
<th>Input</th>
<th>Output</th>
</tr>
<tr>
<td class="m4">"BOOST_M4_FOR(i, 1, 3)"</td>
<td>Boost m4 script: BOOST_M4_FOR: Wrong number of arguments (3)</td>
</tr>
<tr>
<td class="m4">"BOOST_M4_FOR(i, 1, 3, i, ` ', 13)"</td>
<td>Boost m4 script: BOOST_M4_FOR: Wrong number of arguments (6)</td>
</tr>
<tr>
<td class="m4">"BOOST_M4_FOR(i, 7, 0, i )"</td>
<td>(nothing)</td>
</tr>
<tr>
<td class="m4">"BOOST_M4_FOR(i, 0, 0, i )"</td>
<td>(nothing)</td>
</tr>
<tr>
<td class="m4">"BOOST_M4_FOR(i, 0, 7, i )"</td>
<td class="m4">"0 1 2 3 4 5 6 "</td>
</tr>
<tr>
<td class="m4">"BOOST_M4_FOR(i, -13, -10, i )"</td>
<td class="m4">"-13 -12 -11 "</td>
</tr>
<tr>
<td class="m4">"BOOST_M4_FOR(i, 0, 8, BOOST_M4_FOR(j, 0, 4, (i, j)
)"<br>
")"</td>
<td class="m4">"(0, 0) (0, 1) (0, 2) (0, 3) "<br>
"(1, 0) (1, 1) (1, 2) (1, 3) "<br>
"(2, 0) (2, 1) (2, 2) (2, 3) "<br>
"(3, 0) (3, 1) (3, 2) (3, 3) "<br>
"(4, 0) (4, 1) (4, 2) (4, 3) "<br>
"(5, 0) (5, 1) (5, 2) (5, 3) "<br>
"(6, 0) (6, 1) (6, 2) (6, 3) "<br>
"(7, 0) (7, 1) (7, 2) (7, 3) "<br>
""</td>
</tr>
<tr>
<td class="m4">"BOOST_M4_FOR(i, 7, 0, i, |)"</td>
<td>(nothing)</td>
</tr>
<tr>
<td class="m4">"BOOST_M4_FOR(i, 0, 0, i, |)"</td>
<td>(nothing)</td>
</tr>
<tr>
<td class="m4">"BOOST_M4_FOR(i, 0, 7, i, |)"</td>
<td class="m4">"0|1|2|3|4|5|6"</td>
</tr>
<tr>
<td class="m4">"BOOST_M4_FOR(i, -13, -10, i, `, ')"</td>
<td class="m4">"-13, -12, -11"</td>
</tr>
<tr>
<td class="m4">"BOOST_M4_FOR(i, 0, 8, `[BOOST_M4_FOR(j, 0, 4, (i, j),
`, ')]', `,"<br>
"')"</td>
<td class="m4">"[(0, 0), (0, 1), (0, 2), (0, 3)],"<br>
"[(1, 0), (1, 1), (1, 2), (1, 3)],"<br>
"[(2, 0), (2, 1), (2, 2), (2, 3)],"<br>
"[(3, 0), (3, 1), (3, 2), (3, 3)],"<br>
"[(4, 0), (4, 1), (4, 2), (4, 3)],"<br>
"[(5, 0), (5, 1), (5, 2), (5, 3)],"<br>
"[(6, 0), (6, 1), (6, 2), (6, 3)],"<br>
"[(7, 0), (7, 1), (7, 2), (7, 3)]"</td>
</tr>
</table>
<hr>
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
"http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05
December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
<p><i>Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT
com)</i></p>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
or copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>

View File

@@ -1,24 +1,28 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>gcd_lcm - GCD and LCM</TITLE>
<LINK HREF="../pool.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<IMG SRC="../../../../boost.png" WIDTH=276 HEIGHT=86 ALT="C++ Boost">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<link href="../pool.css" rel="stylesheet" type="text/css">
<H1 ALIGN=CENTER>gcd_lcm - GCD and LCM</H1>
<title>gcd_lcm - GCD and LCM</title>
</head>
<P>
<H2>Introduction</H2>
<body>
<img src="../../../../boost.png" width="276" height="86" alt="C++ Boost">
<P>
detail/gcd_lcm.hpp provides two generic integer algorithms: greatest common divisor and least common multiple.
<h1 align="center">gcd_lcm - GCD and LCM</h1>
<P>
<H2>Synopsis</H2>
<PRE CLASS="code">namespace details {
<h2>Introduction</h2>
<p>detail/gcd_lcm.hpp provides two generic integer algorithms: greatest
common divisor and least common multiple.</p>
<h2>Synopsis</h2>
<pre class="code">
namespace details {
namespace pool {
template &lt;typename Integer&gt;
@@ -28,54 +32,100 @@ template &lt;typename Integer&gt;
Integer lcm(Integer A, Integer B);
} // namespace pool
} // namespace details</PRE>
} // namespace details
</pre>
<P>
<H2>Semantics</H2>
<h2>Semantics</h2>
<TABLE ALIGN=CENTER BORDER>
<CAPTION><EM>Symbol Table</EM></CAPTION>
<TR><TH>Symbol<TH>Meaning</TR>
<TR><TD CLASS="code">Integer<TD>An integral type</TR>
<TR><TD CLASS="code">A, B<TD>Values of type <SPAN CLASS="code">Integer</SPAN></TR>
</TABLE>
<table align="center" border summary="">
<caption>
<em>Symbol Table</em>
</caption>
<TABLE ALIGN=CENTER BORDER>
<CAPTION><EM>Semantics</EM></CAPTION>
<TR><TH>Expression<TH>Result Type<TH>Precondition<TH>Notes
<TR><TD CLASS="code">gcd(A, B)<TD>Integer<TD CLASS="code">A &gt; 0 &amp;&amp; B &gt; 0<TD>Returns the greatest common divisor of <SPAN CLASS="code">A</SPAN> and <SPAN CLASS="code">B</SPAN>
<TR><TD CLASS="code">lcm(A, B)<TD>Integer<TD CLASS="code">A &gt; 0 &amp;&amp; B &gt; 0<TD>Returns the least common multiple of <SPAN CLASS="code">A</SPAN> and <SPAN CLASS="code">B</SPAN>
</TABLE>
<tr>
<th>Symbol</th>
<P>
<H2>Implementation Notes</H2>
<th>Meaning</th>
</tr>
<P>
For faster results, ensure <SPAN CLASS="code">A &gt; B</SPAN>
<tr>
<td class="code">Integer</td>
<P>
<H2>Dependencies</H2>
<td>An integral type</td>
</tr>
<P>
None.
<tr>
<td class="code">A, B</td>
<P>
<H2>Future Directions</H2>
<td>Values of type <span class="code">Integer</span></td>
</tr>
</table><br>
<P>
This header may be replaced by a Boost algorithms library.
<table align="center" border summary="">
<caption>
<em>Semantics</em>
</caption>
<P>
<HR>
<tr>
<th>Expression</th>
<P>
Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT com)
<th>Result Type</th>
<P>
This file can be redistributed and/or modified under the terms found in <A HREF="../copyright.html">copyright.html</A>
<th>Precondition</th>
<P>
This software and its documentation is provided &quot;as is&quot; without express or implied warranty, and with no claim as to its suitability for any purpose.
<th>Notes</th>
</tr>
</BODY>
</HTML>
<tr>
<td class="code">gcd(A, B)</td>
<td>Integer</td>
<td class="code">A &gt; 0 &amp;&amp; B &gt; 0</td>
<td>Returns the greatest common divisor of <span class="code">A</span>
and <span class="code">B</span></td>
</tr>
<tr>
<td class="code">lcm(A, B)</td>
<td>Integer</td>
<td class="code">A &gt; 0 &amp;&amp; B &gt; 0</td>
<td>Returns the least common multiple of <span class="code">A</span>
and <span class="code">B</span></td>
</tr>
</table>
<h2>Implementation Notes</h2>
<p>For faster results, ensure <span class="code">A &gt; B</span></p>
<h2>Dependencies</h2>
<p>None.</p>
<h2>Future Directions</h2>
<p>This header may be replaced by a Boost algorithms library.</p>
<hr>
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
"http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05
December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
<p><i>Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT
com)</i></p>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
or copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>

View File

@@ -1,25 +1,31 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>guard - Auto-lock/unlock-er</TITLE>
<LINK HREF="../pool.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<IMG SRC="../../../../boost.png" WIDTH=276 HEIGHT=86 ALT="C++ Boost">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<link href="../pool.css" rel="stylesheet" type="text/css">
<H1 ALIGN=CENTER>guard - Auto-lock/unlock-er</H1>
<title>guard - Auto-lock/unlock-er</title>
</head>
<P>
<H2>Introduction</H2>
<body>
<img src="../../../../boost.png" width="276" height="86" alt="C++ Boost">
<P>
detail/guard.hpp provides a type <SPAN CLASS="code">guard&lt;Mutex&gt;</SPAN> that allows scoped access to the <SPAN CLASS="code">Mutex</SPAN>'s locking and unlocking operations. It is used to ensure that a <SPAN CLASS="code">Mutex</SPAN> is unlocked, even if an exception is thrown.
<h1 align="center">guard - Auto-lock/unlock-er</h1>
<P>
<H2>Synopsis</H2>
<h2>Introduction</h2>
<PRE CLASS="code">namespace details {
<p>detail/guard.hpp provides a type <span class=
"code">guard&lt;Mutex&gt;</span> that allows scoped access to the
<span class="code">Mutex</span>'s locking and unlocking operations. It is
used to ensure that a <span class="code">Mutex</span> is unlocked, even if
an exception is thrown.</p>
<h2>Synopsis</h2>
<pre class="code">
namespace details {
namespace pool {
template &lt;typename Mutex&gt;
@@ -35,77 +41,139 @@ class guard
};
} // namespace pool
} // namespace details</PRE>
} // namespace details
</pre>
<P>
<H2>Semantics</H2>
<h2>Semantics</h2>
<P>
<TABLE BORDER ALIGN=CENTER>
<CAPTION><EM>Symbol Table</EM></CAPTION>
<TR><TH>Symbol<TH>Meaning
<TR><TD CLASS="code">T<TD><SPAN CLASS="code">guard&lt;Mutex&gt;</SPAN>
<TR><TD CLASS="code">m<TD>value of type <SPAN CLASS="code">Mutex &amp;</SPAN>
<TR><TD CLASS="code">g<TD>value of type <SPAN CLASS="code">guard&lt;Mutex&gt;</SPAN>
</TABLE>
<table border align="center" summary="">
<caption>
<em>Symbol Table</em>
</caption>
<P>
<TABLE BORDER ALIGN=CENTER>
<CAPTION><EM>Requirements on <SPAN CLASS="code">Mutex</SPAN></EM></CAPTION>
<TR><TH>Expression<TH>Return Type<TH>Assertion/Note/Pre/Post-Condition
<TR><TD CLASS="code">m.lock()<TD>not used<TD>Locks the mutex referred to by <SPAN CLASS="code">m</SPAN>
<TR><TD CLASS="code">m.unlock()<TD>not used<TD>Unlocks the mutex referred to by <SPAN CLASS="code">m</SPAN>
</TABLE>
<tr>
<th>Symbol</th>
<P>
<TABLE BORDER ALIGN=CENTER>
<CAPTION><EM>Requirements satisfied by <SPAN CLASS="code">guard</SPAN></EM></CAPTION>
<TR><TH>Expression<TH>Assertion/Note/Pre/Post-Condition
<TR><TD CLASS="code">T(m)<TD>Locks the mutex referred to by <SPAN CLASS="code">m</SPAN>; binds <SPAN CLASS="code">T(m)</SPAN> to <SPAN CLASS="code">m</SPAN>
<TR><TD CLASS="code">(&amp;g)->~T()<TD>Unlocks the mutex that <SPAN CLASS="code">g</SPAN> is bound to
</TABLE>
<th>Meaning</th>
</tr>
<P>
<H2>Example</H2>
<tr>
<td class="code">T</td>
<P>
Given a (platform-specific) <SPAN CLASS="code">mutex</SPAN> class, we can wrap code as follows:
<PRE CLASS="code">extern mutex global_lock;
<td><span class="code">guard&lt;Mutex&gt;</span></td>
</tr>
<tr>
<td class="code">m</td>
<td>value of type <span class="code">Mutex &amp;</span></td>
</tr>
<tr>
<td class="code">g</td>
<td>value of type <span class="code">guard&lt;Mutex&gt;</span></td>
</tr>
</table><br>
<table border align="center" summary="">
<caption>
<em>Requirements on <span class="code">Mutex</span></em>
</caption>
<tr>
<th>Expression</th>
<th>Return Type</th>
<th>Assertion/Note/Pre/Post-Condition</th>
</tr>
<tr>
<td class="code">m.lock()</td>
<td>not used</td>
<td>Locks the mutex referred to by <span class="code">m</span></td>
</tr>
<tr>
<td class="code">m.unlock()</td>
<td>not used</td>
<td>Unlocks the mutex referred to by <span class="code">m</span></td>
</tr>
</table><br>
<table border align="center" summary="">
<caption>
<em>Requirements satisfied by <span class="code">guard</span></em>
</caption>
<tr>
<th>Expression</th>
<th>Assertion/Note/Pre/Post-Condition</th>
</tr>
<tr>
<td class="code">T(m)</td>
<td>Locks the mutex referred to by <span class="code">m</span>; binds
<span class="code">T(m)</span> to <span class="code">m</span></td>
</tr>
<tr>
<td class="code">(&amp;g)-&gt;~T()</td>
<td>Unlocks the mutex that <span class="code">g</span> is bound to</td>
</tr>
</table>
<h2>Example</h2>
<p>Given a (platform-specific) <span class="code">mutex</span> class, we
can wrap code as follows:</p>
<pre class="code">
extern mutex global_lock;
static void f()
{
boost::details::pool::guard&lt;mutex&gt; g(global_lock);
// g's constructor locks &quot;global_lock&quot;
// g's constructor locks "global_lock"
... // do anything:
// throw exceptions
// return
// or just fall through
} // g's destructor unlocks &quot;global_lock&quot;</PRE>
} // g's destructor unlocks "global_lock"
</pre>
<P>
<H2>Dependencies</H2>
<h2>Dependencies</h2>
<P>
None.
<p>None.</p>
<P>
<H2>Future Directions</H2>
<h2>Future Directions</h2>
<P>
This header will eventually be replaced by a Boost multithreading library.
<p>This header will eventually be replaced by a Boost multithreading
library.</p>
<hr>
<P>
<HR>
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
"http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<P>
Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT com)
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05
December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
<P>
This file can be redistributed and/or modified under the terms found in <A HREF="../copyright.html">copyright.html</A>
<p><i>Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT
com)</i></p>
<P>
This software and its documentation is provided &quot;as is&quot; without express or implied warranty, and with no claim as to its suitability for any purpose.
</BODY>
</HTML>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
or copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>

View File

@@ -1,31 +1,38 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>mutex - Mutex</TITLE>
<LINK HREF="../pool.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<IMG SRC="../../../../boost.png" WIDTH=276 HEIGHT=86 ALT="C++ Boost">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<link href="../pool.css" rel="stylesheet" type="text/css">
<H1 ALIGN=CENTER>mutex - Mutex</H1>
<title>mutex - Mutex</title>
</head>
<P>
<H2>Introduction</H2>
<body>
<img src="../../../../boost.png" width="276" height="86" alt="C++ Boost">
<P>
detail/mutex.hpp provides several mutex types that provide a consistent interface for OS-supplied mutex types. These are all thread-level mutexes; interprocess mutexes are not supported.
<h1 align="center">mutex - Mutex</h1>
<P>
<H2>Configuration</H2>
<h2>Introduction</h2>
<P>
This header file will try to guess what kind of system it is on. It will auto-configure itself for Win32 or POSIX+pthread systems. To stub out all mutex code, bypassing the auto-configuration, <SPAN CLASS="code">#define BOOST_NO_MT</SPAN> before any inclusion of this header. To prevent ODR violations, this should be defined in <STRONG>every</STRONG> translation unit in your project, including any library files.
<p>detail/mutex.hpp provides several mutex types that provide a consistent
interface for OS-supplied mutex types. These are all thread-level mutexes;
interprocess mutexes are not supported.</p>
<P>
<H2>Synopsis</H2>
<h2>Configuration</h2>
<PRE CLASS="code">namespace details {
<p>This header file will try to guess what kind of system it is on. It will
auto-configure itself for Win32 or POSIX+pthread systems. To stub out all
mutex code, bypassing the auto-configuration, <span class="code">#define
BOOST_NO_MT</span> before any inclusion of this header. To prevent ODR
violations, this should be defined in <strong>every</strong> translation
unit in your project, including any library files.</p>
<h2>Synopsis</h2>
<pre class="code">
namespace details {
namespace pool {
// Only present if on a Win32 system
@@ -77,53 +84,99 @@ class null_mutex
typedef ... default_mutex;
} // namespace pool
} // namespace details</PRE>
} // namespace details
</pre>
<P>
<H2>Semantics</H2>
<h2>Semantics</h2>
<P>
<TABLE BORDER ALIGN=CENTER>
<CAPTION><EM>Symbol Table</EM></CAPTION>
<TR><TH>Symbol<TH>Meaning
<TR><TD CLASS="code">Mutex<TD>Any type defined in this header
<TR><TD CLASS="code">t<TD>value of type <SPAN CLASS="code">Mutex</SPAN>
</TABLE>
<table border align="center" summary="">
<caption>
<em>Symbol Table</em>
</caption>
<P>
<TABLE BORDER ALIGN=CENTER>
<CAPTION><EM>Requirements satisfied by <SPAN CLASS="code">mutex</SPAN></EM></CAPTION>
<TR><TH>Expression<TH>Return Type<TH>Assertion/Note/Pre/Post-Condition
<TR><TD CLASS="code">m.lock()<TD>not used<TD>Locks the mutex
<TR><TD CLASS="code">m.unlock()<TD>not used<TD>Unlocks the mutex
</TABLE>
<tr>
<th>Symbol</th>
<P>
Each mutex is always either owned or unowned. If owned, then it is owned by a particular thread. To &quot;lock&quot; a mutex means to wait until the mutex is unowned, and then make it owned by the current thread. To &quot;unlock&quot; a mutex means to release ownership from the current thread (note that the current thread <STRONG>must</STRONG> own the mutex to release that ownership!). As a special case, the <SPAN CLASS="code">null_mutex</SPAN> never waits.
<th>Meaning</th>
</tr>
<P>
<H2>Dependencies</H2>
<tr>
<td class="code">Mutex</td>
<P>
May include the system headers <SPAN CLASS="code">&lt;windows.h&gt;</SPAN>, <SPAN CLASS="code">&lt;unistd.h&gt;</SPAN>, and/or <SPAN CLASS="code">&lt;pthread.h&gt;</SPAN>.
<td>Any type defined in this header</td>
</tr>
<P>
<H2>Future Directions</H2>
<tr>
<td class="code">t</td>
<P>
This header will eventually be replaced by a Boost multithreading library.
<td>value of type <span class="code">Mutex</span></td>
</tr>
</table><br>
<P>
<HR>
<table border align="center" summary="">
<caption>
<em>Requirements satisfied by <span class="code">mutex</span></em>
</caption>
<P>
Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT com)
<tr>
<th>Expression</th>
<P>
This file can be redistributed and/or modified under the terms found in <A HREF="../copyright.html">copyright.html</A>
<th>Return Type</th>
<P>
This software and its documentation is provided &quot;as is&quot; without express or implied warranty, and with no claim as to its suitability for any purpose.
<th>Assertion/Note/Pre/Post-Condition</th>
</tr>
</BODY>
</HTML>
<tr>
<td class="code">m.lock()</td>
<td>not used</td>
<td>Locks the mutex</td>
</tr>
<tr>
<td class="code">m.unlock()</td>
<td>not used</td>
<td>Unlocks the mutex</td>
</tr>
</table>
<p>Each mutex is always either owned or unowned. If owned, then it is owned
by a particular thread. To "lock" a mutex means to wait until the mutex is
unowned, and then make it owned by the current thread. To "unlock" a mutex
means to release ownership from the current thread (note that the current
thread <strong>must</strong> own the mutex to release that ownership!). As
a special case, the <span class="code">null_mutex</span> never waits.</p>
<h2>Dependencies</h2>
<p>May include the system headers <span class=
"code">&lt;windows.h&gt;</span>, <span class=
"code">&lt;unistd.h&gt;</span>, and/or <span class=
"code">&lt;pthread.h&gt;</span>.</p>
<h2>Future Directions</h2>
<p>This header will eventually be replaced by a Boost multithreading
library.</p>
<hr>
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
"http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05
December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
<p><i>Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT
com)</i></p>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
or copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>

View File

@@ -1,70 +1,85 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>Object Pool Implementation</TITLE>
<LINK HREF="../pool.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<IMG SRC="../../../../boost.png" WIDTH=276 HEIGHT=86 ALT="C++ Boost">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<link href="../pool.css" rel="stylesheet" type="text/css">
<H1 ALIGN=CENTER>Object Pool Implementation</H1>
<title>Object Pool Implementation</title>
</head>
<P>
<H2>Dependencies</H2>
<body>
<img src="../../../../boost.png" width="276" height="86" alt="C++ Boost">
<P>
Includes the Boost header <SPAN CLASS="code">&quot;pool.hpp&quot;</SPAN> (see <A HREF="pool.html">pool.html</A>).
<h1 align="center">Object Pool Implementation</h1>
<P>
<H2>Extensions to Public Interface</H2>
<h2>Dependencies</h2>
<P>
Whenever an object of type <SPAN CLASS="code">ObjectPool</SPAN> needs memory from the system, it will request it from its <SPAN CLASS="code">UserAllocator</SPAN> template parameter. The amount requested is determined using a doubling algorithm; that is, each time more system memory is allocated, the amount of system memory requested is doubled. Users may control the doubling algorithm by using the following extensions.
<p>Includes the Boost header <span class="code">"pool.hpp"</span> (see
<a href="pool.html">pool.html</a>).</p>
<P>
<H3>Additional constructor parameter</H3>
<h2>Extensions to Public Interface</h2>
<P>
Users may pass an additional constructor parameter to <SPAN CLASS="code">ObjectPool</SPAN>. This parameter is of type <SPAN CLASS="code">size_type</SPAN>, and is the number of chunks to request from the system the first time that object needs to allocate system memory. The default is 32. This parameter may not be 0.
<p>Whenever an object of type <span class="code">ObjectPool</span> needs
memory from the system, it will request it from its <span class=
"code">UserAllocator</span> template parameter. The amount requested is
determined using a doubling algorithm; that is, each time more system
memory is allocated, the amount of system memory requested is doubled.
Users may control the doubling algorithm by using the following
extensions.</p>
<P>
<H3><SPAN CLASS="code">next_size</SPAN> accessor functions</H3>
<h3>Additional constructor parameter</h3>
<P>
The pair of functions <SPAN CLASS="code">size_type get_next_size() const;</SPAN> and <SPAN CLASS="code">void set_next_size(size_type);</SPAN> allow users to explicitly read and write the <SPAN CLASS="code">next_size</SPAN> value. This value is the number of chunks to request from the system the next time that object needs to allocate system memory. This value should never be set to 0.
<p>Users may pass an additional constructor parameter to <span class=
"code">ObjectPool</span>. This parameter is of type <span class=
"code">size_type</span>, and is the number of chunks to request from the
system the first time that object needs to allocate system memory. The
default is 32. This parameter may not be 0.</p>
<P>
<H2>Protected Interface</H2>
<h3><span class="code">next_size</span> accessor functions</h3>
<P>
<H3>Synopsis</H3>
<p>The pair of functions <span class="code">size_type get_next_size()
const;</span> and <span class="code">void set_next_size(size_type);</span>
allow users to explicitly read and write the <span class=
"code">next_size</span> value. This value is the number of chunks to
request from the system the next time that object needs to allocate system
memory. This value should never be set to 0.</p>
<PRE CLASS="code">template &lt;typename ElementType, typename UserAllocator = default_user_allocator_new_delete&gt;
<h2>Protected Interface</h2>
<h3>Synopsis</h3>
<pre class="code">
template &lt;typename ElementType, typename UserAllocator = default_user_allocator_new_delete&gt;
class object_pool: protected pool&lt;UserAllocator&gt;
{
... // public interface
};</PRE>
};
</pre>
<P>
<H3>Protected Derivation</H3>
<h3>Protected Derivation</h3>ObjectPool derives from a simple segregated
storage via protected derivation; this exposes all the <a href=
"pool.html">Pool implementation details</a> to all classes derived from
ObjectPool as well.
ObjectPool derives from a simple segregated storage via protected derivation; this exposes all the <A HREF="pool.html">Pool implementation details</A> to all classes derived from ObjectPool as well.
<h2><a href="../interfaces/object_pool.html">Interface Description</a></h2>
<hr>
<P>
<H2><A HREF="../interfaces/object_pool.html">Interface Description</A></H2>
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
"http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<P>
<HR>
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05
December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
<P>
Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT com)
<p><i>Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT
com)</i></p>
<P>
This file can be redistributed and/or modified under the terms found in <A HREF="../copyright.html">copyright.html</A>
<P>
This software and its documentation is provided &quot;as is&quot; without express or implied warranty, and with no claim as to its suitability for any purpose.
</BODY>
</HTML>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
or copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>

View File

@@ -1,28 +1,39 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>Pool Implementation</TITLE>
<LINK HREF="../pool.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<IMG SRC="../../../../boost.png" WIDTH=276 HEIGHT=86 ALT="C++ Boost">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<link href="../pool.css" rel="stylesheet" type="text/css">
<H1 ALIGN=CENTER>Pool Implementation</H1>
<title>Pool Implementation</title>
</head>
<P>
<H2>Dependencies</H2>
<body>
<img src="../../../../boost.png" width="276" height="86" alt="C++ Boost">
<P>
Includes the system headers <SPAN CLASS="code">&lt;functional&gt;</SPAN>, <SPAN CLASS="code">&lt;new&gt;</SPAN>, <SPAN CLASS="code">&lt;cstddef&gt;</SPAN>, <SPAN CLASS="code">&lt;cstdlib&gt;</SPAN>, and <SPAN CLASS="code">&lt;exception&gt;</SPAN>.
<h1 align="center">Pool Implementation</h1>
<P>
Includes the Boost headers <SPAN CLASS="code">&quot;detail/ct_gcd_lcm.hpp&quot;</SPAN> (see <A HREF="ct_gcd_lcm.html">ct_gcd_lcm.html</A>), <SPAN CLASS="code">&quot;detail/gcd_lcm.hpp&quot;</SPAN> (see <A HREF="gcd_lcm.html">gcd_lcm.html</A>), and <SPAN CLASS="code">&quot;simple_segregated_storage.hpp&quot;</SPAN> (see <A HREF="simple_segregated_storage.html">simple_segregated_storage.html</A>).
<h2>Dependencies</h2>
<P>
<H2>Synopsis</H2>
<p>Includes the system headers <span class=
"code">&lt;functional&gt;</span>, <span class="code">&lt;new&gt;</span>,
<span class="code">&lt;cstddef&gt;</span>, <span class=
"code">&lt;cstdlib&gt;</span>, and <span class=
"code">&lt;exception&gt;</span>.</p>
<PRE CLASS="code">namespace details {
<p>Includes the Boost headers <span class=
"code">"detail/ct_gcd_lcm.hpp"</span> (see <a href=
"ct_gcd_lcm.html">ct_gcd_lcm.html</a>), <span class=
"code">"detail/gcd_lcm.hpp"</span> (see <a href=
"gcd_lcm.html">gcd_lcm.html</a>), and <span class=
"code">"simple_segregated_storage.hpp"</span> (see <a href=
"simple_segregated_storage.html">simple_segregated_storage.html</a>).</p>
<h2>Synopsis</h2>
<pre class="code">
namespace details {
template &lt;typename SizeType&gt;
class PODptr
@@ -37,17 +48,17 @@ class PODptr
bool valid() const;
void invalidate();
char * & begin();
char * &amp; begin();
char * begin() const;
char * end() const;
size_type total_size() const;
size_type element_size() const;
size_type & next_size() const;
char * & next_ptr() const;
size_type &amp; next_size() const;
char * &amp; next_ptr() const;
PODptr next() const;
void next(const PODptr & arg) const;
void next(const PODptr &amp; arg) const;
};
} // namespace details
@@ -60,8 +71,8 @@ class pool: protected simple_segregated_storage&lt;typename UserAllocator::size_
protected:
details::PODptr&lt;size_type&gt; list;
simple_segregated_storage&lt;size_type&gt; & store();
const simple_segregated_storage&lt;size_type&gt; & store() const;
simple_segregated_storage&lt;size_type&gt; &amp; store();
const simple_segregated_storage&lt;size_type&gt; &amp; store() const;
const size_type requested_size;
size_type next_size;
@@ -74,143 +85,201 @@ class pool: protected simple_segregated_storage&lt;typename UserAllocator::size_
pool(size_type requested_size, size_type next_size);
size_type get_next_size() const;
void set_next_size(size_type);
};</PRE>
};
</pre>
<P>
<H2>Extensions to Public Interface</H2>
<h2>Extensions to Public Interface</h2>
<P>
Whenever an object of type <SPAN CLASS="code">pool</SPAN> needs memory from the system, it will request it from its <SPAN CLASS="code">UserAllocator</SPAN> template parameter. The amount requested is determined using a doubling algorithm; that is, each time more system memory is allocated, the amount of system memory requested is doubled. Users may control the doubling algorithm by using the following extensions.
<p>Whenever an object of type <span class="code">pool</span> needs memory
from the system, it will request it from its <span class=
"code">UserAllocator</span> template parameter. The amount requested is
determined using a doubling algorithm; that is, each time more system
memory is allocated, the amount of system memory requested is doubled.
Users may control the doubling algorithm by using the following
extensions.</p>
<P>
<H3>Additional constructor parameter</H3>
<h3>Additional constructor parameter</h3>
<P>
Users may pass an additional constructor parameter to <SPAN CLASS="code">pool</SPAN>. This parameter is of type <SPAN CLASS="code">size_type</SPAN>, and is the number of chunks to request from the system the first time that object needs to allocate system memory. The default is 32. This parameter may not be 0.
<p>Users may pass an additional constructor parameter to <span class=
"code">pool</span>. This parameter is of type <span class=
"code">size_type</span>, and is the number of chunks to request from the
system the first time that object needs to allocate system memory. The
default is 32. This parameter may not be 0.</p>
<P>
<H3><SPAN CLASS="code">next_size</SPAN> accessor functions</H3>
<h3><span class="code">next_size</span> accessor functions</h3>
<P>
The pair of functions <SPAN CLASS="code">size_type get_next_size() const;</SPAN> and <SPAN CLASS="code">void set_next_size(size_type);</SPAN> allow users to explicitly read and write the <SPAN CLASS="code">next_size</SPAN> value. This value is the number of chunks to request from the system the next time that object needs to allocate system memory. This value should never be set to 0.
<p>The pair of functions <span class="code">size_type get_next_size()
const;</span> and <span class="code">void set_next_size(size_type);</span>
allow users to explicitly read and write the <span class=
"code">next_size</span> value. This value is the number of chunks to
request from the system the next time that object needs to allocate system
memory. This value should never be set to 0.</p>
<P>
<H2>Class <SPAN CLASS="code">PODptr</SPAN></H2>
<h2>Class <span class="code">PODptr</span></h2>
<P>
<SPAN CLASS="code">PODptr</SPAN> is a class that pretends to be a &quot;pointer&quot; to different class types that don't really exist. It provides member functions to access the &quot;data&quot; of the &quot;object&quot; it points to. Since these &quot;class&quot; types are of differing sizes, and contain some information at the end of their memory (for alignment reasons), <SPAN CLASS="code">PODptr</SPAN> must contain the size of this &quot;class&quot; as well as the pointer to this &quot;object&quot;.
<p><span class="code">PODptr</span> is a class that pretends to be a
"pointer" to different class types that don't really exist. It provides
member functions to access the "data" of the "object" it points to. Since
these "class" types are of differing sizes, and contain some information at
the end of their memory (for alignment reasons), <span class=
"code">PODptr</span> must contain the size of this "class" as well as the
pointer to this "object".</p>
<P>
A <SPAN CLASS="code">PODptr</SPAN> holds the location and size of a memory block allocated from the system. Each memory block is split logically into three sections:
<OL>
<LI>Chunk area. This section may be different sizes. <SPAN CLASS="code">PODptr</SPAN> does not care what the size of the chunks is, but it does care (and keep track of) the total size of the chunk area.</LI>
<LI>Next pointer. This section is always the same size for a given <SPAN CLASS="code">SizeType</SPAN>. It holds a pointer to the location of the next memory block in the memory block list, or 0 if there is no such block.</LI>
<LI>Next size. This section is always the same size for a given <SPAN CLASS="code">SizeType</SPAN>. It holds the size of the next memory block in the memory block list.</LI>
</OL>
<p>A <span class="code">PODptr</span> holds the location and size of a
memory block allocated from the system. Each memory block is split
logically into three sections:</p>
<P>
The <SPAN CLASS="code">PODptr</SPAN> class just provides cleaner ways of dealing with raw memory blocks.
<ol>
<li>Chunk area. This section may be different sizes. <span class=
"code">PODptr</span> does not care what the size of the chunks is, but it
does care (and keep track of) the total size of the chunk area.</li>
<P>
<H3>Validity</H3>
<li>Next pointer. This section is always the same size for a given
<span class="code">SizeType</span>. It holds a pointer to the location of
the next memory block in the memory block list, or 0 if there is no such
block.</li>
<P>
A <SPAN CLASS="code">PODptr</SPAN> object is either <EM>valid</EM> or <EM>invalid</EM>. An invalid <SPAN CLASS="code">PODptr</SPAN> is analogous to a null pointer.
<li>Next size. This section is always the same size for a given
<span class="code">SizeType</span>. It holds the size of the next memory
block in the memory block list.</li>
</ol>
<P>
The default constructor for <SPAN CLASS="code">PODptr</SPAN> will result in an invalid object. Calling the member function <SPAN CLASS="code">invalidate</SPAN> will result in that object becoming invalid. The member function <SPAN CLASS="code">valid</SPAN> can be used to test for validity.
<p>The <span class="code">PODptr</span> class just provides cleaner ways of
dealing with raw memory blocks.</p>
<P>
<H3>Getting <SPAN CLASS="code">PODptr</SPAN> objects</H3>
<h3>Validity</h3>
<P>
A <SPAN CLASS="code">PODptr</SPAN> may be created to point to a memory block by passing the address and size of that memory block into the constructor. A <SPAN CLASS="code">PODptr</SPAN> constructed in this way is valid.
<p>A <span class="code">PODptr</span> object is either <em>valid</em> or
<em>invalid</em>. An invalid <span class="code">PODptr</span> is analogous
to a null pointer.</p>
<P>
A <SPAN CLASS="code">PODptr</SPAN> may also be created by a call to the member function <SPAN CLASS="code">next</SPAN>, which returns a <SPAN CLASS="code">PODptr</SPAN> which points to the next memory block in the memory block list, or an invalid <SPAN CLASS="code">PODptr</SPAN> if there is no such block.
<p>The default constructor for <span class="code">PODptr</span> will result
in an invalid object. Calling the member function <span class=
"code">invalidate</span> will result in that object becoming invalid. The
member function <span class="code">valid</span> can be used to test for
validity.</p>
<P>
<H3>Accessing the &quot;pointer&quot; data</H3>
<h3>Getting <span class="code">PODptr</span> objects</h3>
<P>
Each <SPAN CLASS="code">PODptr</SPAN> keeps the address and size of its memory block. The address may be read or written by the member functions <SPAN CLASS="code">begin</SPAN>. The size of the memory block may only be read, and is done so by the member function <SPAN CLASS="code">total_size</SPAN>.
<p>A <span class="code">PODptr</span> may be created to point to a memory
block by passing the address and size of that memory block into the
constructor. A <span class="code">PODptr</span> constructed in this way is
valid.</p>
<P>
<H3>Accessing the sections of the memory block</H3>
<p>A <span class="code">PODptr</span> may also be created by a call to the
member function <span class="code">next</span>, which returns a
<span class="code">PODptr</span> which points to the next memory block in
the memory block list, or an invalid <span class="code">PODptr</span> if
there is no such block.</p>
<P>
The chunk area may be accessed by the member functions <SPAN CLASS="code">begin</SPAN> and <SPAN CLASS="code">end</SPAN>, in conjunction with <SPAN CLASS="code">element_size</SPAN>. The value returned by <SPAN CLASS="code">end</SPAN> is always the value returned by <SPAN CLASS="code">begin</SPAN> plus <SPAN CLASS="code">element_size</SPAN>. Only <SPAN CLASS="code">begin</SPAN> is writeable. <SPAN CLASS="code">end</SPAN> is a past-the-end value; using pointers beginning at <SPAN CLASS="code">begin</SPAN> and ending before <SPAN CLASS="code">end</SPAN> allows one to iterate through the chunks in a memory block.
<h3>Accessing the "pointer" data</h3>
<P>
The next pointer area may be accessed by the member function <SPAN CLASS="code">next_ptr</SPAN>. The next size area may be accessed by the member function <SPAN CLASS="code">next_size</SPAN>. Both of these are writeable. They may both be read or set at the same time through the member function <SPAN CLASS="code">next</SPAN>.
<p>Each <span class="code">PODptr</span> keeps the address and size of its
memory block. The address may be read or written by the member functions
<span class="code">begin</span>. The size of the memory block may only be
read, and is done so by the member function <span class=
"code">total_size</span>.</p>
<P>
<H2>Protected Interface</H2>
<h3>Accessing the sections of the memory block</h3>
<P>
<H3>Protected Derivation</H3>
<p>The chunk area may be accessed by the member functions <span class=
"code">begin</span> and <span class="code">end</span>, in conjunction with
<span class="code">element_size</span>. The value returned by <span class=
"code">end</span> is always the value returned by <span class=
"code">begin</span> plus <span class="code">element_size</span>. Only
<span class="code">begin</span> is writeable. <span class="code">end</span>
is a past-the-end value; using pointers beginning at <span class=
"code">begin</span> and ending before <span class="code">end</span> allows
one to iterate through the chunks in a memory block.</p>
Pool derives from a simple segregated storage via protected derivation; this exposes all the <A HREF="simple_segregated_storage.html">simple segregated storage implementation details</A> to all classes derived from Pool as well.
<p>The next pointer area may be accessed by the member function
<span class="code">next_ptr</span>. The next size area may be accessed by
the member function <span class="code">next_size</span>. Both of these are
writeable. They may both be read or set at the same time through the member
function <span class="code">next</span>.</p>
<P>
<H3 CLASS="code">details::PODptr&lt;size_type&gt; list;</H3>
<h2>Protected Interface</h2>
<P>
This is the list of memory blocks that have been allocated by this Pool object. It is <STRONG>not</STRONG> the same as the list of free memory chunks (exposed by simple segregated storage as <SPAN CLASS="code">first</SPAN>).
<h3>Protected Derivation</h3>Pool derives from a simple segregated storage
via protected derivation; this exposes all the <a href=
"simple_segregated_storage.html">simple segregated storage implementation
details</a> to all classes derived from Pool as well.
<P>
<H3><SPAN CLASS="code">store</SPAN> functions</H3>
<h3 class="code">details::PODptr&lt;size_type&gt; list;</h3>
<P>
These are convenience functions, used to return the base simple segregated storage object.
<p>This is the list of memory blocks that have been allocated by this Pool
object. It is <strong>not</strong> the same as the list of free memory
chunks (exposed by simple segregated storage as <span class=
"code">first</span>).</p>
<P>
<H3 CLASS="code">const size_type requested_size;</H3>
<h3><span class="code">store</span> functions</h3>
<P>
The first argument passed into the constructor. Represents the number of bytes in each chunk requested by the user. The actual size of the chunks may be different; see <SPAN CLASS="code">alloc_size</SPAN>, below.
<p>These are convenience functions, used to return the base simple
segregated storage object.</p>
<P>
<H3 CLASS="code">size_type next_size</H3>
<h3 class="code">const size_type requested_size;</h3>
<P>
The number of chunks to request from the <SPAN CLASS="code">UserAllocator</SPAN> the next time we need to allocate system memory. See the extensions descriptions, above.
<p>The first argument passed into the constructor. Represents the number of
bytes in each chunk requested by the user. The actual size of the chunks
may be different; see <span class="code">alloc_size</span>, below.</p>
<P>
<H3 CLASS="code">details::PODptr&lt;size_type&gt; find_POD(void * chunk) const;</H3>
<h3 class="code">size_type next_size</h3>
<P>
Searches through the memory block list, looking for the block that <SPAN CLASS="code">chunk</SPAN> was allocated from or may be allocated from in the future. Returns that block if found, or an invalid value if <SPAN CLASS="code">chunk</SPAN> has been allocated from another Pool or may be allocated from another Pool in the future. Results for other values of <SPAN CLASS="code">chunk</SPAN> may be wrong.
<p>The number of chunks to request from the <span class=
"code">UserAllocator</span> the next time we need to allocate system
memory. See the extensions descriptions, above.</p>
<P>
<H3 CLASS="code">static bool is_from(void * chunk, char * i, size_type sizeof_i);</H3>
<h3 class="code">details::PODptr&lt;size_type&gt; find_POD(void * chunk)
const;</h3>
<P>
Tests <SPAN CLASS="code">chunk</SPAN> to see if it has been allocated from the memory chunk at <SPAN CLASS="code">i</SPAN> with an element size of <SPAN CLASS="code">sizeof_i</SPAN>. Note that <SPAN CLASS="code">sizeof_i</SPAN> is the size of the chunk area of that block, not the total size of that block.
<p>Searches through the memory block list, looking for the block that
<span class="code">chunk</span> was allocated from or may be allocated from
in the future. Returns that block if found, or an invalid value if
<span class="code">chunk</span> has been allocated from another Pool or may
be allocated from another Pool in the future. Results for other values of
<span class="code">chunk</span> may be wrong.</p>
<P>
Returns <SPAN CLASS="code">true</SPAN> if <SPAN CLASS="code">chunk</SPAN> has been allocated from that memory block or may be allocated from that block in the future. Returns <SPAN CLASS="code">false</SPAN> if <SPAN CLASS="code">chunk</SPAN> has been allocated from another block or may be allocated from another block in the future. Results for other values of <SPAN CLASS="code">chunk</SPAN> may be wrong.
<h3 class="code">static bool is_from(void * chunk, char * i, size_type
sizeof_i);</h3>
<P>
<H3 CLASS="code">size_type alloc_size() const;</H3>
<p>Tests <span class="code">chunk</span> to see if it has been allocated
from the memory chunk at <span class="code">i</span> with an element size
of <span class="code">sizeof_i</span>. Note that <span class=
"code">sizeof_i</span> is the size of the chunk area of that block, not the
total size of that block.</p>
<P>
Returns the calculated size of the memory chunks that will be allocated by this Pool. For <A HREF="alignment.html">alignment reasons</A>, this is defined to be <SPAN CLASS="code">lcm(requested_size, sizeof(void *), sizeof(size_type))</SPAN>.
<p>Returns <span class="code">true</span> if <span class=
"code">chunk</span> has been allocated from that memory block or may be
allocated from that block in the future. Returns <span class=
"code">false</span> if <span class="code">chunk</span> has been allocated
from another block or may be allocated from another block in the future.
Results for other values of <span class="code">chunk</span> may be
wrong.</p>
<P>
<H2><A HREF="../interfaces/pool.html">Interface Description</A></H2>
<h3 class="code">size_type alloc_size() const;</h3>
<P>
<HR>
<p>Returns the calculated size of the memory chunks that will be allocated
by this Pool. For <a href="alignment.html">alignment reasons</a>, this is
defined to be <span class="code">lcm(requested_size, sizeof(void *),
sizeof(size_type))</span>.</p>
<P>
Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT com)
<h2><a href="../interfaces/pool.html">Interface Description</a></h2>
<hr>
<P>
This file can be redistributed and/or modified under the terms found in <A HREF="../copyright.html">copyright.html</A>
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
"http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<P>
This software and its documentation is provided &quot;as is&quot; without express or implied warranty, and with no claim as to its suitability for any purpose.
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05
December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
</BODY>
</HTML>
<p><i>Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT
com)</i></p>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
or copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>

View File

@@ -1,28 +1,35 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>pool_alloc - Boost Pool Standard Allocators Implementation</TITLE>
<LINK HREF="../pool.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<IMG SRC="../../../../boost.png" WIDTH=276 HEIGHT=86 ALT="C++ Boost">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<link href="../pool.css" rel="stylesheet" type="text/css">
<H1 ALIGN=CENTER>pool_alloc - Boost Pool Standard Allocators Implementation</H1>
<title>pool_alloc - Boost Pool Standard Allocators Implementation</title>
</head>
<P>
<H2>Dependencies</H2>
<body>
<img src="../../../../boost.png" width="276" height="86" alt="C++ Boost">
<P>
Includes the system headers <SPAN CLASS="code">&lt;new&gt;</SPAN> and <SPAN CLASS="code">&lt;limits&gt;</SPAN>.
<h1 align="center">pool_alloc - Boost Pool Standard Allocators
Implementation</h1>
<P>
Includes the Boost headers <SPAN CLASS="code">&quot;singleton_pool.hpp&quot;</SPAN> (see <A HREF="singleton_pool.html">singleton_pool.html</A>) and <SPAN CLASS="code">&quot;detail/mutex.hpp&quot;</SPAN> (see <A HREF="mutex.html">mutex.html</A>).
<h2>Dependencies</h2>
<P>
<H2>Synopsis</H2>
<p>Includes the system headers <span class="code">&lt;new&gt;</span> and
<span class="code">&lt;limits&gt;</span>.</p>
<PRE CLASS="code">template &lt;typename T,
<p>Includes the Boost headers <span class=
"code">"singleton_pool.hpp"</span> (see <a href=
"singleton_pool.html">singleton_pool.html</a>) and <span class=
"code">"detail/mutex.hpp"</span> (see <a href=
"mutex.html">mutex.html</a>).</p>
<h2>Synopsis</h2>
<pre class="code">
template &lt;typename T,
typename UserAllocator = default_user_allocator_new_delete,
typename Mutex = details::pool::default_mutex,
unsigned NextSize = 32&gt;
@@ -60,68 +67,77 @@ class fast_pool_allocator
{
typedef fast_pool_allocator&lt;U, UserAllocator, Mutex, NextSize&gt; other;
};
};</PRE>
};
</pre>
<P>
<H2>Extensions to Public Interface</H2>
<h2>Extensions to Public Interface</h2>
<P>
<H3>Additional template parameters</H3>
<h3>Additional template parameters</h3>
<P>
<H4 CLASS="code">Mutex</H4>
<h4 class="code">Mutex</h4>
<P>
This parameter allows the user to determine the type of synchronization to be used on the underlying singleton pool. See the extensions to the public interface of <A HREF="singleton_pool.html">singleton pool</A> for more information.
<p>This parameter allows the user to determine the type of synchronization
to be used on the underlying singleton pool. See the extensions to the
public interface of <a href="singleton_pool.html">singleton pool</a> for
more information.</p>
<P>
<H4 CLASS="code">NextSize</H4>
<h4 class="code">NextSize</h4>
<P>
The value of this parameter is passed to the underlying Pool when it is created. See the extensions to the public interface of <A HREF="pool.html">pool</A> for more information.
<p>The value of this parameter is passed to the underlying Pool when it is
created. See the extensions to the public interface of <a href=
"pool.html">pool</a> for more information.</p>
<P>
<H3>Modification of <SPAN CLASS="code">rebind</SPAN></H3>
<h3>Modification of <span class="code">rebind</span></h3>
<P>
The struct <SPAN CLASS="code">rebind</SPAN> has been redefined to preserve the values of the additional template parameters.
<p>The struct <span class="code">rebind</span> has been redefined to
preserve the values of the additional template parameters.</p>
<P>
<H3>Additional members</H3>
<h3>Additional members</h3>
<P>
The typedef <SPAN CLASS="code">mutex</SPAN> and the static const value <SPAN CLASS="code">next_size</SPAN> publish the values of the template parameters <SPAN CLASS="code">Mutex</SPAN> and <SPAN CLASS="code">NextSize</SPAN>, respectively.
<p>The typedef <span class="code">mutex</span> and the static const value
<span class="code">next_size</span> publish the values of the template
parameters <span class="code">Mutex</span> and <span class=
"code">NextSize</span>, respectively.</p>
<P>
<H2>Notes</H2>
<h2>Notes</h2>
<P>
A number of common STL libraries contain bugs in their using of allocators. Specifically, they pass null pointers to the <SPAN CLASS="code">deallocate</SPAN> function, which is explicitly forbidden by the Standard [20.1.5 Table 32]. PoolAlloc will work around these libraries if it detects them; currently, workarounds are in place for:
<UL>
<LI>Borland C++ (Builder and command-line compiler) with default (RogueWave) library, ver. 5 and earlier</LI>
<LI>STLport (with any compiler), ver. 4.0 and earlier</LI>
</UL>
<p>A number of common STL libraries contain bugs in their using of
allocators. Specifically, they pass null pointers to the <span class=
"code">deallocate</span> function, which is explicitly forbidden by the
Standard [20.1.5 Table 32]. PoolAlloc will work around these libraries if
it detects them; currently, workarounds are in place for:</p>
<P>
<H2>Future Directions</H2>
<ul>
<li>Borland C++ (Builder and command-line compiler) with default
(RogueWave) library, ver. 5 and earlier</li>
<P>
When the Boost multithreading library is completed, the <SPAN CLASS="code">Mutex</SPAN> parameter will be replaced by something from that library providing the same flexibility and will move from an implementation detail into the interface specification.
<li>STLport (with any compiler), ver. 4.0 and earlier</li>
</ul>
<P>
<H2><A HREF="../interfaces/pool_alloc.html">Interface Description</A></H2>
<h2>Future Directions</h2>
<P>
<HR>
<p>When the Boost multithreading library is completed, the <span class=
"code">Mutex</span> parameter will be replaced by something from that
library providing the same flexibility and will move from an implementation
detail into the interface specification.</p>
<P>
Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT com)
<h2><a href="../interfaces/pool_alloc.html">Interface Description</a></h2>
<hr>
<P>
This file can be redistributed and/or modified under the terms found in <A HREF="../copyright.html">copyright.html</A>
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
"http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<P>
This software and its documentation is provided &quot;as is&quot; without express or implied warranty, and with no claim as to its suitability for any purpose.
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05
December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
</BODY>
</HTML>
<p><i>Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT
com)</i></p>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
or copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>

View File

@@ -1,62 +1,83 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>Object Pool Constructors Generator</TITLE>
<LINK HREF="../pool.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<IMG SRC="../../../../boost.png" WIDTH=276 HEIGHT=86 ALT="C++ Boost">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<link href="../pool.css" rel="stylesheet" type="text/css">
<H1 ALIGN=CENTER>Object Pool Constructors Generator</H1>
<title>Object Pool Constructors Generator</title>
</head>
<P>
<H2>Description</H2>
<body>
<img src="../../../../boost.png" width="276" height="86" alt="C++ Boost">
<P>
The template class <SPAN CLASS="code">object_pool</SPAN> (see <A HREF="object_pool.html">object_pool.html</A>) contains a number of functions <SPAN CLASS="code">construct(..)</SPAN>, which both allocate and construct an object in a single operation.
<h1 align="center">Object Pool Constructors Generator</h1>
<P>
Since the number and type of arguments to this function is totally arbitrary, a simple system has been set up to automatically generate template <SPAN CLASS="code">construct</SPAN> functions. This system is based on the macro preprocessor <STRONG>m4</STRONG>, which is standard on UNIX systems and also available for Win32 systems.
<h2>Description</h2>
<P>
detail/pool_construct.m4, when run with <STRONG>m4</STRONG>, will create the file detail/pool_construct.inc, which only defines the <SPAN CLASS="code">construct</SPAN> functions for the proper number of arguments. The number of arguments may be passed into the file as an m4 macro, <SPAN CLASS="code">NumberOfArguments</SPAN>; if not provided, it will default to <SPAN CLASS="code">3</SPAN>.
<p>The template class <span class="code">object_pool</span> (see <a href=
"object_pool.html">object_pool.html</a>) contains a number of functions
<span class="code">construct(..)</span>, which both allocate and construct
an object in a single operation.</p>
<P>
For each different number of arguments (<SPAN CLASS="code">1</SPAN> to <SPAN CLASS="code">NumberOfArguments</SPAN>), a template function is generated. There are the same number of template parameters as there are arguments, and each argument's type is a reference to that (possibly cv-qualified) template argument. Each possible permutation of the cv-qualifications is also generated.
<p>Since the number and type of arguments to this function is totally
arbitrary, a simple system has been set up to automatically generate
template <span class="code">construct</span> functions. This system is
based on the macro preprocessor <strong>m4</strong>, which is standard on
UNIX systems and also available for Win32 systems.</p>
<P>
Because each permutation is generated for each possible number of arguments, the included file size grows exponentially in terms of the number of constructor arguments, not linearly. For the sake of rational compile times, only use as many arguments as you need.
<p>detail/pool_construct.m4, when run with <strong>m4</strong>, will create
the file detail/pool_construct.inc, which only defines the <span class=
"code">construct</span> functions for the proper number of arguments. The
number of arguments may be passed into the file as an m4 macro,
<span class="code">NumberOfArguments</span>; if not provided, it will
default to <span class="code">3</span>.</p>
<P>
detail/pool_construct.bat and detail/pool_construct.sh are also provided to call <STRONG>m4</STRONG>, defining <SPAN CLASS="code">NumberOfArguments</SPAN> to be their command-line parameter. See these files for more details.
<p>For each different number of arguments (<span class="code">1</span> to
<span class="code">NumberOfArguments</span>), a template function is
generated. There are the same number of template parameters as there are
arguments, and each argument's type is a reference to that (possibly
cv-qualified) template argument. Each possible permutation of the
cv-qualifications is also generated.</p>
<P>
<H2>Dependencies</H2>
<p>Because each permutation is generated for each possible number of
arguments, the included file size grows exponentially in terms of the
number of constructor arguments, not linearly. For the sake of rational
compile times, only use as many arguments as you need.</p>
<P>
Dependent on for.m4 (see <A HREF="for.html">for.html</A>).
<p>detail/pool_construct.bat and detail/pool_construct.sh are also provided
to call <strong>m4</strong>, defining <span class=
"code">NumberOfArguments</span> to be their command-line parameter. See
these files for more details.</p>
<P>
<H2>Future Directions</H2>
<h2>Dependencies</h2>
<P>
This system may be complemented by or replaced by a Python (or some other language) script.
<p>Dependent on for.m4 (see <a href="for.html">for.html</a>).</p>
<P>
<H2><A HREF="../interfaces/object_pool.html">Interface Description</A></H2>
<h2>Future Directions</h2>
<P>
<HR>
<p>This system may be complemented by or replaced by a Python (or some
other language) script.</p>
<P>
Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT com)
<h2><a href="../interfaces/object_pool.html">Interface Description</a></h2>
<hr>
<P>
This file can be redistributed and/or modified under the terms found in <A HREF="../copyright.html">copyright.html</A>
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
"http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<P>
This software and its documentation is provided &quot;as is&quot; without express or implied warranty, and with no claim as to its suitability for any purpose.
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05
December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
</BODY>
</HTML>
<p><i>Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT
com)</i></p>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
or copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>

View File

@@ -1,76 +1,96 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>Simple Segregated Storage Implementation</TITLE>
<LINK HREF="../pool.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<IMG SRC="../../../../boost.png" WIDTH=276 HEIGHT=86 ALT="C++ Boost">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<link href="../pool.css" rel="stylesheet" type="text/css">
<H1 ALIGN=CENTER>Simple Segregated Storage Implementation</H1>
<title>Simple Segregated Storage Implementation</title>
</head>
<P>
<H2>Dependencies</H2>
<body>
<img src="../../../../boost.png" width="276" height="86" alt="C++ Boost">
<P>
Includes the system headers <SPAN CLASS="code">&lt;cstddef&gt;</SPAN> and <SPAN CLASS="code">&lt;functional&gt;</SPAN>.
<h1 align="center">Simple Segregated Storage Implementation</h1>
<P>
<H2>Protected Interface</H2>
<h2>Dependencies</h2>
<P>
<H3>Synopsis</H3>
<p>Includes the system headers <span class="code">&lt;cstddef&gt;</span>
and <span class="code">&lt;functional&gt;</span>.</p>
<PRE CLASS="code">template &lt;typename SizeType = std::size_t&gt;
<h2>Protected Interface</h2>
<h3>Synopsis</h3>
<pre class="code">
template &lt;typename SizeType = std::size_t&gt;
class simple_segregated_storage
{
... // Public interface
protected:
void * first;
static void * & nextof(void * const ptr);
static void * &amp; nextof(void * const ptr);
void * find_prev(void * ptr);
};</PRE>
};
</pre>
<P>
<H3 CLASS="code">void * first;</H3>
<h3 class="code">void * first;</h3>
<P>
This data member is the free list. It points to the first chunk in the free list, or is equal to 0 if the free list is empty.
<p>This data member is the free list. It points to the first chunk in the
free list, or is equal to 0 if the free list is empty.</p>
<P>
<H3 CLASS="code">static void * & nextof(void * const ptr);</H3>
<h3 class="code">static void * &amp; nextof(void * const ptr);</h3>
<P>
This is a convenience function. It helps clean up code dealing with the free list by making it more readable. The return value is just <SPAN CLASS="code">*ptr</SPAN> cast to the appropriate type. <SPAN CLASS="code">ptr</SPAN> must not be 0.
<p>This is a convenience function. It helps clean up code dealing with the
free list by making it more readable. The return value is just <span class=
"code">*ptr</span> cast to the appropriate type. <span class=
"code">ptr</span> must not be 0.</p>
<P>
As an example, let us assume that we want to truncate the free list after the first chunk. That is, we want to set <SPAN CLASS="code">*first</SPAN> to 0; this will result in a free list with only one entry. The normal way to do this is to first cast <SPAN CLASS="code">first</SPAN> to a pointer to a pointer to void, and then dereference and assign (<SPAN CLASS="code">*static_cast&lt;void **&gt;(first) = 0;</SPAN>). This can be done more easily through the use of this convenience function (<SPAN CLASS="code">nextof(first) = 0;</SPAN>).
<p>As an example, let us assume that we want to truncate the free list
after the first chunk. That is, we want to set <span class=
"code">*first</span> to 0; this will result in a free list with only one
entry. The normal way to do this is to first cast <span class=
"code">first</span> to a pointer to a pointer to void, and then dereference
and assign (<span class="code">*static_cast&lt;void **&gt;(first) =
0;</span>). This can be done more easily through the use of this
convenience function (<span class="code">nextof(first) = 0;</span>).</p>
<P>
<H3 CLASS="code">void * find_prev(void * ptr);</H3>
<h3 class="code">void * find_prev(void * ptr);</h3>
<P>
Traverses the free list referred to by <SPAN CLASS="code">first</SPAN>, and returns the pointer previous to where <SPAN CLASS="code">ptr</SPAN> would go if it was in the free list. Returns 0 if <SPAN CLASS="code">ptr</SPAN> would go at the beginning of the free list (i.e., before <SPAN CLASS="code">first</SPAN>).
<p>Traverses the free list referred to by <span class="code">first</span>,
and returns the pointer previous to where <span class="code">ptr</span>
would go if it was in the free list. Returns 0 if <span class=
"code">ptr</span> would go at the beginning of the free list (i.e., before
<span class="code">first</span>).</p>
<P>
Note that this function finds the location previous to where <SPAN CLASS="code">ptr</SPAN> <STRONG>would</STRONG> go <STRONG>if it was</STRONG> in the free list. It does <STRONG>not</STRONG> find the entry in the free list before <SPAN CLASS="code">ptr</SPAN> (unless <SPAN CLASS="code">ptr</SPAN> is already in the free list). Specifically, <SPAN CLASS="code">find_prev(0)</SPAN> will return 0, <STRONG>not</STRONG> the last entry in the free list.
<p>Note that this function finds the location previous to where
<span class="code">ptr</span> <strong>would</strong> go <strong>if it
was</strong> in the free list. It does <strong>not</strong> find the entry
in the free list before <span class="code">ptr</span> (unless <span class=
"code">ptr</span> is already in the free list). Specifically, <span class=
"code">find_prev(0)</span> will return 0, <strong>not</strong> the last
entry in the free list.</p>
<P>
<H2><A HREF="../interfaces/simple_segregated_storage.html">Interface Description</A></H2>
<h2><a href="../interfaces/simple_segregated_storage.html">Interface
Description</a></h2>
<hr>
<P>
<HR>
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
"http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<P>
Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT com)
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05
December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
<P>
This file can be redistributed and/or modified under the terms found in <A HREF="../copyright.html">copyright.html</A>
<p><i>Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT
com)</i></p>
<P>
This software and its documentation is provided &quot;as is&quot; without express or implied warranty, and with no claim as to its suitability for any purpose.
</BODY>
</HTML>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
or copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>

View File

@@ -1,25 +1,29 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>singleton - Singleton</TITLE>
<LINK HREF="../pool.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<IMG SRC="../../../../boost.png" WIDTH=276 HEIGHT=86 ALT="C++ Boost">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<link href="../pool.css" rel="stylesheet" type="text/css">
<H1 ALIGN=CENTER>singleton - Singleton</H1>
<title>singleton - Singleton</title>
</head>
<P>
<H2>Introduction</H2>
<body>
<img src="../../../../boost.png" width="276" height="86" alt="C++ Boost">
<P>
detail/singleton.hpp provides a way to access a Singleton of a class type. This is <STRONG>not</STRONG> a general Singleton solution! It is restricted in that the class type must have a default constructor.
<h1 align="center">singleton - Singleton</h1>
<P>
<H2>Synopsis</H2>
<h2>Introduction</h2>
<PRE CLASS="code">namespace details {
<p>detail/singleton.hpp provides a way to access a Singleton of a class
type. This is <strong>not</strong> a general Singleton solution! It is
restricted in that the class type must have a default constructor.</p>
<h2>Synopsis</h2>
<pre class="code">
namespace details {
namespace pool {
template &lt;typename T&gt;
@@ -31,64 +35,97 @@ class singleton_default
public:
typedef T object_type;
static object_type & instance();
static object_type &amp; instance();
};
} // namespace pool
} // namespace details</PRE>
} // namespace details
</pre>
<P>
<H2>Semantics</H2>
<h2>Semantics</h2>
<P>
<TABLE BORDER ALIGN=CENTER>
<CAPTION><EM>Symbol Table</EM></CAPTION>
<TR><TH>Symbol<TH>Meaning
<TR><TD CLASS="code">T<TD>Any class with a non-throwing default constructor and non-throwing destructor
</TABLE>
<table border align="center" summary="">
<caption>
<em>Symbol Table</em>
</caption>
<P>
<TABLE BORDER ALIGN=CENTER>
<CAPTION><EM>Requirements satisfied by <SPAN CLASS="code">singleton_default&lt;T&gt;</SPAN></EM></CAPTION>
<TR><TH>Expression<TH>Return Type<TH>Assertion/Note/Pre/Post-Condition
<TR><TD CLASS="code">singleton_default&lt;T&gt;::instance()<TD CLASS="code">T &amp;<TD>Returns a reference to the singleton instance
</TABLE>
<tr>
<th>Symbol</th>
<P>
<H2>Guarantees</H2>
<th>Meaning</th>
</tr>
<P>
The singleton instance is guaranteed to be constructed before <SPAN CLASS="code">main()</SPAN> begins, and destructed after <SPAN CLASS="code">main()</SPAN> ends. Furthermore, it is guaranteed to be constructed before the first call to <SPAN CLASS="code">singleton_default&lt;T&gt;::instance()</SPAN> is complete (even if called before <SPAN CLASS="code">main()</SPAN> begins). Thus, if there are not multiple threads running except within <SPAN CLASS="code">main()</SPAN>, and if all access to the singleton is restricted by mutexes, then this guarantee allows a thread-safe singleton.
<tr>
<td class="code">T</td>
<P>
<H2>Details</H2>
<td>Any class with a non-throwing default constructor and non-throwing
destructor</td>
</tr>
</table><br>
<P>
For details on how we provide the guarantees above, see the comments in the header file.
<table border align="center" summary="">
<caption>
<em>Requirements satisfied by <span class=
"code">singleton_default&lt;T&gt;</span></em>
</caption>
<P>
<H2>Dependencies</H2>
<tr>
<th>Expression</th>
<P>
None.
<th>Return Type</th>
<P>
<H2>Future Directions</H2>
<th>Assertion/Note/Pre/Post-Condition</th>
</tr>
<P>
This header may be replaced by a Boost singleton library.
<tr>
<td class="code">singleton_default&lt;T&gt;::instance()</td>
<P>
<HR>
<td class="code">T &amp;</td>
<P>
Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT com)
<td>Returns a reference to the singleton instance</td>
</tr>
</table>
<P>
This file can be redistributed and/or modified under the terms found in <A HREF="../copyright.html">copyright.html</A>
<h2>Guarantees</h2>
<P>
This software and its documentation is provided &quot;as is&quot; without express or implied warranty, and with no claim as to its suitability for any purpose.
<p>The singleton instance is guaranteed to be constructed before
<span class="code">main()</span> begins, and destructed after <span class=
"code">main()</span> ends. Furthermore, it is guaranteed to be constructed
before the first call to <span class=
"code">singleton_default&lt;T&gt;::instance()</span> is complete (even if
called before <span class="code">main()</span> begins). Thus, if there are
not multiple threads running except within <span class=
"code">main()</span>, and if all access to the singleton is restricted by
mutexes, then this guarantee allows a thread-safe singleton.</p>
</BODY>
</HTML>
<h2>Details</h2>
<p>For details on how we provide the guarantees above, see the comments in
the header file.</p>
<h2>Dependencies</h2>
<p>None.</p>
<h2>Future Directions</h2>
<p>This header may be replaced by a Boost singleton library.</p>
<hr>
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
"http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05
December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
<p><i>Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT
com)</i></p>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
or copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>

View File

@@ -1,25 +1,33 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>Singleton Pool Implementation</TITLE>
<LINK HREF="../pool.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<IMG SRC="../../../../boost.png" WIDTH=276 HEIGHT=86 ALT="C++ Boost">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<link href="../pool.css" rel="stylesheet" type="text/css">
<H1 ALIGN=CENTER>Singleton Pool Implementation</H1>
<title>Singleton Pool Implementation</title>
</head>
<P>
<H2>Dependencies</H2>
<body>
<img src="../../../../boost.png" width="276" height="86" alt="C++ Boost">
<P>
Includes the Boost headers <SPAN CLASS="code">&quot;pool.hpp&quot;</SPAN> (see <A HREF="pool.html">pool.html</A>), <SPAN CLASS="code">&quot;detail/singleton.hpp&quot;</SPAN> (see <A HREF="singleton.html">singleton.html</A>), <SPAN CLASS="code">&quot;detail/mutex.hpp&quot;</SPAN> (see <A HREF="mutex.html">mutex.html</A>), and <SPAN CLASS="code">&quot;detail/guard.hpp&quot;</SPAN> (see <A HREF="guard.html">guard.html</A>).
<h1 align="center">Singleton Pool Implementation</h1>
<P>
<H2>Synopsis</H2>
<h2>Dependencies</h2>
<PRE CLASS="code">template &lt;typename Tag,
<p>Includes the Boost headers <span class="code">"pool.hpp"</span> (see
<a href="pool.html">pool.html</a>), <span class=
"code">"detail/singleton.hpp"</span> (see <a href=
"singleton.html">singleton.html</a>), <span class=
"code">"detail/mutex.hpp"</span> (see <a href="mutex.html">mutex.html</a>),
and <span class="code">"detail/guard.hpp"</span> (see <a href=
"guard.html">guard.html</a>).</p>
<h2>Synopsis</h2>
<pre class="code">
template &lt;typename Tag,
unsigned RequestedSize,
typename UserAllocator = default_user_allocator_new_delete,
typename Mutex = details::pool::default_mutex,
@@ -31,52 +39,60 @@ class singleton_pool
public: // extensions to public interface
typedef Mutex mutex;
static const unsigned next_size = NextSize;
};</PRE>
};
</pre>
<P>
<H2>Extensions to Public Interface</H2>
<h2>Extensions to Public Interface</h2>
<P>
<H3>Additional template parameters</H3>
<h3>Additional template parameters</h3>
<P>
<H4 CLASS="code">Mutex</H4>
<h4 class="code">Mutex</h4>
<P>
This class is the type of <A HREF="mutex.html">mutex</A> to use to protect simultaneous access to the underlying Pool. It is exposed so that users may declare some singleton pools normally (i.e., with synchronization), but some singleton pools without synchronization (by specifying <SPAN CLASS="code">details::pool::null_mutex</SPAN>) for efficiency reasons.
<p>This class is the type of <a href="mutex.html">mutex</a> to use to
protect simultaneous access to the underlying Pool. It is exposed so that
users may declare some singleton pools normally (i.e., with
synchronization), but some singleton pools without synchronization (by
specifying <span class="code">details::pool::null_mutex</span>) for
efficiency reasons.</p>
<P>
<H4 CLASS="code">NextSize</H4>
<h4 class="code">NextSize</h4>
<P>
The value of this parameter is passed to the underlying Pool when it is created. See the extensions to the public interface of <A HREF="pool.html">pool</A> for more information.
<p>The value of this parameter is passed to the underlying Pool when it is
created. See the extensions to the public interface of <a href=
"pool.html">pool</a> for more information.</p>
<P>
<H3>Additional members</H3>
<h3>Additional members</h3>
<P>
The typedef <SPAN CLASS="code">mutex</SPAN> and the static const value <SPAN CLASS="code">next_size</SPAN> publish the values of the template parameters <SPAN CLASS="code">Mutex</SPAN> and <SPAN CLASS="code">NextSize</SPAN>, respectively.
<p>The typedef <span class="code">mutex</span> and the static const value
<span class="code">next_size</span> publish the values of the template
parameters <span class="code">Mutex</span> and <span class=
"code">NextSize</span>, respectively.</p>
<P>
<H2>Future Directions</H2>
<h2>Future Directions</h2>
<P>
When the Boost multithreading library is completed, the <SPAN CLASS="code">Mutex</SPAN> parameter will be replaced by something from that library providing the same flexibility and will move from an implementation detail into the interface specification.
<p>When the Boost multithreading library is completed, the <span class=
"code">Mutex</span> parameter will be replaced by something from that
library providing the same flexibility and will move from an implementation
detail into the interface specification.</p>
<P>
<H2><A HREF="../interfaces/singleton_pool.html">Interface Description</A></H2>
<h2><a href="../interfaces/singleton_pool.html">Interface
Description</a></h2>
<hr>
<P>
<HR>
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
"http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<P>
Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT com)
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05
December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
<P>
This file can be redistributed and/or modified under the terms found in <A HREF="../copyright.html">copyright.html</A>
<p><i>Copyright &copy; 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT
com)</i></p>
<P>
This software and its documentation is provided &quot;as is&quot; without express or implied warranty, and with no claim as to its suitability for any purpose.
</BODY>
</HTML>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
or copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>