|
Boost-Commit : |
From: oryol_at_[hidden]
Date: 2008-07-24 23:05:29
Author: jeremypack
Date: 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
New Revision: 47776
URL: http://svn.boost.org/trac/boost/changeset/47776
Log:
Documentation updates for Boost.Extension
Added:
sandbox/libs/extension/doc/html/boost/extensions/adaptable_factory.html (contents, props changed)
sandbox/libs/extension/doc/html/boost/extensions/basic_type_map.html (contents, props changed)
sandbox/libs/extension/doc/html/boost/extensions/type_map.html (contents, props changed)
sandbox/libs/extension/doc/html/boost_extension/extension.html (contents, props changed)
sandbox/libs/extension/doc/html/boost_extension/header_reference.html (contents, props changed)
sandbox/libs/extension/doc/html/boost_extension/type_safety.html (contents, props changed)
sandbox/libs/extension/doc/old_tutorial1.qbk (contents, props changed)
sandbox/libs/extension/doc/type_safety.qbk (contents, props changed)
Text files modified:
sandbox/libs/extension/doc/Jamfile.v2 | 21
sandbox/libs/extension/doc/appendices.qbk | 7
sandbox/libs/extension/doc/extension.qbk | 53 +
sandbox/libs/extension/doc/html/boost/extensions/basic_factory_map.html | 28
sandbox/libs/extension/doc/html/boost/extensions/factory.html | 44
sandbox/libs/extension/doc/html/boost/extensions/factory_map.html | 8
sandbox/libs/extension/doc/html/boost/extensions/shared_library.html | 43
sandbox/libs/extension/doc/html/boost_extension/appendices.html | 83 --
sandbox/libs/extension/doc/html/boost_extension/appendices/appendix_a.html | 28
sandbox/libs/extension/doc/html/boost_extension/appendices/appendix_b.html | 7
sandbox/libs/extension/doc/html/boost_extension/extension_reflection.html | 8
sandbox/libs/extension/doc/html/boost_extension/factories.html | 11
sandbox/libs/extension/doc/html/boost_extension/faq.html | 6
sandbox/libs/extension/doc/html/boost_extension/info.html | 7
sandbox/libs/extension/doc/html/boost_extension/introduction.html | 58 +
sandbox/libs/extension/doc/html/boost_extension/motivation.html | 6
sandbox/libs/extension/doc/html/boost_extension/performance_analysis.html | 12
sandbox/libs/extension/doc/html/boost_extension/reference.html | 189 ++++++-
sandbox/libs/extension/doc/html/boost_extension/shared_libraries.html | 102 ---
sandbox/libs/extension/doc/html/boost_extension/shared_libraries/shared_library_class.html | 6
sandbox/libs/extension/doc/html/boost_extension/shared_libraries/shared_library_inefficiencies.html | 7
sandbox/libs/extension/doc/html/boost_extension/shared_libraries/shared_library_issues.html | 7
sandbox/libs/extension/doc/html/boost_extension/tutorials.html | 976 ++++++---------------------------------
sandbox/libs/extension/doc/html/boost_extension/tutorials/tutorial05.html | 7
sandbox/libs/extension/doc/html/index.html | 124 ++--
sandbox/libs/extension/doc/introduction.qbk | 32 +
sandbox/libs/extension/doc/tutorial1.qbk | 277 +++++++----
27 files changed, 807 insertions(+), 1350 deletions(-)
Modified: sandbox/libs/extension/doc/Jamfile.v2
==============================================================================
--- sandbox/libs/extension/doc/Jamfile.v2 (original)
+++ sandbox/libs/extension/doc/Jamfile.v2 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -16,26 +16,12 @@
doxygen autodoc_extension
:
+ [ glob ../../../boost/reflection/*.hpp ]
[ glob ../../../boost/extension/*.hpp ]
:
<doxygen:param>EXTRACT_ALL=NO
<doxygen:param>"PREDEFINED=\"BOOST_EXTENSION_DOXYGEN_INVOKED\" \\
- \"U_EXPORT2=\""
- <doxygen:param>HIDE_UNDOC_MEMBERS=NO
- <doxygen:param>EXTRACT_PRIVATE=NO
- <doxygen:param>ENABLE_PREPROCESSING=YES
- <doxygen:param>MACRO_EXPANSION=YES
- <doxygen:param>EXPAND_ONLY_PREDEF=YES
- <doxygen:param>SEARCH_INCLUDES=YES
- <doxygen:param>INCLUDE_PATH=$(BOOST_ROOT)
- ;
-
-doxygen autodoc_reflection
- :
- [ glob ../../../boost/reflection/*.hpp ]
- :
- <doxygen:param>EXTRACT_ALL=NO
- <doxygen:param>"PREDEFINED=\"BOOST_REFLECTION_DOXYGEN_INVOKED\" \\
+ \"BOOST_REFLECTION_DOXYGEN_INVOKED\" \\
\"U_EXPORT2=\""
<doxygen:param>HIDE_UNDOC_MEMBERS=NO
<doxygen:param>EXTRACT_PRIVATE=NO
@@ -54,9 +40,8 @@
:
<xsl:param>toc.max.depth=2
<xsl:param>toc.section.depth=2
- <xsl:param>chunk.section.depth=1
+ <xsl:param>chunk.section.depth=2
<dependency>autodoc_extension
- <dependency>autodoc_reflection
;
install css : [ glob $(BOOST_ROOT)/doc/src/*.css ]
Modified: sandbox/libs/extension/doc/appendices.qbk
==============================================================================
--- sandbox/libs/extension/doc/appendices.qbk (original)
+++ sandbox/libs/extension/doc/appendices.qbk 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -6,7 +6,12 @@
[/ See http://www.boost.org/ for latest version. ]
[section:appendices Appendices]
+[section:appendices_description Contents in Appendices]
+The reference documentation for both the Boost.Extension and Boost.Reflection
+libraries are contained here, until it is decided where (and if) to split the
+two libraries, since they share many pieces of functionality.
+[endsect]
+[xinclude autodoc_extension.xml]
[include appendix_a.qbk]
[include appendix_b.qbk]
-[include appendix_c.qbk]
[endsect]
\ No newline at end of file
Modified: sandbox/libs/extension/doc/extension.qbk
==============================================================================
--- sandbox/libs/extension/doc/extension.qbk (original)
+++ sandbox/libs/extension/doc/extension.qbk 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -10,30 +10,73 @@
[copyright 2008 Jeremy Pack]
[authors [Pack, Jeremy]]
[purpose
- Factory management and facilities for using shared libraries]
+ Factory management, reflection and facilities for using shared libraries]
[license
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
[@http://www.boost.org/LICENSE_1_0.txt http://www.boost.org/LICENSE_1_0.txt])
]
[category Programming Interfaces]
- [last-revision $Date: 2008/2/12 19:25:00 $]
+ [last-revision $Date: 2008/7/23 21:36:00 $]
]
[def _shared_library_ [^[classref boost::extensions::shared_library shared_library]]]
[def _factory_map_ [^[classref boost::extensions::factory_map factory_map]]]
[def _factory_ [^[classref boost::extensions::factory factory]]]
+[def _type_map_ [^[classref boost::extensions::type_map type_map]]]
+[def _adaptable_factory_ [^[classref boost::extensions::adaptable_factory adaptable_factory]]]
+[def _reflection_ [^[classref boost::reflections::reflection reflection]]]
+[def _parameter_map_ [^[classref boost::reflections::parameter_map parameter_map]]]
+[def _parameter_ [^[classref boost::reflections::parameter parameter]]]
+[section:recent_changes Recent Changes]
+
+The most recent changes to Boost.Extension, in preparation for this library's submission
+to Boost for review:
+
+
+* Deprecation of _factory_map_ in favor of _type_map_ (tutorials to come).
+* All reflection documentation will be contained within the Extension docs.
+During review, or perhaps shortly before, it will be determined whether or not
+these should be two separate libraries, and if so, where the split should occur -
+since they share significant functionality.
+* The _adaptable_factory_ class has been added to facilitate calling factories when
+the parameters of the constructor are unknown.
+* The addition of the source code for a runtime compilation example. This involves compiling
+a shared library at runtime, and calling code from it. Examples will come soon.
+
+
+The latest updates in this documentation are:
+
+Class references:
+
+* _shared_library_
+* _type_map_
+* _reflection_
+* _parameter_
+* _parameter_map_
+* _adaptable_factory_
+* _factory_
+
+Tutorials:
+
+* [link tutorial01 Tutorial 1: The shared_library class]
+
+Other Sections:
+
+* [link motivation Motivation]
+
+The other sections in the documentation should be updated over the next few weeks, in
+preparation for review.
+[endsect]
[include introduction.qbk]
[include motivation.qbk]
[include shared_libraries.qbk]
-[include factories.qbk]
[include tutorials.qbk]
-[xinclude autodoc_extension.xml]
[include extension_reflection.qbk]
-[xinclude autodoc_reflection.xml]
[include info.qbk]
[include performance_analysis.qbk]
+[include type_safety.qbk]
[include faq.qbk]
[include appendices.qbk]
Added: sandbox/libs/extension/doc/html/boost/extensions/adaptable_factory.html
==============================================================================
--- (empty file)
+++ sandbox/libs/extension/doc/html/boost/extensions/adaptable_factory.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -0,0 +1,214 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template adaptable_factory</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Extension">
+<link rel="up" href="../../boost_extension/reference.html#header.boost.extension.adaptable_factory.hpp" title="Header <boost/extension/adaptable_factory.hpp>">
+<link rel="prev" href="../../boost_extension/reference.html" title="Reference">
+<link rel="next" href="load_single_library_id292277.html" title="Function load_single_library">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../../boost_extension/reference.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.adaptable_factory.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="load_single_library_id292277.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.extensions.adaptable_factory"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template adaptable_factory</span></h2>
+<p>boost::extensions::adaptable_factory — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Interface, <span class="bold"><strong>typename</strong></span> Info = std::string,
+ <span class="bold"><strong>typename</strong></span> TypeInfo = default_type_info>
+<span class="bold"><strong>class</strong></span> adaptable_factory {
+<span class="bold"><strong>public</strong></span>:
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ adaptable_factory();
+ adaptable_factory(adaptable_factory< Interface > <span class="bold"><strong>const</strong></span> &);
+ adaptable_factory& operator=(adaptable_factory< Interface > <span class="bold"><strong>const</strong></span> &);
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="type">Interface *</span> create(boost::reflections::parameter_map &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">std::map< TypeInfo, Info ></span>
+ get_missing_parameter_list(<span class="bold"><strong>const</strong></span> boost::reflections::parameter_map &) <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> is_valid() <span class="bold"><strong>const</strong></span>;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Derived, <span class="bold"><strong>typename</strong></span> Params...> <span class="type"><span class="bold"><strong>void</strong></span></span> set(Info) ;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id455677"></a><h2>Description</h2>
+<p>This class is a function object that returns new instances of type Interface, using factories that take parameters described in the variable length list Params... </p>
+<div class="refsect2" lang="en">
+<a name="id455687"></a><h3>
+<a name="boost.extensions.adaptable_factoryconstruct-copy-destruct"></a><code class="computeroutput">adaptable_factory</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol type="1">
+<li><pre class="literallayout"><a name="id292240-bb"></a>adaptable_factory();</pre></li>
+<li><pre class="literallayout"><a name="id292244-bb"></a>adaptable_factory(adaptable_factory< Interface > <span class="bold"><strong>const</strong></span> & first);</pre></li>
+<li><pre class="literallayout">adaptable_factory& <a name="id292255-bb"></a><span class="bold"><strong>operator</strong></span>=(adaptable_factory< Interface > <span class="bold"><strong>const</strong></span> & first);</pre></li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id455798"></a><h3>
+<a name="id292102-bb"></a><code class="computeroutput">adaptable_factory</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><span class="type">Interface *</span> <a name="id292105-bb"></a>create(boost::reflections::parameter_map & map) <span class="bold"><strong>const</strong></span>;</pre>
+<p>Returns an instance of Interface (but does NOT retain ownership of the instance).
+
+
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term">Parameters:</span></td>
+<td><div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><code class="computeroutput">map</code></span></td>
+<td><p>A parameter map to search for the parameters for this function. </p></td>
+</tr></tbody>
+</table></div></td>
+</tr>
+<tr>
+<td>
+<span class="term">Requires:</span></td>
+<td><p>is_valid() == true. </p></td>
+</tr>
+<tr>
+<td>
+<span class="term">Postconditions:</span></td>
+<td><p>None. </p></td>
+</tr>
+<tr>
+<td>
+<span class="term">Returns:</span></td>
+<td><p>An instance of Interface, if all of the needed parameters are found in map. </p></td>
+</tr>
+</tbody>
+</table></div>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::map< TypeInfo, Info ></span>
+<a name="id292138-bb"></a>get_missing_parameter_list(<span class="bold"><strong>const</strong></span> boost::reflections::parameter_map & map) <span class="bold"><strong>const</strong></span>;</pre>
+<p>Returns a map of the TypeInfo/Info pairs describing any parameters still needed before this function can be called.
+
+
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term">Parameters:</span></td>
+<td><div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><code class="computeroutput">map</code></span></td>
+<td><p>A parameter map to search for the parameters for this function. </p></td>
+</tr></tbody>
+</table></div></td>
+</tr>
+<tr>
+<td>
+<span class="term">Requires:</span></td>
+<td><p>is_valid() == true. </p></td>
+</tr>
+<tr>
+<td>
+<span class="term">Postconditions:</span></td>
+<td><p>None. </p></td>
+</tr>
+<tr>
+<td>
+<span class="term">Returns:</span></td>
+<td><p>TypeInfo/Info pairs for any missing parameters. </p></td>
+</tr>
+</tbody>
+</table></div>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id292175-bb"></a>is_valid() <span class="bold"><strong>const</strong></span>;</pre>
+<p>Until set is called, a adaptable_factory cannot be used. This function can be used to determine if set has been called.
+
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term">Requires:</span></td>
+<td><p>None. </p></td>
+</tr>
+<tr>
+<td>
+<span class="term">Postconditions:</span></td>
+<td><p>None. </p></td>
+</tr>
+<tr>
+<td>
+<span class="term">Returns:</span></td>
+<td><p>True if the adaptable_factory is initialized (ie, set has been called). </p></td>
+</tr>
+</tbody>
+</table></div>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Derived, <span class="bold"><strong>typename</strong></span> Params...>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id292201-bb"></a>set(Info parameter_names...) ;</pre>
+<p>This sets the factory function to the constructor for type D. It takes as arguments Info about each parameter in the constructor.
+
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term">Requires:</span></td>
+<td><p>None. </p></td>
+</tr>
+<tr>
+<td>
+<span class="term">Postconditions:</span></td>
+<td><p>None. Example: adaptable_factory<Base, int, int> f; f.set<Derived>(); </p></td>
+</tr>
+</tbody>
+</table></div>
+</li>
+</ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2008 Jeremy Pack<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../../boost_extension/reference.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.adaptable_factory.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="load_single_library_id292277.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Modified: sandbox/libs/extension/doc/html/boost/extensions/basic_factory_map.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost/extensions/basic_factory_map.html (original)
+++ sandbox/libs/extension/doc/html/boost/extensions/basic_factory_map.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -6,7 +6,7 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
<link rel="start" href="../../index.html" title="Chapter 1. Boost.Extension">
<link rel="up" href="../../boost_extension/reference.html#header.boost.extension.factory_map.hpp" title="Header <boost/extension/factory_map.hpp>">
-<link rel="prev" href="factory.html" title="Class template factory">
+<link rel="prev" href="../../BOOST_EXTENSION_EXPORT_DECL.html" title="Macro BOOST_EXTENSION_EXPORT_DECL">
<link rel="next" href="factory_map.html" title="Type definition factory_map">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -20,7 +20,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="factory.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.factory_map.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="factory_map.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="../../BOOST_EXTENSION_EXPORT_DECL.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.factory_map.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="factory_map.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="refentry" lang="en">
<a name="boost.extensions.basic_factory_map"></a><div class="titlepage"></div>
@@ -33,32 +33,32 @@
<span class="bold"><strong>class</strong></span> basic_factory_map {
<span class="bold"><strong>public</strong></span>:
<span class="emphasis"><em>// construct/copy/destruct</em></span>
- ~basic_factory_map();
+ ~basic_factory_map();
- <span class="emphasis"><em>// public member functions</em></span>
+ <span class="emphasis"><em>// public member functions</em></span>
<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Interface, <span class="bold"><strong>typename</strong></span> Info, <span class="bold"><strong>typename</strong></span> Params...>
- <span class="type">std::map< Info, factory< Interface, Params...> > &</span> get() ;
+ <span class="type">std::map< Info, factory< Interface, Params...> > &</span> get() ;
<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Interface, <span class="bold"><strong>typename</strong></span> Info, <span class="bold"><strong>typename</strong></span> Params...>
- operator std::map< Info, factory< Interface, Params...> > &() ;
+ operator std::map< Info, factory< Interface, Params...> > &() ;
};</pre></div>
<div class="refsect1" lang="en">
-<a name="id450769"></a><h2>Description</h2>
+<a name="id456712"></a><h2>Description</h2>
<p>
</p>
<div class="refsect2" lang="en">
-<a name="id450777"></a><h3>
+<a name="id456720"></a><h3>
<a name="boost.extensions.basic_factory_mapconstruct-copy-destruct"></a><code class="computeroutput">basic_factory_map</code>
public
construct/copy/destruct</h3>
-<div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id290381-bb"></a>~basic_factory_map();</pre></li></ol></div>
+<div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id292467-bb"></a>~basic_factory_map();</pre></li></ol></div>
</div>
<div class="refsect2" lang="en">
-<a name="id450817"></a><h3>
-<a name="id290321-bb"></a><code class="computeroutput">basic_factory_map</code> public member functions</h3>
+<a name="id456760"></a><h3>
+<a name="id292397-bb"></a><code class="computeroutput">basic_factory_map</code> public member functions</h3>
<div class="orderedlist"><ol type="1">
<li>
<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Interface, <span class="bold"><strong>typename</strong></span> Info, <span class="bold"><strong>typename</strong></span> Params...>
- <span class="type">std::map< Info, factory< Interface, Params...> > &</span> <a name="id290323-bb"></a>get() ;</pre>
+ <span class="type">std::map< Info, factory< Interface, Params...> > &</span> <a name="id292400-bb"></a>get() ;</pre>
<p>
This returns a map of the given type of factories. It can return an empty map if no such factories are found. </p>
@@ -73,7 +73,7 @@
</li>
<li>
<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Interface, <span class="bold"><strong>typename</strong></span> Info, <span class="bold"><strong>typename</strong></span> Params...>
- <a name="id290355-bb"></a><span class="bold"><strong>operator</strong></span> std::map< Info, factory< Interface, Params...> > &() ;</pre>
+ <a name="id292436-bb"></a><span class="bold"><strong>operator</strong></span> std::map< Info, factory< Interface, Params...> > &() ;</pre>
<p>A conversion operator for convenience in calling functions that take a map of factories. This is identical to the get() function. </p>
</li>
</ol></div>
@@ -90,7 +90,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="factory.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.factory_map.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="factory_map.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="../../BOOST_EXTENSION_EXPORT_DECL.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.factory_map.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="factory_map.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Added: sandbox/libs/extension/doc/html/boost/extensions/basic_type_map.html
==============================================================================
--- (empty file)
+++ sandbox/libs/extension/doc/html/boost/extensions/basic_type_map.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -0,0 +1,86 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template basic_type_map</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Extension">
+<link rel="up" href="../../boost_extension/reference.html#header.boost.extension.type_map.hpp" title="Header <boost/extension/type_map.hpp>">
+<link rel="prev" href="shared_library.html" title="Class shared_library">
+<link rel="next" href="basic_type_map/type_map_convertible.html" title="Class type_map_convertible">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="shared_library.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.type_map.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="basic_type_map/type_map_convertible.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.extensions.basic_type_map"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template basic_type_map</span></h2>
+<p>boost::extensions::basic_type_map — A collection of types. </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> TypeInfo>
+<span class="bold"><strong>class</strong></span> basic_type_map {
+<span class="bold"><strong>public</strong></span>:
+
+ <span class="bold"><strong>class</strong></span> type_map_convertible {
+ <span class="bold"><strong>public</strong></span>:
+
+ <span class="bold"><strong>struct</strong></span> generic_type_holder {
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ ~generic_type_holder();
+ };
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T>
+ <span class="bold"><strong>struct</strong></span> type_holder : <span class="bold"><strong>public</strong></span> boost::extensions::basic_type_map< TypeInfo >::type_map_convertible::generic_type_holder
+ {
+ <span class="type">T</span> val;
+ };
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ ~type_map_convertible();
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Type> operator Type &() ;
+ };
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="type">type_map_convertible &</span> get() ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Type> <span class="type">Type &</span> get() ;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id458116"></a><h2>Description</h2>
+<p>
+</p>
+<div class="refsect2" lang="en">
+<a name="id458124"></a><h3>
+<a name="id292787-bb"></a><code class="computeroutput">basic_type_map</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li><pre class="literallayout"><span class="type">type_map_convertible &</span> <a name="id292790-bb"></a>get() ;</pre></li>
+<li><pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Type> <span class="type">Type &</span> <a name="id292797-bb"></a>get() ;</pre></li>
+</ol></div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2008 Jeremy Pack<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="shared_library.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.type_map.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="basic_type_map/type_map_convertible.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Modified: sandbox/libs/extension/doc/html/boost/extensions/factory.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost/extensions/factory.html (original)
+++ sandbox/libs/extension/doc/html/boost/extensions/factory.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -6,8 +6,8 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
<link rel="start" href="../../index.html" title="Chapter 1. Boost.Extension">
<link rel="up" href="../../boost_extension/reference.html#header.boost.extension.factory.hpp" title="Header <boost/extension/factory.hpp>">
-<link rel="prev" href="../../BOOST_EXTENSION_EXPORT_DECL.html" title="Macro BOOST_EXTENSION_EXPORT_DECL">
-<link rel="next" href="basic_factory_map.html" title="Class template basic_factory_map">
+<link rel="prev" href="../../BOOST_REFLECTION_CONSTRUCTI_FUNCTION_id293418.html" title="Macro BOOST_REFLECTION_CONSTRUCTI_FUNCTION">
+<link rel="next" href="../../BOOST_PP_ITERATION_LIMITS_id293579.html" title="Macro BOOST_PP_ITERATION_LIMITS">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -20,7 +20,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../../BOOST_EXTENSION_EXPORT_DECL.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.factory.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="basic_factory_map.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="../../BOOST_REFLECTION_CONSTRUCTI_FUNCTION_id293418.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.factory.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../../BOOST_PP_ITERATION_LIMITS_id293579.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="refentry" lang="en">
<a name="boost.extensions.factory"></a><div class="titlepage"></div>
@@ -33,39 +33,39 @@
<span class="bold"><strong>class</strong></span> factory {
<span class="bold"><strong>public</strong></span>:
<span class="emphasis"><em>// construct/copy/destruct</em></span>
- factory();
- factory(factory< T > <span class="bold"><strong>const</strong></span> &);
- factory& operator=(factory< T > <span class="bold"><strong>const</strong></span> &);
-
- <span class="emphasis"><em>// public member functions</em></span>
- <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> D> <span class="type"><span class="bold"><strong>void</strong></span></span> set() ;
- <span class="type"><span class="bold"><strong>bool</strong></span></span> is_valid() <span class="bold"><strong>const</strong></span>;
- <span class="type">T *</span> create(Params...) <span class="bold"><strong>const</strong></span>;
+ factory();
+ factory(factory< T > <span class="bold"><strong>const</strong></span> &);
+ factory& operator=(factory< T > <span class="bold"><strong>const</strong></span> &);
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> D> <span class="type"><span class="bold"><strong>void</strong></span></span> set() ;
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> is_valid() <span class="bold"><strong>const</strong></span>;
+ <span class="type">T *</span> create(Params...) <span class="bold"><strong>const</strong></span>;
};</pre></div>
<div class="refsect1" lang="en">
-<a name="id450219"></a><h2>Description</h2>
+<a name="id461460"></a><h2>Description</h2>
<p>This class is a function object that returns new instances of type T, using factories that take parameters described in the variable length list Params... </p>
<div class="refsect2" lang="en">
-<a name="id450229"></a><h3>
+<a name="id461470"></a><h3>
<a name="boost.extensions.factoryconstruct-copy-destruct"></a><code class="computeroutput">factory</code>
public
construct/copy/destruct</h3>
<div class="orderedlist"><ol type="1">
-<li><pre class="literallayout"><a name="id290278-bb"></a>factory();</pre></li>
-<li><pre class="literallayout"><a name="id290283-bb"></a>factory(factory< T > <span class="bold"><strong>const</strong></span> & first);</pre></li>
-<li><pre class="literallayout">factory& <a name="id290292-bb"></a><span class="bold"><strong>operator</strong></span>=(factory< T > <span class="bold"><strong>const</strong></span> & first);</pre></li>
+<li><pre class="literallayout"><a name="id293537-bb"></a>factory();</pre></li>
+<li><pre class="literallayout"><a name="id293541-bb"></a>factory(factory< T > <span class="bold"><strong>const</strong></span> & first);</pre></li>
+<li><pre class="literallayout">factory& <a name="id293552-bb"></a><span class="bold"><strong>operator</strong></span>=(factory< T > <span class="bold"><strong>const</strong></span> & first);</pre></li>
</ol></div>
</div>
<div class="refsect2" lang="en">
-<a name="id450335"></a><h3>
-<a name="id92772-bb"></a><code class="computeroutput">factory</code> public member functions</h3>
+<a name="id461577"></a><h3>
+<a name="id293461-bb"></a><code class="computeroutput">factory</code> public member functions</h3>
<div class="orderedlist"><ol type="1">
<li>
-<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> D> <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id91786-bb"></a>set() ;</pre>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> D> <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id293464-bb"></a>set() ;</pre>
<p>This sets the factory function to the constructor for type D. Example: factory<Base, int, int> f; f.set<Derived>(); </p>
</li>
<li>
-<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id81090-bb"></a>is_valid() <span class="bold"><strong>const</strong></span>;</pre>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id293485-bb"></a>is_valid() <span class="bold"><strong>const</strong></span>;</pre>
<p>Until set is called, a factory cannot be used. This function can be used to determine if set has been called.
@@ -92,7 +92,7 @@
</table></div>
</li>
<li>
-<pre class="literallayout"><span class="type">T *</span> <a name="id290255-bb"></a>create(Params...) <span class="bold"><strong>const</strong></span>;</pre>
+<pre class="literallayout"><span class="type">T *</span> <a name="id293511-bb"></a>create(Params...) <span class="bold"><strong>const</strong></span>;</pre>
<p>Returns an instance of T (but does NOT retain ownership of the instance).
@@ -133,7 +133,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../../BOOST_EXTENSION_EXPORT_DECL.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.factory.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="basic_factory_map.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="../../BOOST_REFLECTION_CONSTRUCTI_FUNCTION_id293418.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.factory.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../../BOOST_PP_ITERATION_LIMITS_id293579.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/libs/extension/doc/html/boost/extensions/factory_map.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost/extensions/factory_map.html (original)
+++ sandbox/libs/extension/doc/html/boost/extensions/factory_map.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -7,7 +7,7 @@
<link rel="start" href="../../index.html" title="Chapter 1. Boost.Extension">
<link rel="up" href="../../boost_extension/reference.html#header.boost.extension.factory_map.hpp" title="Header <boost/extension/factory_map.hpp>">
<link rel="prev" href="basic_factory_map.html" title="Class template basic_factory_map">
-<link rel="next" href="../../BOOST_PP_ITERATION_LIMITS_id290432.html" title="Macro BOOST_PP_ITERATION_LIMITS">
+<link rel="next" href="../../BOOST_PP_ITERATION_LIMITS_id292527.html" title="Macro BOOST_PP_ITERATION_LIMITS">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -20,7 +20,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="basic_factory_map.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.factory_map.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../../BOOST_PP_ITERATION_LIMITS_id290432.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="basic_factory_map.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.factory_map.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../../BOOST_PP_ITERATION_LIMITS_id292527.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="refentry" lang="en">
<a name="boost.extensions.factory_map"></a><div class="titlepage"></div>
@@ -32,7 +32,7 @@
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
<span class="bold"><strong>typedef</strong></span> basic_factory_map< default_type_info > factory_map;</pre></div>
<div class="refsect1" lang="en">
-<a name="id450994"></a><h2>Description</h2>
+<a name="id456938"></a><h2>Description</h2>
<p>A typedef for convenience - provides the most common type of basic_factory_map. </p>
</div>
</div>
@@ -46,7 +46,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="basic_factory_map.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.factory_map.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../../BOOST_PP_ITERATION_LIMITS_id290432.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="basic_factory_map.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.factory_map.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../../BOOST_PP_ITERATION_LIMITS_id292527.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/libs/extension/doc/html/boost/extensions/shared_library.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost/extensions/shared_library.html (original)
+++ sandbox/libs/extension/doc/html/boost/extensions/shared_library.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -6,9 +6,8 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
<link rel="start" href="../../index.html" title="Chapter 1. Boost.Extension">
<link rel="up" href="../../boost_extension/reference.html#header.boost.extension.shared_library.hpp" title="Header <boost/extension/shared_library.hpp>">
-<link rel="prev" href="../../BOOST_PP_FILENAME_1_id290436.html" title="Macro BOOST_PP_FILENAME_1">
-<link rel="next" href="../../boost_extension/extension_reflection.html" title=" Boost.Reflection/Boost.Extension
- Interoperability">
+<link rel="prev" href="../../BOOST_PP_FILENAME_1_id292533.html" title="Macro BOOST_PP_FILENAME_1">
+<link rel="next" href="basic_type_map.html" title="Class template basic_type_map">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -21,7 +20,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../../BOOST_PP_FILENAME_1_id290436.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.shared_library.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../../boost_extension/extension_reflection.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="../../BOOST_PP_FILENAME_1_id292533.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.shared_library.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="basic_type_map.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="refentry" lang="en">
<a name="boost.extensions.shared_library"></a><div class="titlepage"></div>
@@ -34,28 +33,28 @@
<span class="bold"><strong>class</strong></span> shared_library {
<span class="bold"><strong>public</strong></span>:
<span class="emphasis"><em>// construct/copy/destruct</em></span>
- shared_library(<span class="bold"><strong>const</strong></span> std::string &, <span class="bold"><strong>bool</strong></span> = false);
- ~shared_library();
+ shared_library(<span class="bold"><strong>const</strong></span> std::string &, <span class="bold"><strong>bool</strong></span> = false);
+ ~shared_library();
- <span class="emphasis"><em>// public member functions</em></span>
- <span class="type"><span class="bold"><strong>bool</strong></span></span> is_open() <span class="bold"><strong>const</strong></span>;
- <span class="type"><span class="bold"><strong>bool</strong></span></span> open() ;
- <span class="type"><span class="bold"><strong>bool</strong></span></span> close() ;
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> is_open() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> open() ;
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> close() ;
<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> RetValue, <span class="bold"><strong>typename</strong></span> Params...>
- <span class="type">FunctionPtr< ReturnValue(Params...)></span> get(<span class="bold"><strong>const</strong></span> std::string &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">FunctionPtr< ReturnValue(Params...)></span> get(<span class="bold"><strong>const</strong></span> std::string &) <span class="bold"><strong>const</strong></span>;
};</pre></div>
<div class="refsect1" lang="en">
-<a name="id451422"></a><h2>Description</h2>
+<a name="id457366"></a><h2>Description</h2>
<p>
</p>
<div class="refsect2" lang="en">
-<a name="id451429"></a><h3>
+<a name="id457373"></a><h3>
<a name="boost.extensions.shared_libraryconstruct-copy-destruct"></a><code class="computeroutput">shared_library</code>
public
construct/copy/destruct</h3>
<div class="orderedlist"><ol type="1">
<li>
-<pre class="literallayout"><a name="id290571-bb"></a>shared_library(<span class="bold"><strong>const</strong></span> std::string & location, <span class="bold"><strong>bool</strong></span> auto_close = false);</pre>
+<pre class="literallayout"><a name="id292685-bb"></a>shared_library(<span class="bold"><strong>const</strong></span> std::string & location, <span class="bold"><strong>bool</strong></span> auto_close = false);</pre>
<p>shared_library constructor
</p>
<div class="variablelist"><table border="0">
@@ -82,17 +81,17 @@
</table></div>
</li>
<li>
-<pre class="literallayout"><a name="id290595-bb"></a>~shared_library();</pre>
+<pre class="literallayout"><a name="id292711-bb"></a>~shared_library();</pre>
<p>shared_library destructor If auto_close_ was set to true in the constructor, this closes the library if it is currently open. </p>
</li>
</ol></div>
</div>
<div class="refsect2" lang="en">
-<a name="id451545"></a><h3>
-<a name="id290455-bb"></a><code class="computeroutput">shared_library</code> public member functions</h3>
+<a name="id457490"></a><h3>
+<a name="id292558-bb"></a><code class="computeroutput">shared_library</code> public member functions</h3>
<div class="orderedlist"><ol type="1">
<li>
-<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id290457-bb"></a>is_open() <span class="bold"><strong>const</strong></span>;</pre>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id292561-bb"></a>is_open() <span class="bold"><strong>const</strong></span>;</pre>
<p>
@@ -119,7 +118,7 @@
</table></div>
</li>
<li>
-<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id290477-bb"></a>open() ;</pre>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id292582-bb"></a>open() ;</pre>
<p>
@@ -146,7 +145,7 @@
</table></div>
</li>
<li>
-<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id290500-bb"></a>close() ;</pre>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id292606-bb"></a>close() ;</pre>
<p>
@@ -174,7 +173,7 @@
</li>
<li>
<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> RetValue, <span class="bold"><strong>typename</strong></span> Params...>
- <span class="type">FunctionPtr< ReturnValue(Params...)></span> <a name="id290524-bb"></a>get(<span class="bold"><strong>const</strong></span> std::string & name) <span class="bold"><strong>const</strong></span>;</pre>
+ <span class="type">FunctionPtr< ReturnValue(Params...)></span> <a name="id292633-bb"></a>get(<span class="bold"><strong>const</strong></span> std::string & name) <span class="bold"><strong>const</strong></span>;</pre>
<p>A templated function taking as template arguments the type of the return value and parameters of a function to look up in the shared library.</p>
<p>This function must have been declared with the same parameters and return type and marked as extern "C".</p>
<p>Depending on platform and compiler settings, it may also be necessary to prefix the function with BOOST_EXTENSION_DECL, to make it externally visible.</p>
@@ -213,7 +212,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../../BOOST_PP_FILENAME_1_id290436.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.shared_library.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../../boost_extension/extension_reflection.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="../../BOOST_PP_FILENAME_1_id292533.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.shared_library.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="basic_type_map.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Added: sandbox/libs/extension/doc/html/boost/extensions/type_map.html
==============================================================================
--- (empty file)
+++ sandbox/libs/extension/doc/html/boost/extensions/type_map.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Type definition type_map</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Extension">
+<link rel="up" href="../../boost_extension/reference.html#header.boost.extension.type_map.hpp" title="Header <boost/extension/type_map.hpp>">
+<link rel="prev" href="basic_type_map/type_map_convertible/type_holder.html" title="Struct template type_holder">
+<link rel="next" href="../reflections/parameter_unavailable_exception.html" title="Class parameter_unavailable_exception">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="basic_type_map/type_map_convertible/type_holder.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.type_map.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../reflections/parameter_unavailable_exception.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.extensions.type_map"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Type definition type_map</span></h2>
+<p>type_map — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>typedef</strong></span> basic_type_map< default_type_info > type_map;</pre></div>
+<div class="refsect1" lang="en">
+<a name="id458690"></a><h2>Description</h2>
+<p>A typedef for convenience - provides the most common type of basic_factory_map. </p>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2008 Jeremy Pack<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="basic_type_map/type_map_convertible/type_holder.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.type_map.hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../reflections/parameter_unavailable_exception.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Modified: sandbox/libs/extension/doc/html/boost_extension/appendices.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost_extension/appendices.html (original)
+++ sandbox/libs/extension/doc/html/boost_extension/appendices.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -7,6 +7,7 @@
<link rel="start" href="../index.html" title="Chapter 1. Boost.Extension">
<link rel="up" href="../index.html" title="Chapter 1. Boost.Extension">
<link rel="prev" href="faq.html" title=" FAQ">
+<link rel="next" href="reference.html" title="Reference">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -19,85 +20,31 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="faq.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a>
+<a accesskey="p" href="faq.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="reference.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_extension.appendices"></a> Appendices</h2></div></div></div>
<div class="toc"><dl>
-<dt><span class="section"><a href="appendices.html#boost_extension.appendices.appendix_a"> Appendix A -
+<dt><span class="section"><a href="appendices.html#boost_extension.appendices.appendices_description"> Contents
+ in Appendices</a></span></dt>
+<dt><span class="section">Reference</span></dt>
+<dt><span class="section"><a href="appendices/appendix_a.html"> Appendix A -
Windows Export and Import Declarations</a></span></dt>
-<dt><span class="section"><a href="appendices.html#boost_extension.appendices.appendix_b"> Appendix B -
+<dt><span class="section"><a href="appendices/appendix_b.html"> Appendix B -
Optional Dependencies</a></span></dt>
</dl></div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_extension.appendices.appendix_a"></a><a href="appendices.html#boost_extension.appendices.appendix_a" title=" Appendix A -
- Windows Export and Import Declarations"> Appendix A -
- Windows Export and Import Declarations</a></h3></div></div></div>
-<p>
- On the Windows platform, special export declarations are required to make
- functions or classes in a .dll file accessible to the outside world. For
- normal usage of Boost.Extension, the only place this is required is in the
- one function that is exported from each .dll. The Hello World sample program
- illustrates how this is done using <code class="computeroutput"><span class="identifier">BOOST_EXTENSION_EXPORT</span></code>.
- </p>
-<p>
- For implementation inheritance across shared libraries, such as that in the
- Multiple Inheritance sample, each class that is not header-only that needs
- to be exported must have these declarations included. To make it more difficult,
- they must be different depending on whether the class is being imported into
- or exported from the current module. The Multiple Inheritance sample shows
- how this is done.
- </p>
-<a name="boost_extension.appendices.appendix_a.warning"></a><h3>
-<a name="id463774"></a>
- Warning
- </h3>
-<p>
- Now for a word of warning that many of you will ignore: In the great majority
- of cases, even if non-header-only implementation inheritance across shared
- libraries seems like a good idea, there is probably a better solution. Although
- it certainly has its uses, it can cause problems like the following:
+<a name="boost_extension.appendices.appendices_description"></a><a href="appendices.html#boost_extension.appendices.appendices_description" title=" Contents
+ in Appendices"> Contents
+ in Appendices</a></h3></div></div></div>
+<p>
+ The reference documentation for both the Boost.Extension and Boost.Reflection
+ libraries are contained here, until it is decided where (and if) to split
+ the two libraries, since they share many pieces of functionality.
</p>
-<div class="itemizedlist"><ul type="disc">
-<li>
- Version problems - if the original implementation changes at all, every
- dependent shared library must be recompiled with the new implementation.
- </li>
-<li>
- Tight coupling between shared libraries. One of the primary reasons for
- using shared libraries is to decrease coupling, and promote reuse.
- </li>
-<li>
- It can lead to overly complicated, over-designed class hierarchies.
- </li>
-</ul></div>
</div>
-<div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_extension.appendices.appendix_b"></a><a href="appendices.html#boost_extension.appendices.appendix_b" title=" Appendix B -
- Optional Dependencies"> Appendix B -
- Optional Dependencies</a></h3></div></div></div>
-<p>
- As suggested by Boost guidelines and our thoughts, we tried to keep the number
- of dependencies of Boost.Extension at the minimum. But we also wanted to
- take advantage of several boost libraries that have additional features and
- are easy to use.
- </p>
-<p>
- For basic use of the library, currently only Boost.Preprocessor is required.
- There are certain convenience headers that rely on other libraries, such
- as Boost.Filesystem.
- </p>
-<p>
- Also, the <code class="computeroutput"><span class="identifier">shared_library</span></code>
- class has been designed to be easy to use with Boost.Function. It returns
- function pointers that can be loaded directly into Boost.Function objects.
- </p>
-</div>
-<p>
- </p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
@@ -109,7 +56,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="faq.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a>
+<a accesskey="p" href="faq.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="reference.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/libs/extension/doc/html/boost_extension/appendices/appendix_a.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost_extension/appendices/appendix_a.html (original)
+++ sandbox/libs/extension/doc/html/boost_extension/appendices/appendix_a.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -1,30 +1,34 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title> Appendix A - Windows Export and Import Declarations</title>
+<title> Appendix A -
+ Windows Export and Import Declarations</title>
<link rel="stylesheet" href="../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
<link rel="start" href="../../index.html" title="Chapter 1. Boost.Extension">
<link rel="up" href="../appendices.html" title=" Appendices">
-<link rel="prev" href="../appendices.html" title=" Appendices">
-<link rel="next" href="appendix_b.html" title=" Appendix B - Optional Dependencies">
+<link rel="prev" href="../../boost/reflections/basic_reflection/reflector.html" title="Class template reflector">
+<link rel="next" href="appendix_b.html" title=" Appendix B -
+ Optional Dependencies">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
-<td align="center">Home</td>
+<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../appendices.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="appendix_b.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="../../boost/reflections/basic_reflection/reflector.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="appendix_b.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_extension.appendices.appendix_a"></a> Appendix A - Windows Export and Import Declarations</h3></div></div></div>
+<a name="boost_extension.appendices.appendix_a"></a><a href="appendix_a.html" title=" Appendix A -
+ Windows Export and Import Declarations"> Appendix A -
+ Windows Export and Import Declarations</a></h3></div></div></div>
<p>
On the Windows platform, special export declarations are required to make
functions or classes in a .dll file accessible to the outside world. For
@@ -41,8 +45,8 @@
how this is done.
</p>
<a name="boost_extension.appendices.appendix_a.warning"></a><h3>
-<a name="id938041"></a>
- Warning
+<a name="id466257"></a>
+ Warning
</h3>
<p>
Now for a word of warning that many of you will ignore: In the great majority
@@ -66,7 +70,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
-<td align="right"><div class="copyright-footer">Copyright © 2007 Jeremy Pack, Mariano G. Consoni<p>
+<td align="right"><div class="copyright-footer">Copyright © 2008 Jeremy Pack<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
@@ -74,7 +78,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../appendices.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="appendix_b.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="../../boost/reflections/basic_reflection/reflector.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="appendix_b.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/libs/extension/doc/html/boost_extension/appendices/appendix_b.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost_extension/appendices/appendix_b.html (original)
+++ sandbox/libs/extension/doc/html/boost_extension/appendices/appendix_b.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -7,7 +7,8 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
<link rel="start" href="../../index.html" title="Chapter 1. Boost.Extension">
<link rel="up" href="../appendices.html" title=" Appendices">
-<link rel="prev" href="../appendices.html" title=" Appendices">
+<link rel="prev" href="appendix_a.html" title=" Appendix A -
+ Windows Export and Import Declarations">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -20,7 +21,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../appendices.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a>
+<a accesskey="p" href="appendix_a.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
@@ -54,7 +55,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../appendices.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a>
+<a accesskey="p" href="appendix_a.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../appendices.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a>
</div>
</body>
</html>
Added: sandbox/libs/extension/doc/html/boost_extension/extension.html
==============================================================================
--- (empty file)
+++ sandbox/libs/extension/doc/html/boost_extension/extension.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -0,0 +1,183 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>-reflection Boost.Reflection/Boost.Extension
+ Interoperability</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Extension">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Extension">
+<link rel="prev" href="tutorials.html" title="Tutorials">
+<link rel="next" href="reference.html" title="Reference">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="tutorials.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="reference.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_extension.extension"></a><a href="extension.html" title="-reflection Boost.Reflection/Boost.Extension
+ Interoperability">-reflection Boost.Reflection/Boost.Extension
+ Interoperability</a></h2></div></div></div>
+<p>
+ Reflections are designed to work with Boost.Extension, or with shared libraries
+ in general. A simple example is included in examples<span class="emphasis"><em>extension</em></span>.
+ </p>
+<p>
+ Declaring the reflected class itself is similar to the process for doing the
+ same in Boost.Extension.
+ </p>
+<p>
+ Here's how the Jamfile for these libraries is defined. Note that, like in Boost.Extension,
+ one can rename the shared library extensions, for consistency across platforms.
+ Here, we use the .reflection suffix for each shared library.
+</p>
+<pre class="programlisting"><span class="identifier">import</span> <span class="identifier">type</span> <span class="special">:</span> <span class="identifier">change</span><span class="special">-</span><span class="identifier">generated</span><span class="special">-</span><span class="identifier">target</span><span class="special">-</span><span class="identifier">suffix</span> <span class="special">;</span>
+<span class="identifier">import</span> <span class="identifier">type</span> <span class="special">:</span> <span class="identifier">change</span><span class="special">-</span><span class="identifier">generated</span><span class="special">-</span><span class="identifier">target</span><span class="special">-</span><span class="identifier">prefix</span> <span class="special">;</span>
+<span class="identifier">type</span><span class="special">.</span><span class="identifier">change</span><span class="special">-</span><span class="identifier">generated</span><span class="special">-</span><span class="identifier">target</span><span class="special">-</span><span class="identifier">suffix</span> <span class="identifier">SHARED_LIB</span> <span class="special">:</span> <span class="special">:</span> <span class="identifier">reflection</span> <span class="special">;</span>
+<span class="identifier">type</span><span class="special">.</span><span class="identifier">change</span><span class="special">-</span><span class="identifier">generated</span><span class="special">-</span><span class="identifier">target</span><span class="special">-</span><span class="identifier">prefix</span> <span class="identifier">SHARED_LIB</span> <span class="special">:</span> <span class="special">:</span> <span class="identifier">lib</span> <span class="special">;</span>
+<span class="identifier">exe</span> <span class="identifier">extension</span><span class="special">-</span><span class="identifier">reflection</span> <span class="special">:</span> <span class="identifier">extension</span><span class="special">/</span><span class="identifier">extension</span><span class="special">.</span><span class="identifier">cpp</span> <span class="special">;</span>
+<span class="identifier">lib</span> <span class="identifier">car_lib</span> <span class="special">:</span> <span class="identifier">extension</span><span class="special">/</span><span class="identifier">car_lib</span><span class="special">.</span><span class="identifier">cpp</span> <span class="special">:</span> <span class="special"><</span><span class="identifier">link</span><span class="special">></span><span class="identifier">shared</span> <span class="special">;</span>
+</pre>
+<p>
+ </p>
+<p>
+ The code in the shared library is defined in libs/reflection/examples/extension/car_lib.cpp.
+ </p>
+<p>
+ We define two classes to export as reflections. Note that they are not derived
+ from the same base class. If we were using Boost.Extension factories, this
+ would be required.
+</p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">suv</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">suv</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">name</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">car</span><span class="special">(</span><span class="identifier">name</span><span class="special">)</span> <span class="special">{}</span>
+ <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">get_type</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="string">"It's an SUV."</span><span class="special">;</span> <span class="special">}</span>
+ <span class="special">~</span><span class="identifier">suv</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{}</span>
+<span class="special">};</span>
+
+<span class="keyword">class</span> <span class="identifier">compact</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">compact</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">name</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">car</span><span class="special">(</span><span class="identifier">name</span><span class="special">)</span> <span class="special">{}</span>
+ <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">get_type</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="string">"It's a compact."</span><span class="special">;</span> <span class="special">}</span>
+ <span class="special">~</span><span class="identifier">compact</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{}</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<p>
+ Just like Boost.Extension, an external function needs to be defined that will
+ be called by the main module.
+ </p>
+<p>
+ extern "C" void BOOST_EXTENSION_EXPORT_DECL extension_export_car(std::map<std::string,
+ reflection> reflection_map) { reflection_map“<span class="quote">suv"</span>” .reflect<suv>()
+ .constructor<const char*>() .function(&suv::get_type, "get_type");
+ reflection_map“<span class="quote">suv"</span>” .reflect<compact>() .constructor<const
+ char*>() .function(&compact::get_type, "get_type"); }
+ </p>
+<p>
+ This is all that is necessary to export one constructor and one function for
+ each class.
+ </p>
+<p>
+ Now, in extension.cpp, we combine Boost.Extension and Boost.Reflection code
+ to load and use the reflections declared in the shared library.
+ </p>
+<p>
+ Create a mapping of reflections to strings that will be populated inside the
+ shared library.
+</p>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">reflection</span><span class="special">></span> <span class="identifier">reflection_map</span><span class="special">;</span>
+</pre>
+<p>
+ Load the shared library using Boost.Extension.
+</p>
+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">extensions</span><span class="special">::</span><span class="identifier">shared_library</span> <span class="identifier">lib</span>
+ <span class="special">((</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">(</span><span class="identifier">BOOST_EXTENSION_DIR_START</span><span class="special">)</span> <span class="special">+</span>
+ <span class="string">"libcar_lib.extension"</span><span class="special">).</span><span class="identifier">c_str</span><span class="special">());</span>
+<span class="identifier">lib</span><span class="special">.</span><span class="identifier">open</span><span class="special">();</span>
+</pre>
+<p>
+ Call an exported function to populate reflection_map.
+</p>
+<pre class="programlisting"><span class="identifier">lib</span><span class="special">.</span><span class="identifier">get</span><span class="special"><</span><span class="keyword">void</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span>
+ <span class="identifier">reflection</span><span class="special">></span> <span class="special">&></span>
+ <span class="special">(</span><span class="string">"extension_export_car"</span><span class="special">)(</span><span class="identifier">reflection_map</span><span class="special">);</span>
+<span class="keyword">if</span> <span class="special">(</span><span class="identifier">reflection_map</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special">!=</span> <span class="identifier">size_t</span><span class="special">(</span><span class="number">2</span><span class="special">))</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Could not load reflections!"</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="number">1</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Pull out two reflections that were named "suv" and "compact"
+ respectively.
+</p>
+<pre class="programlisting"><span class="identifier">reflection</span> <span class="special">&</span> <span class="identifier">first_reflection</span> <span class="special">=</span>
+ <span class="identifier">reflection_map</span><span class="special">[</span><span class="string">"suv"</span><span class="special">];</span>
+<span class="identifier">reflection</span> <span class="special">&</span> <span class="identifier">second_reflection</span> <span class="special">=</span>
+ <span class="identifier">reflection_map</span><span class="special">[</span><span class="string">"compact"</span><span class="special">];</span>
+</pre>
+<p>
+ Use the get_constructor function to find a constructor that takes one argument,
+ a const char*.
+</p>
+<pre class="programlisting"><span class="identifier">instance_constructor</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*></span> <span class="identifier">first_constructor</span> <span class="special">=</span>
+ <span class="identifier">first_reflection</span><span class="special">.</span><span class="identifier">get_constructor</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*>();</span>
+</pre>
+<p>
+ Use the constructor retrieved to create an instance. Warning! instances should
+ only be used with functions and constructors generated by a single reflection
+ object.
+</p>
+<pre class="programlisting"><span class="identifier">instance</span> <span class="identifier">first_instance</span> <span class="special">=</span>
+ <span class="identifier">first_constructor</span><span class="special">(</span><span class="string">"First Instance"</span><span class="special">);</span>
+</pre>
+<p>
+ Get a function to call on this instance.
+</p>
+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">reflections</span><span class="special">::</span><span class="identifier">function</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*></span> <span class="identifier">first_function</span> <span class="special">=</span>
+ <span class="identifier">first_reflection</span><span class="special">.</span><span class="identifier">get_function</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*>(</span><span class="string">"get_type"</span><span class="special">);</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"First reflection: "</span> <span class="special"><<</span> <span class="identifier">first_function</span><span class="special">(</span><span class="identifier">first_instance</span><span class="special">)</span>
+ <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ </pre>
+<p>
+ Repeat the steps for the second reflection.
+</p>
+<pre class="programlisting"><span class="identifier">instance_constructor</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*></span> <span class="identifier">second_constructor</span> <span class="special">=</span>
+ <span class="identifier">second_reflection</span><span class="special">.</span><span class="identifier">get_constructor</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*>();</span>
+<span class="identifier">instance</span> <span class="identifier">second_instance</span> <span class="special">=</span>
+ <span class="identifier">second_constructor</span><span class="special">(</span><span class="string">"Second Instance"</span><span class="special">);</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">reflections</span><span class="special">::</span><span class="identifier">function</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*></span> <span class="identifier">second_function</span> <span class="special">=</span>
+ <span class="identifier">second_reflection</span><span class="special">.</span><span class="identifier">get_function</span><span class="special"><</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*>(</span><span class="string">"get_type"</span><span class="special">);</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Second reflection: "</span> <span class="special"><<</span> <span class="identifier">second_function</span><span class="special">(</span><span class="identifier">second_instance</span><span class="special">)</span>
+ <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+</pre>
+<p>
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2008 Jeremy Pack<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="tutorials.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="reference.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Modified: sandbox/libs/extension/doc/html/boost_extension/extension_reflection.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost_extension/extension_reflection.html (original)
+++ sandbox/libs/extension/doc/html/boost_extension/extension_reflection.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -7,8 +7,8 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
<link rel="start" href="../index.html" title="Chapter 1. Boost.Extension">
<link rel="up" href="../index.html" title="Chapter 1. Boost.Extension">
-<link rel="prev" href="../boost/extensions/shared_library.html" title="Class shared_library">
-<link rel="next" href="reference.html" title="Reference">
+<link rel="prev" href="tutorials/tutorial05.html" title=" Tutorial 5">
+<link rel="next" href="info.html" title=" Info Classes">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -21,7 +21,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../boost/extensions/shared_library.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="reference.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="tutorials/tutorial05.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="info.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -177,7 +177,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../boost/extensions/shared_library.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="reference.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="tutorials/tutorial05.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="info.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/libs/extension/doc/html/boost_extension/factories.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost_extension/factories.html (original)
+++ sandbox/libs/extension/doc/html/boost_extension/factories.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -6,7 +6,8 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
<link rel="start" href="../index.html" title="Chapter 1. Boost.Extension">
<link rel="up" href="../index.html" title="Chapter 1. Boost.Extension">
-<link rel="prev" href="shared_libraries.html" title=" Shared Libraries">
+<link rel="prev" href="shared_libraries/shared_library_class.html" title="shared_library
+ class">
<link rel="next" href="tutorials.html" title="Tutorials">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -20,7 +21,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="shared_libraries.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="tutorials.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="shared_libraries/shared_library_class.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="tutorials.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -50,7 +51,7 @@
are:
</p>
<a name="boost_extension.factories.void_set_lt_d_gt___"></a><h3>
-<a name="id435884"></a>
+<a name="id436208"></a>
<a href="factories.html#boost_extension.factories.void_set_lt_d_gt___">void set<D>()</a>
</h3>
<p>
@@ -60,7 +61,7 @@
This function may be called multiple times, to change the factory function.
</p>
<a name="boost_extension.factories.bool_is_valid__"></a><h3>
-<a name="id435933"></a>
+<a name="id436257"></a>
<a href="factories.html#boost_extension.factories.bool_is_valid__">bool is_valid()</a>
</h3>
<p>
@@ -77,7 +78,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="shared_libraries.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="tutorials.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="shared_libraries/shared_library_class.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="tutorials.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/libs/extension/doc/html/boost_extension/faq.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost_extension/faq.html (original)
+++ sandbox/libs/extension/doc/html/boost_extension/faq.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -6,7 +6,7 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
<link rel="start" href="../index.html" title="Chapter 1. Boost.Extension">
<link rel="up" href="../index.html" title="Chapter 1. Boost.Extension">
-<link rel="prev" href="performance_analysis.html" title=" Performance Analysis">
+<link rel="prev" href="type_safety.html" title=" Type Safety of Boost.Extension">
<link rel="next" href="appendices.html" title=" Appendices">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -20,7 +20,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="performance_analysis.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="appendices.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="type_safety.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="appendices.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -64,7 +64,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="performance_analysis.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="appendices.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="type_safety.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="appendices.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Added: sandbox/libs/extension/doc/html/boost_extension/header_reference.html
==============================================================================
--- (empty file)
+++ sandbox/libs/extension/doc/html/boost_extension/header_reference.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -0,0 +1,161 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Header Reference</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Extension">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Extension">
+<link rel="prev" href="extension_reflection.html" title=" Boost.Reflection/Boost.Extension
+ Interoperability">
+<link rel="next" href="../boost/extensions/adaptable_factory.html" title="Class template adaptable_factory">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="extension_reflection.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../boost/extensions/adaptable_factory.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_extension.header_reference"></a> Header Reference</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Reference</span></dt>
+<dt><span class="section">Reference</span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_extension.reference"></a>Reference</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Header <boost/extension/adaptable_factory.hpp></span></dt>
+<dt><span class="section">Header <boost/extension/common.hpp></span></dt>
+<dt><span class="section">Header <boost/extension/convenience.hpp></span></dt>
+<dt><span class="section">Header <boost/extension/extension.hpp></span></dt>
+<dt><span class="section">Header <boost/extension/factory.hpp></span></dt>
+<dt><span class="section">Header <boost/extension/factory_map.hpp></span></dt>
+<dt><span class="section">Header <boost/extension/filesystem.hpp></span></dt>
+<dt><span class="section">Header <boost/extension/functor.hpp></span></dt>
+<dt><span class="section">Header <boost/extension/shared_library.hpp></span></dt>
+<dt><span class="section">Header <boost/extension/type_map.hpp></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.extension.adaptable_factory.hpp"></a>Header <boost/extension/adaptable_factory.hpp></h4></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> extensions {
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Interface, <span class="bold"><strong>typename</strong></span> Info = std::string,
+ <span class="bold"><strong>typename</strong></span> TypeInfo = default_type_info>
+ <span class="bold"><strong>class</strong></span> adaptable_factory;
+ <span class="bold"><strong>namespace</strong></span> impl {
+ }
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.extension.common.hpp"></a>Header <boost/extension/common.hpp></h4></div></div></div>
+<pre class="synopsis">
+
+BOOST_EXTENSION_MAX_FUNCTOR_PARAMS</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.extension.convenience.hpp"></a>Header <boost/extension/convenience.hpp></h4></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> extensions {
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> load_single_library(factory_map &, <span class="bold"><strong>const</strong></span> std::string &,
+ <span class="bold"><strong>const</strong></span> std::string &);
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.extensions.load_single_library_id290910"></a>load_single_library(type_map & current_type_map,
+ <span class="bold"><strong>const</strong></span> std::string & library_path,
+ <span class="bold"><strong>const</strong></span> std::string & external_function_name);
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.extension.extension.hpp"></a>Header <boost/extension/extension.hpp></h4></div></div></div>
+<pre class="synopsis">
+
+BOOST_EXTENSION_EXPORT_DECL</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.extension.factory.hpp"></a>Header <boost/extension/factory.hpp></h4></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> extensions {
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Params...> <span class="bold"><strong>class</strong></span> factory;
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.extension.factory_map.hpp"></a>Header <boost/extension/factory_map.hpp></h4></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> extensions {
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> TypeInfo> <span class="bold"><strong>class</strong></span> basic_factory_map;
+ <span class="bold"><strong>typedef</strong></span> basic_factory_map< default_type_info > factory_map;
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.extension.filesystem.hpp"></a>Header <boost/extension/filesystem.hpp></h4></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> extensions {
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="boost.extensions.load_all_libraries"></a>load_all_libraries(factory_map & current_zone,
+ <span class="bold"><strong>const</strong></span> <span class="bold"><strong>char</strong></span> * directory,
+ <span class="bold"><strong>const</strong></span> <span class="bold"><strong>char</strong></span> * external_function_name,
+ <span class="bold"><strong>int</strong></span> max_depth = 0);
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.extension.functor.hpp"></a>Header <boost/extension/functor.hpp></h4></div></div></div>
+<pre class="synopsis">
+
+BOOST_PP_ITERATION_LIMITS
+BOOST_PP_FILENAME_1</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.extension.shared_library.hpp"></a>Header <boost/extension/shared_library.hpp></h4></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> extensions {
+ <span class="bold"><strong>class</strong></span> shared_library;
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.extension.type_map.hpp"></a>Header <boost/extension/type_map.hpp></h4></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> extensions {
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> TypeInfo> <span class="bold"><strong>class</strong></span> basic_type_map;
+ <span class="bold"><strong>typedef</strong></span> basic_type_map< default_type_info > type_map;
+ }
+}</pre>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2008 Jeremy Pack<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="extension_reflection.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../boost/extensions/adaptable_factory.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Modified: sandbox/libs/extension/doc/html/boost_extension/info.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost_extension/info.html (original)
+++ sandbox/libs/extension/doc/html/boost_extension/info.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -6,7 +6,8 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
<link rel="start" href="../index.html" title="Chapter 1. Boost.Extension">
<link rel="up" href="../index.html" title="Chapter 1. Boost.Extension">
-<link rel="prev" href="../boost/reflections/basic_reflection/reflector.html" title="Class template reflector">
+<link rel="prev" href="extension_reflection.html" title=" Boost.Reflection/Boost.Extension
+ Interoperability">
<link rel="next" href="performance_analysis.html" title=" Performance Analysis">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -20,7 +21,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../boost/reflections/basic_reflection/reflector.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="performance_analysis.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="extension_reflection.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="performance_analysis.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -244,7 +245,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../boost/reflections/basic_reflection/reflector.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="performance_analysis.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="extension_reflection.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="performance_analysis.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/libs/extension/doc/html/boost_extension/introduction.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost_extension/introduction.html (original)
+++ sandbox/libs/extension/doc/html/boost_extension/introduction.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -7,48 +7,72 @@
<link rel="start" href="../index.html" title="Chapter 1. Boost.Extension">
<link rel="up" href="../index.html" title="Chapter 1. Boost.Extension">
<link rel="prev" href="../index.html" title="Chapter 1. Boost.Extension">
-<link rel="next" href="tutorials.html" title="Tutorials">
+<link rel="next" href="motivation.html" title=" Motivation">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
-<td align="center">Home</td>
+<td align="center">Home</td>
<td align="center">Libraries</td>
-<td align="center">People</td>
-<td align="center">FAQ</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
<td align="center">More</td>
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../index.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="tutorials.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="../index.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="motivation.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="boost_extension.introduction"></a> Introduction</h2></div></div></div>
+<a name="boost_extension.introduction"></a> Introduction</h2></div></div></div>
<p>
The Boost.Extension library has been developed to ease the development of plugins
- and similar extensions to software. Classes can be made available from shared
- libraries and loaded by the application.
+ and similar extensions to software using shared libraries. Classes, functions
+ and data can be made available from shared libraries and loaded by the application.
</p>
<p>
+ It consists of the following parts:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Shared library handling
+ </li>
+<li>
+ Typed data containers
+ </li>
+<li>
+ Factories
+ </li>
+<li>
+ Reflection
+ </li>
+</ul></div>
+<p>
Among others, the library has the following features:
</p>
<div class="itemizedlist"><ul type="disc">
<li>
- Multiple and virtual inheritance are supported
+ Multiple and virtual inheritance are supported.
</li>
<li>
Library users do not need to use any macros (besides those required by Windows
- for exported functions)
+ for exported functions).
+ </li>
+<li>
+ Only one external function required per shared library to export classes.
</li>
<li>
- Only one external function required per shared library to export classes
+ RTTI is used by default, but it is possible to use user-defined type identification.
</li>
<li>
- RTTI is used by default, but it is possible to use user-defined type identification
+ Classes do not need to be modified to be loadable through factories or reflection.
</li>
<li>
- Classes do not need to be modified to be loadable
+ Constructors can be called even when the signature is unknown, for both factories
+ and reflection.
+ </li>
+<li>
+ Run-time compilation and loading of shared libraries.
</li>
</ul></div>
<p>
@@ -56,10 +80,14 @@
in the Boost C++ Libraries. For ongoing status updates, check <a href="http://boost-extension.blogspot.com/" target="_top">C++
Plugins and Reflection</a>.
</p>
+<p>
+ The most up-to-date portions of this documentation are the header references.
+ Other sections of the documentation will be updated in the coming weeks.
+ </p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
-<td align="right"><div class="copyright-footer">Copyright © 2007 Jeremy Pack, Mariano G. Consoni<p>
+<td align="right"><div class="copyright-footer">Copyright © 2008 Jeremy Pack<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
@@ -67,7 +95,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../index.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="tutorials.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="../index.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="motivation.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/libs/extension/doc/html/boost_extension/motivation.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost_extension/motivation.html (original)
+++ sandbox/libs/extension/doc/html/boost_extension/motivation.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -6,7 +6,7 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
<link rel="start" href="../index.html" title="Chapter 1. Boost.Extension">
<link rel="up" href="../index.html" title="Chapter 1. Boost.Extension">
-<link rel="prev" href="../index.html" title="Chapter 1. Boost.Extension">
+<link rel="prev" href="introduction.html" title=" Introduction">
<link rel="next" href="shared_libraries.html" title=" Shared Libraries">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -20,7 +20,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../index.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="shared_libraries.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="introduction.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="shared_libraries.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -86,7 +86,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../index.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="shared_libraries.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="introduction.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="shared_libraries.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/libs/extension/doc/html/boost_extension/performance_analysis.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost_extension/performance_analysis.html (original)
+++ sandbox/libs/extension/doc/html/boost_extension/performance_analysis.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -7,7 +7,7 @@
<link rel="start" href="../index.html" title="Chapter 1. Boost.Extension">
<link rel="up" href="../index.html" title="Chapter 1. Boost.Extension">
<link rel="prev" href="info.html" title=" Info Classes">
-<link rel="next" href="faq.html" title=" FAQ">
+<link rel="next" href="type_safety.html" title=" Type Safety of Boost.Extension">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -20,7 +20,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="info.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="faq.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="info.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="type_safety.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -41,7 +41,7 @@
Boost) more optimization will be performed.
</p>
<a name="boost_extension.performance_analysis.first_comparison"></a><h1>
-<a name="id463328"></a>
+<a name="id454716"></a>
<a href="performance_analysis.html#boost_extension.performance_analysis.first_comparison">First
comparison</a>
</h1>
@@ -74,7 +74,7 @@
So Boost.Extension is (aprox.) three times slower.
</p>
<a name="boost_extension.performance_analysis.multiple_calls_and_libraries"></a><h1>
-<a name="id463415"></a>
+<a name="id454802"></a>
<a href="performance_analysis.html#boost_extension.performance_analysis.multiple_calls_and_libraries">Multiple
calls and libraries</a>
</h1>
@@ -124,7 +124,7 @@
RTTI works across shared libraries.
</p>
<a name="boost_extension.performance_analysis.boost__function_overhead"></a><h1>
-<a name="id463422"></a>
+<a name="id454809"></a>
<a href="performance_analysis.html#boost_extension.performance_analysis.boost__function_overhead">boost::function
overhead</a>
</h1>
@@ -156,7 +156,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="info.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="faq.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="info.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="type_safety.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/libs/extension/doc/html/boost_extension/reference.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost_extension/reference.html (original)
+++ sandbox/libs/extension/doc/html/boost_extension/reference.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -5,10 +5,9 @@
<link rel="stylesheet" href="../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
<link rel="start" href="../index.html" title="Chapter 1. Boost.Extension">
-<link rel="up" href="../index.html" title="Chapter 1. Boost.Extension">
-<link rel="prev" href="extension_reflection.html" title=" Boost.Reflection/Boost.Extension
- Interoperability">
-<link rel="next" href="../boost/reflections/parameter_unavailable_exception.html" title="Class parameter_unavailable_exception">
+<link rel="up" href="appendices.html" title=" Appendices">
+<link rel="prev" href="appendices.html" title=" Appendices">
+<link rel="next" href="../boost/extensions/adaptable_factory.html" title="Class template adaptable_factory">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -21,19 +20,29 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="extension_reflection.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../boost/reflections/parameter_unavailable_exception.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="appendices.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="appendices.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../boost/extensions/adaptable_factory.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
-<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="boost_extension.reference"></a>Reference</h2></div></div></div>
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_extension.reference"></a>Reference</h3></div></div></div>
<div class="toc"><dl>
+<dt><span class="section">Header <boost/extension/adaptable_factory.hpp></span></dt>
+<dt><span class="section">Header <boost/extension/convenience.hpp></span></dt>
+<dt><span class="section">Header <boost/extension/extension.hpp></span></dt>
+<dt><span class="section">Header <boost/extension/factory_map.hpp></span></dt>
+<dt><span class="section">Header <boost/extension/filesystem.hpp></span></dt>
+<dt><span class="section">Header <boost/extension/functor.hpp></span></dt>
+<dt><span class="section">Header <boost/extension/shared_library.hpp></span></dt>
+<dt><span class="section">Header <boost/extension/type_map.hpp></span></dt>
<dt><span class="section">Header <boost/reflection/adapter.hpp></span></dt>
<dt><span class="section">Header <boost/reflection/common.hpp></span></dt>
+<dt><span class="section">Header <boost/extension/common.hpp></span></dt>
<dt><span class="section">Header <boost/reflection/constructor.hpp></span></dt>
<dt><span class="section">Header <boost/reflection/constructor_info.hpp></span></dt>
<dt><span class="section">Header <boost/reflection/data.hpp></span></dt>
<dt><span class="section">Header <boost/reflection/data_info.hpp></span></dt>
<dt><span class="section">Header <boost/reflection/factory.hpp></span></dt>
+<dt><span class="section">Header <boost/extension/factory.hpp></span></dt>
<dt><span class="section">Header <boost/reflection/function.hpp></span></dt>
<dt><span class="section">Header <boost/reflection/function_info.hpp></span></dt>
<dt><span class="section">Header <boost/reflection/generic_constructor.hpp></span></dt>
@@ -43,8 +52,90 @@
<dt><span class="section">Header <boost/reflection/reflection.hpp></span></dt>
</dl></div>
<div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="header.boost.reflection.adapter.hpp"></a>Header <boost/reflection/adapter.hpp></h3></div></div></div>
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.extension.adaptable_factory.hpp"></a>Header <boost/extension/adaptable_factory.hpp></h4></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> extensions {
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Interface, <span class="bold"><strong>typename</strong></span> Info = std::string,
+ <span class="bold"><strong>typename</strong></span> TypeInfo = default_type_info>
+ <span class="bold"><strong>class</strong></span> adaptable_factory;
+ <span class="bold"><strong>namespace</strong></span> impl {
+ }
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.extension.convenience.hpp"></a>Header <boost/extension/convenience.hpp></h4></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> extensions {
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> load_single_library(factory_map &, <span class="bold"><strong>const</strong></span> std::string &,
+ <span class="bold"><strong>const</strong></span> std::string &);
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.extensions.load_single_library_id292336"></a>load_single_library(type_map & current_type_map,
+ <span class="bold"><strong>const</strong></span> std::string & library_path,
+ <span class="bold"><strong>const</strong></span> std::string & external_function_name);
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.extension.extension.hpp"></a>Header <boost/extension/extension.hpp></h4></div></div></div>
+<pre class="synopsis">
+
+BOOST_EXTENSION_EXPORT_DECL</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.extension.factory_map.hpp"></a>Header <boost/extension/factory_map.hpp></h4></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> extensions {
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> TypeInfo> <span class="bold"><strong>class</strong></span> basic_factory_map;
+ <span class="bold"><strong>typedef</strong></span> basic_factory_map< default_type_info > factory_map;
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.extension.filesystem.hpp"></a>Header <boost/extension/filesystem.hpp></h4></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> extensions {
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="boost.extensions.load_all_libraries"></a>load_all_libraries(factory_map & current_zone,
+ <span class="bold"><strong>const</strong></span> <span class="bold"><strong>char</strong></span> * directory,
+ <span class="bold"><strong>const</strong></span> <span class="bold"><strong>char</strong></span> * external_function_name,
+ <span class="bold"><strong>int</strong></span> max_depth = 0);
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.extension.functor.hpp"></a>Header <boost/extension/functor.hpp></h4></div></div></div>
+<pre class="synopsis">
+
+BOOST_PP_ITERATION_LIMITS
+BOOST_PP_FILENAME_1</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.extension.shared_library.hpp"></a>Header <boost/extension/shared_library.hpp></h4></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> extensions {
+ <span class="bold"><strong>class</strong></span> shared_library;
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.extension.type_map.hpp"></a>Header <boost/extension/type_map.hpp></h4></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> extensions {
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> TypeInfo> <span class="bold"><strong>class</strong></span> basic_type_map;
+ <span class="bold"><strong>typedef</strong></span> basic_type_map< default_type_info > type_map;
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.reflection.adapter.hpp"></a>Header <boost/reflection/adapter.hpp></h4></div></div></div>
<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
<span class="bold"><strong>namespace</strong></span> reflections {
<span class="bold"><strong>class</strong></span> parameter_unavailable_exception;
@@ -56,25 +147,32 @@
}</pre>
</div>
<div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="header.boost.reflection.common.hpp"></a>Header <boost/reflection/common.hpp></h3></div></div></div>
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.reflection.common.hpp"></a>Header <boost/reflection/common.hpp></h4></div></div></div>
<pre class="synopsis">
<a href="../BOOST_REFLECTION_MAX_FUNCTOR_PARAMS.html" title="Macro BOOST_REFLECTION_MAX_FUNCTOR_PARAMS">BOOST_REFLECTION_MAX_FUNCTOR_PARAMS</a></pre>
</div>
<div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="header.boost.reflection.constructor.hpp"></a>Header <boost/reflection/constructor.hpp></h3></div></div></div>
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.extension.common.hpp"></a>Header <boost/extension/common.hpp></h4></div></div></div>
<pre class="synopsis">
-BOOST_PP_ITERATION_LIMITS
-BOOST_PP_FILENAME_1</pre>
+BOOST_EXTENSION_MAX_FUNCTOR_PARAMS</pre>
</div>
-<div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title">
-<a name="header.boost.reflection.constructor_info.hpp"></a>Header <boost/reflection/constructor_info.hpp></h3></div></div></div></div>
<div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="header.boost.reflection.data.hpp"></a>Header <boost/reflection/data.hpp></h3></div></div></div>
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.reflection.constructor.hpp"></a>Header <boost/reflection/constructor.hpp></h4></div></div></div>
+<pre class="synopsis">
+
+BOOST_PP_ITERATION_LIMITS
+BOOST_PP_FILENAME_1</pre>
+</div>
+<div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.reflection.constructor_info.hpp"></a>Header <boost/reflection/constructor_info.hpp></h4></div></div></div></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.reflection.data.hpp"></a>Header <boost/reflection/data.hpp></h4></div></div></div>
<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
<span class="bold"><strong>namespace</strong></span> reflections {
<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="bold"><strong>class</strong></span> data;
@@ -87,8 +185,8 @@
}</pre>
</div>
<div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="header.boost.reflection.data_info.hpp"></a>Header <boost/reflection/data_info.hpp></h3></div></div></div>
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.reflection.data_info.hpp"></a>Header <boost/reflection/data_info.hpp></h4></div></div></div>
<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
<span class="bold"><strong>namespace</strong></span> reflections {
<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Info, <span class="bold"><strong>typename</strong></span> TypeInfo> <span class="bold"><strong>struct</strong></span> basic_data_info;
@@ -96,12 +194,12 @@
}</pre>
</div>
<div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="header.boost.reflection.factory.hpp"></a>Header <boost/reflection/factory.hpp></h3></div></div></div>
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.reflection.factory.hpp"></a>Header <boost/reflection/factory.hpp></h4></div></div></div>
<pre class="synopsis">
<a href="../BOOST_REFLECTION_CONSTRUCT_FUNCTION.html" title="Macro BOOST_REFLECTION_CONSTRUCT_FUNCTION">BOOST_REFLECTION_CONSTRUCT_FUNCTION</a>(Z, N, _)
-BOOST_REFLECTION_CONSTRUCTI_FUNCTION(Z, N, _)</pre>
+BOOST_REFLECTION_CONSTRUCTI_FUNCTION(Z, N, _)</pre>
<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
<span class="bold"><strong>namespace</strong></span> reflections {
<a href="../boost/reflections/BOOST_REFLECTION_CONSTRUCTI_FUNCTION.html" title="Global BOOST_REFLECTION_CONSTRUCTI_FUNCTION">BOOST_REFLECTION_CONSTRUCTI_FUNCTION</a>;
@@ -111,12 +209,21 @@
}</pre>
</div>
<div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="header.boost.reflection.function.hpp"></a>Header <boost/reflection/function.hpp></h3></div></div></div>
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.extension.factory.hpp"></a>Header <boost/extension/factory.hpp></h4></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> extensions {
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Params...> <span class="bold"><strong>class</strong></span> factory;
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.reflection.function.hpp"></a>Header <boost/reflection/function.hpp></h4></div></div></div>
<pre class="synopsis">
-BOOST_PP_ITERATION_LIMITS
-BOOST_PP_FILENAME_1</pre>
+BOOST_PP_ITERATION_LIMITS
+BOOST_PP_FILENAME_1</pre>
<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
<span class="bold"><strong>namespace</strong></span> reflections {
<span class="bold"><strong>namespace</strong></span> impl {
@@ -125,11 +232,11 @@
}
}</pre>
</div>
-<div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title">
-<a name="header.boost.reflection.function_info.hpp"></a>Header <boost/reflection/function_info.hpp></h3></div></div></div></div>
+<div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.reflection.function_info.hpp"></a>Header <boost/reflection/function_info.hpp></h4></div></div></div></div>
<div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="header.boost.reflection.generic_constructor.hpp"></a>Header <boost/reflection/generic_constructor.hpp></h3></div></div></div>
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.reflection.generic_constructor.hpp"></a>Header <boost/reflection/generic_constructor.hpp></h4></div></div></div>
<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
<span class="bold"><strong>namespace</strong></span> reflections {
<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="bold"><strong>class</strong></span> generic_constructor;
@@ -137,8 +244,8 @@
}</pre>
</div>
<div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="header.boost.reflection.instance.hpp"></a>Header <boost/reflection/instance.hpp></h3></div></div></div>
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.reflection.instance.hpp"></a>Header <boost/reflection/instance.hpp></h4></div></div></div>
<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
<span class="bold"><strong>namespace</strong></span> reflections {
<span class="bold"><strong>class</strong></span> instance;
@@ -146,8 +253,8 @@
}</pre>
</div>
<div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="header.boost.reflection.parameter.hpp"></a>Header <boost/reflection/parameter.hpp></h3></div></div></div>
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.reflection.parameter.hpp"></a>Header <boost/reflection/parameter.hpp></h4></div></div></div>
<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
<span class="bold"><strong>namespace</strong></span> reflections {
<span class="bold"><strong>class</strong></span> conversion_not_found_exception;
@@ -158,11 +265,11 @@
}
}</pre>
</div>
-<div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title">
-<a name="header.boost.reflection.parameter_map.hpp"></a>Header <boost/reflection/parameter_map.hpp></h3></div></div></div></div>
+<div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.reflection.parameter_map.hpp"></a>Header <boost/reflection/parameter_map.hpp></h4></div></div></div></div>
<div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="header.boost.reflection.reflection.hpp"></a>Header <boost/reflection/reflection.hpp></h3></div></div></div>
+<div class="titlepage"><div><div><h4 class="title">
+<a name="header.boost.reflection.reflection.hpp"></a>Header <boost/reflection/reflection.hpp></h4></div></div></div>
<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
<span class="bold"><strong>namespace</strong></span> reflections {
<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Info = std::string, <span class="bold"><strong>typename</strong></span> ParameterInfo = <span class="bold"><strong>void</strong></span>,
@@ -184,7 +291,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="extension_reflection.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../boost/reflections/parameter_unavailable_exception.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="appendices.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="appendices.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../boost/extensions/adaptable_factory.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/libs/extension/doc/html/boost_extension/shared_libraries.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost_extension/shared_libraries.html (original)
+++ sandbox/libs/extension/doc/html/boost_extension/shared_libraries.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -7,7 +7,8 @@
<link rel="start" href="../index.html" title="Chapter 1. Boost.Extension">
<link rel="up" href="../index.html" title="Chapter 1. Boost.Extension">
<link rel="prev" href="motivation.html" title=" Motivation">
-<link rel="next" href="factories.html" title=" Factories">
+<link rel="next" href="shared_libraries/shared_library_issues.html" title="
+ Other Issues with Shared Libraries">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -20,7 +21,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="motivation.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="factories.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="motivation.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="shared_libraries/shared_library_issues.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -28,11 +29,11 @@
<div class="toc"><dl>
<dt><span class="section"><a href="shared_libraries.html#boost_extension.shared_libraries.name_resolution"> Name
Resolution</a></span></dt>
-<dt><span class="section"><a href="shared_libraries.html#boost_extension.shared_libraries.shared_library_issues">
+<dt><span class="section"><a href="shared_libraries/shared_library_issues.html">
Other Issues with Shared Libraries</a></span></dt>
-<dt><span class="section"><a href="shared_libraries.html#boost_extension.shared_libraries.shared_library_inefficiencies">
+<dt><span class="section"><a href="shared_libraries/shared_library_inefficiencies.html">
Possible Inefficiencies in Shared Libraries</a></span></dt>
-<dt><span class="section"><a href="shared_libraries.html#boost_extension.shared_libraries.shared_library_class">shared_library
+<dt><span class="section"><a href="shared_libraries/shared_library_class.html">shared_library
class</a></span></dt>
</dl></div>
<p>
@@ -87,95 +88,6 @@
class.
</p>
</div>
-<div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_extension.shared_libraries.shared_library_issues"></a><a href="shared_libraries.html#boost_extension.shared_libraries.shared_library_issues" title="
- Other Issues with Shared Libraries">
- Other Issues with Shared Libraries</a></h3></div></div></div>
-<div class="itemizedlist"><ul type="disc">
-<li>
- Separate symbol tables are required in each shared library.
- </li>
-<li>
- RTTI merging: Some compilers do it. Some don't.
- </li>
-<li>
- Optimizations are harder because the code must be position independent.
- </li>
-<li>
- The following may break binary compatibility between an application and
- a shared library (among other things):
- <div class="itemizedlist"><ul type="circle">
-<li>
- Any part of shared class changes. Variable ordering, public<span class="emphasis"><em>private</em></span>
- protected, virtual function implementations, add<span class="emphasis"><em>remove variables</em></span>
- functions etc.
- </li>
-<li>
- Different compiler or compiler options used, or headers included differently.
- </li>
-</ul></div>
-</li>
-</ul></div>
-</div>
-<div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_extension.shared_libraries.shared_library_inefficiencies"></a><a href="shared_libraries.html#boost_extension.shared_libraries.shared_library_inefficiencies" title="
- Possible Inefficiencies in Shared Libraries">
- Possible Inefficiencies in Shared Libraries</a></h3></div></div></div>
-<div class="itemizedlist"><ul type="disc">
-<li>
- Position Independent Code:
- <div class="itemizedlist"><ul type="circle">
-<li>
- Since the shared library could be loaded to any part of the address
- space, it cannot hard code addresses of its functions and data. This
- must be resolved when the library is loaded.
- </li>
-<li>
- They can take a really long time to load.
- </li>
-<li>
- OS's attempt to mitigate this in various ways.
- </li>
-</ul></div>
-</li>
-<li>
- Extra levels of indirection in non-virtual function calls.
- <div class="itemizedlist"><ul type="circle"><li>
- No inlining across library boundaries.
- </li></ul></div>
-</li>
-</ul></div>
-</div>
-<div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_extension.shared_libraries.shared_library_class"></a><a href="shared_libraries.html#boost_extension.shared_libraries.shared_library_class" title="shared_library
- class">shared_library
- class</a></h3></div></div></div>
-<p>
- Provides for automatic loading of named modules, and retrieval of functions
- in those modules:
- </p>
-<p>
-
-</p>
-<pre class="programlisting"><span class="identifier">shared_library</span> <span class="identifier">m</span><span class="special">(</span><span class="string">"my_module_name"</span><span class="special">);</span>
-<span class="comment">// Call a function that returns an int and takes a float parameter.
-</span><span class="keyword">int</span> <span class="identifier">result</span> <span class="special">=</span> <span class="identifier">m</span><span class="special">.</span><span class="identifier">get</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">float</span><span class="special">>(</span><span class="string">"function_name"</span><span class="special">)(</span><span class="number">5.0f</span><span class="special">);</span>
-<span class="identifier">m</span><span class="special">.</span><span class="identifier">close</span><span class="special">();</span>
-</pre>
-<p>
- </p>
-<p>
- The <code class="computeroutput"><span class="identifier">get</span><span class="special">()</span></code>
- function returns a function pointer that can be wrapped in Boost.Function
- objects or used by itself.
- </p>
-<p>
- Reference: <code class="literal"><code class="computeroutput">shared_library</code></code>
- </p>
-</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
@@ -187,7 +99,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="motivation.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="factories.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="motivation.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="shared_libraries/shared_library_issues.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/libs/extension/doc/html/boost_extension/shared_libraries/shared_library_class.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost_extension/shared_libraries/shared_library_class.html (original)
+++ sandbox/libs/extension/doc/html/boost_extension/shared_libraries/shared_library_class.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -9,7 +9,7 @@
<link rel="up" href="../shared_libraries.html" title=" Shared Libraries">
<link rel="prev" href="shared_library_inefficiencies.html" title="
Possible Inefficiencies in Shared Libraries">
-<link rel="next" href="../reference.html" title="Reference">
+<link rel="next" href="../factories.html" title=" Factories">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -22,7 +22,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="shared_library_inefficiencies.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../shared_libraries.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../reference.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="shared_library_inefficiencies.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../shared_libraries.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../factories.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
@@ -62,7 +62,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="shared_library_inefficiencies.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../shared_libraries.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../reference.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="shared_library_inefficiencies.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../shared_libraries.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../factories.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/libs/extension/doc/html/boost_extension/shared_libraries/shared_library_inefficiencies.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost_extension/shared_libraries/shared_library_inefficiencies.html (original)
+++ sandbox/libs/extension/doc/html/boost_extension/shared_libraries/shared_library_inefficiencies.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -7,7 +7,8 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
<link rel="start" href="../../index.html" title="Chapter 1. Boost.Extension">
<link rel="up" href="../shared_libraries.html" title=" Shared Libraries">
-<link rel="prev" href="cheese.html" title=" Chees Section">
+<link rel="prev" href="shared_library_issues.html" title="
+ Other Issues with Shared Libraries">
<link rel="next" href="shared_library_class.html" title="shared_library
class">
</head>
@@ -22,7 +23,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="cheese.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../shared_libraries.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="shared_library_class.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="shared_library_issues.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../shared_libraries.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="shared_library_class.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
@@ -64,7 +65,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="cheese.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../shared_libraries.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="shared_library_class.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="shared_library_issues.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../shared_libraries.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="shared_library_class.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/libs/extension/doc/html/boost_extension/shared_libraries/shared_library_issues.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost_extension/shared_libraries/shared_library_issues.html (original)
+++ sandbox/libs/extension/doc/html/boost_extension/shared_libraries/shared_library_issues.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -8,7 +8,8 @@
<link rel="start" href="../../index.html" title="Chapter 1. Boost.Extension">
<link rel="up" href="../shared_libraries.html" title=" Shared Libraries">
<link rel="prev" href="../shared_libraries.html" title=" Shared Libraries">
-<link rel="next" href="cheese.html" title=" Chees Section">
+<link rel="next" href="shared_library_inefficiencies.html" title="
+ Possible Inefficiencies in Shared Libraries">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -21,7 +22,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../shared_libraries.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../shared_libraries.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="cheese.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="../shared_libraries.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../shared_libraries.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="shared_library_inefficiencies.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
@@ -64,7 +65,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../shared_libraries.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../shared_libraries.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="cheese.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="../shared_libraries.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../shared_libraries.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="shared_library_inefficiencies.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/libs/extension/doc/html/boost_extension/tutorials.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost_extension/tutorials.html (original)
+++ sandbox/libs/extension/doc/html/boost_extension/tutorials.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -7,7 +7,7 @@
<link rel="start" href="../index.html" title="Chapter 1. Boost.Extension">
<link rel="up" href="../index.html" title="Chapter 1. Boost.Extension">
<link rel="prev" href="factories.html" title=" Factories">
-<link rel="next" href="reference.html" title="Reference">
+<link rel="next" href="tutorials/tutorial02.html" title=" Tutorial 2">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -20,209 +20,67 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="factories.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="reference.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="factories.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="tutorials/tutorial02.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_extension.tutorials"></a>Tutorials</h2></div></div></div>
<div class="toc"><dl>
-<dt><span class="section"> Tutorial 1</span></dt>
-<dt><span class="section"> Tutorial 2</span></dt>
-<dt><span class="section"> Tutorial 3</span></dt>
-<dt><span class="section"> Tutorial 4</span></dt>
-<dt><span class="section"> Tutorial 5</span></dt>
+<dt><span class="section"><a href="tutorials.html#boost_extension.tutorials.tutorial01"> Tutorial 1 - Using
+ the <code class="literal"><code class="computeroutput">shared_library</code></code>
+ class</a></span></dt>
+<dt><span class="section"> Tutorial 2</span></dt>
+<dt><span class="section"> Tutorial 3</span></dt>
+<dt><span class="section"> Tutorial 4</span></dt>
+<dt><span class="section"> Tutorial 5</span></dt>
</dl></div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_extension.tutorials.tutorial01"></a> Tutorial 1</h3></div></div></div>
+<a name="boost_extension.tutorials.tutorial01"></a><a href="tutorials.html#boost_extension.tutorials.tutorial01" title=" Tutorial 1 - Using
+ the shared_library
+ class"> Tutorial 1 - Using
+ the <code class="literal"><code class="computeroutput">shared_library</code></code>
+ class</a></h3></div></div></div>
<p>
- Create a class that we will later subclass and put it into a header file
- called word.hpp.
-</p>
-<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">word</span>
-<span class="special">{</span>
-<span class="keyword">public</span><span class="special">:</span>
- <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">word</span><span class="special">(){}</span>
- <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">get_val</span><span class="special">(){</span><span class="keyword">return</span> <span class="string">""</span><span class="special">;}</span>
-<span class="special">};</span>
-</pre>
-<p>
- This file will be included by both the shared library in which classes implement
- this interface, and in the executable that will load these implementations.
- The destructor ought to be virtual, just to ensure proper deletion. We create
- one virtual function. We could actually add data to this class as well.
+ The <code class="literal"><code class="computeroutput">shared_library</code></code>
+ class facilitates loading shared libraries and calling functions from them.
</p>
<p>
- Now create a file called hello_world.cpp. This will be compiled into a shared
- library:
+ This tutorial will describe building a shared library with a single exported
+ function, and then creating an executable that loads the shared library and
+ calls the function.
</p>
<p>
-
-</p>
-<pre class="programlisting"><span class="preprocessor">#include</span> <span class="string">"word.hpp"</span>
-<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">extension</span><span class="special">/</span><span class="identifier">factory_map</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
-
-<span class="keyword">class</span> <span class="identifier">world</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">word</span>
-<span class="special">{</span>
-<span class="keyword">public</span><span class="special">:</span>
- <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">get_val</span><span class="special">(){</span><span class="keyword">return</span> <span class="string">"world!"</span><span class="special">;}</span>
-<span class="special">};</span>
-<span class="keyword">class</span> <span class="identifier">hello</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">word</span>
-<span class="special">{</span>
-<span class="keyword">public</span><span class="special">:</span>
- <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">get_val</span><span class="special">(){</span><span class="keyword">return</span> <span class="string">"hello"</span><span class="special">;}</span>
-<span class="special">};</span>
-</pre>
-<p>
- Now we have two classes that are derived from word, and that both implement
- the virtual function get_val. All that's left is to declare them for exporting.
- Normally, we just put one function in the entire shared library that exports
- all exportable classes in the library.
-</p>
-<pre class="programlisting"><span class="keyword">extern</span> <span class="string">"C"</span> <span class="keyword">void</span> <span class="identifier">BOOST_EXTENSION_EXPORT_DECL</span>
-<span class="identifier">extension_export_word</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">extensions</span><span class="special">::</span><span class="identifier">factory_map</span> <span class="special">&</span> <span class="identifier">fm</span><span class="special">)</span>
-<span class="special">{</span>
- <span class="identifier">fm</span><span class="special">.</span><span class="identifier">get</span><span class="special"><</span><span class="identifier">word</span><span class="special">,</span> <span class="keyword">int</span><span class="special">>()[</span><span class="number">1</span><span class="special">].</span><span class="identifier">set</span><span class="special"><</span><span class="identifier">hello</span><span class="special">>();</span>
- <span class="identifier">fm</span><span class="special">.</span><span class="identifier">get</span><span class="special"><</span><span class="identifier">word</span><span class="special">,</span> <span class="keyword">int</span><span class="special">>()[</span><span class="number">2</span><span class="special">].</span><span class="identifier">set</span><span class="special"><</span><span class="identifier">world</span><span class="special">>();</span>
-<span class="special">}</span>
-</pre>
-<p>
- <code class="computeroutput"><span class="keyword">extern</span> <span class="string">"C"</span></code>
- is required to keep the function name from being mangled. <code class="computeroutput"><span class="identifier">BOOST_EXTENSION_EXPORT_DECL</span></code>
- is only necessary on Windows - on other platforms it does nothing. On Windows,
- it declares that the function should be exported. This is the default in
- shared libraries on other platforms.
- </p>
-<p>
- The <code class="computeroutput"><span class="identifier">factory_map</span><span class="special">::</span><span class="identifier">get</span></code> function takes two template arguments:
- the type of factory to get (the interface returned by it), and what type
- of info is used to identify it (which can be an arbitrary type).
- </p>
-<p>
- This returns a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span></code>, in this case, <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">factory</span><span class="special"><</span><span class="identifier">word</span><span class="special">></span> <span class="special">></span></code>.
- We then index the map to find (and perhaps create) the appropriate factory,
- and set the type of class it instantiates to the template argument of the
- <code class="computeroutput"><span class="identifier">set</span></code> function. The argument
- is the value for that identification info.
+ For purposes of this tutorial, Boost.Build will be used as the build system.
</p>
<p>
- Now we can write the executable.
+ The options put into this build file are boilerplate that will be reused
+ for the other examples in this documentation.
</p>
<p>
-
-</p>
-<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">extension</span><span class="special">/</span><span class="identifier">factory_map</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
-<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">extension</span><span class="special">/</span><span class="identifier">shared_library</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
-<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
-<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">extension</span><span class="special">/</span><span class="identifier">convenience</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
-<span class="preprocessor">#include</span> <span class="string">"word.hpp"</span>
-<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
-<span class="special">{</span>
- <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">extensions</span><span class="special">;</span>
- <span class="comment">// Create the factory_map object - it will hold all of the available
-</span> <span class="comment">// constructors. Multiple factory_maps can be constructed.
-</span> <span class="identifier">factory_map</span> <span class="identifier">fm</span><span class="special">;</span>
- <span class="comment">// load the shared library with
-</span> <span class="identifier">load_single_library</span><span class="special">(</span><span class="identifier">fm</span><span class="special">,</span> <span class="string">"libHelloWorldLib.extension"</span><span class="special">,</span>
- <span class="string">"extension_export_word"</span><span class="special">);</span>
- <span class="comment">// Get a reference to the list of constructors for words.
-</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">list</span><span class="special"><</span><span class="identifier">factory</span><span class="special"><</span><span class="identifier">word</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span> <span class="special">></span> <span class="special">&</span> <span class="identifier">factory_list</span> <span class="special">=</span> <span class="identifier">fm</span><span class="special">.</span><span class="identifier">get</span><span class="special"><</span><span class="identifier">word</span><span class="special">,</span> <span class="keyword">int</span><span class="special">>();</span>
- <span class="keyword">if</span> <span class="special">(</span><span class="identifier">factory_list</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special"><</span> <span class="number">2</span><span class="special">)</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Error - the classes were not found."</span><span class="special">;</span>
- <span class="keyword">for</span> <span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">list</span><span class="special"><</span><span class="identifier">factory</span><span class="special"><</span><span class="identifier">word</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span> <span class="special">>::</span><span class="identifier">iterator</span> <span class="identifier">current_word</span> <span class="special">=</span>
- <span class="identifier">factory_list</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span> <span class="identifier">current_word</span> <span class="special">!=</span> <span class="identifier">factory_list</span><span class="special">.</span><span class="identifier">end</span><span class="special">();</span>
- <span class="special">++</span><span class="identifier">current_word</span><span class="special">)</span> <span class="special">{</span>
- <span class="comment">// Using auto_ptr to avoid needing delete. Using smart_ptrs is recommended.
-</span> <span class="comment">// Note that this has a zero argument constructor - currently constructors
-</span> <span class="comment">// with up to six arguments can be used.
-</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">auto_ptr</span><span class="special"><</span><span class="identifier">word</span><span class="special">></span> <span class="identifier">word_ptr</span><span class="special">(</span><span class="identifier">current_word</span><span class="special">-></span><span class="identifier">create</span><span class="special">());</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">word_ptr</span><span class="special">-></span><span class="identifier">get_val</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" "</span><span class="special">;</span>
- <span class="special">}</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
- <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
-<span class="special">}</span>
-</pre>
-<p>
- Now we just need to write the build file. You may have noticed above that
- the name of the library is assumed to be libHelloWorld.extension - we'll
- need to rename whatever shared library is compiled to that. Boost.Build can
- do this automatically.
- </p>
-<p>
-
-</p>
-<pre class="programlisting"><span class="identifier">import</span> <span class="identifier">type</span> <span class="special">:</span> <span class="identifier">change</span><span class="special">-</span><span class="identifier">generated</span><span class="special">-</span><span class="identifier">target</span><span class="special">-</span><span class="identifier">suffix</span> <span class="special">;</span>
-<span class="identifier">import</span> <span class="identifier">type</span> <span class="special">:</span> <span class="identifier">change</span><span class="special">-</span><span class="identifier">generated</span><span class="special">-</span><span class="identifier">target</span><span class="special">-</span><span class="identifier">prefix</span> <span class="special">;</span>
-<span class="identifier">type</span><span class="special">.</span><span class="identifier">change</span><span class="special">-</span><span class="identifier">generated</span><span class="special">-</span><span class="identifier">target</span><span class="special">-</span><span class="identifier">suffix</span> <span class="identifier">SHARED_LIB</span> <span class="special">:</span> <span class="special">:</span> <span class="identifier">extension</span> <span class="special">;</span>
-<span class="identifier">type</span><span class="special">.</span><span class="identifier">change</span><span class="special">-</span><span class="identifier">generated</span><span class="special">-</span><span class="identifier">target</span><span class="special">-</span><span class="identifier">prefix</span> <span class="identifier">SHARED_LIB</span> <span class="special">:</span> <span class="special">:</span> <span class="identifier">lib</span> <span class="special">;</span>
-<span class="identifier">import</span> <span class="identifier">os</span> <span class="special">;</span>
-
-<span class="identifier">local</span> <span class="identifier">BOOST_ROOT</span> <span class="special">=</span> <span class="special">[</span> <span class="identifier">os</span><span class="special">.</span><span class="identifier">environ</span> <span class="identifier">BOOST_ROOT</span> <span class="special">]</span> <span class="special">;</span>
-<span class="identifier">project</span>
- <span class="special">:</span> <span class="identifier">requirements</span>
- <span class="special"><</span><span class="identifier">include</span><span class="special">>../../../</span>
- <span class="special"><</span><span class="identifier">include</span><span class="special">></span>#<span class="special">(</span><span class="identifier">BOOST_ROOT</span><span class="special">)</span>
- <span class="special">:</span>
- <span class="special">;</span>
-
-<span class="identifier">exe</span> <span class="identifier">HelloWorld</span> <span class="special">:</span> <span class="identifier">main</span><span class="special">.</span><span class="identifier">cpp</span> <span class="special">;</span>
-<span class="identifier">lib</span> <span class="identifier">HelloWorldLib</span> <span class="special">:</span> <span class="identifier">hello_world</span><span class="special">.</span><span class="identifier">cpp</span> <span class="special">:</span> <span class="special"><</span><span class="identifier">link</span><span class="special">></span><span class="identifier">shared</span> <span class="special">;</span>
-<span class="identifier">install</span> <span class="special">../</span><span class="identifier">bin</span> <span class="special">:</span> <span class="identifier">HelloWorld</span> <span class="identifier">HelloWorldLib</span> <span class="special">;</span>
-</pre>
-<p>
- If you use another build system, you'll need to make sure that the output
- shared library (dll, so, dylib etc.) is renamed correctly.
- </p>
-</div>
-<div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_extension.tutorials.tutorial02"></a> Tutorial 2</h3></div></div></div>
-<p>
- This tutorial shows more advanced class loading. The example described here
- is contrived, and such a convoluted design is not used as an example of good
- object-oriented program, but as a way to illustrate some of the possibilities
- with this library.
- </p>
-<p>
- Let's design a class hierarchy based on the following:
+ Shared libraries on different platforms can have different prefixes and/or
+ extensions, for example:
</p>
<div class="itemizedlist"><ul type="disc">
<li>
- There is a vehicle class
- </li>
-<li>
- There is a computer class
+ .dll (Windows)
</li>
<li>
- A car is a vehicle
+ .so (Unix/Linux)
</li>
<li>
- A boat is a vehicle
- </li>
-<li>
- A plane is a vehicle
- </li>
-<li>
- A flying_car is a plane and a car
- </li>
-<li>
- A car_of_the_future is a flying_car, a boat, and a computer.
+ .dylib or .bundle (OS X)
</li>
</ul></div>
<p>
- In addition, we are not going to have any of these classes be interfaces.
- They will each have an implementation in a .cpp file. This will require multiple
- inheritance, as well as virtual inheritance (because otherwise a car_of_the_future
- would consist of three separate vehicle base classes!).
- </p>
-<p>
- In addition, each class will be compiled into a separate shared library.
- This is not necessary, certainly, but will serve to illustrate some of the
- more advanced capabilities of the library, as well as some of the techniques
- necessary in this situation.
+ In order to simplify loading of these libraries, it is common to use a custom
+ naming scheme. For these examples, all shared libraries are prefixed with
+ "lib" and end with ".extension", but it is fine to use
+ a different naming scheme.
</p>
<p>
- To begin with, let's look at the Jamfile:
+ To achieve this in Boost.Build, add the following lines at the top of the
+ Jamfile:
</p>
<p>
@@ -235,745 +93,211 @@
<p>
</p>
<p>
- First we must rename the generated libraries (this is required for cross-platform
- use - but the prefix and suffix are arbitrary).
+ This example uses code from both the main Boost tree, and from the Extension
+ headers - which are currently located in the sandbox. Make sure that BOOST_ROOT
+ and BOOST_SANDBOX_ROOT are set to the locations of these two trees - or use
+ the related options for your compiler or IDE.
</p>
<p>
-
-</p>
-<pre class="programlisting"><span class="identifier">lib</span> <span class="identifier">Vehicle</span> <span class="special">:</span> <span class="identifier">multiple_inheritance</span><span class="special">/</span><span class="identifier">vehicle</span><span class="special">.</span><span class="identifier">cpp</span> <span class="special">:</span> <span class="special"><</span><span class="identifier">link</span><span class="special">></span><span class="identifier">shared</span> <span class="special">;</span>
-<span class="identifier">lib</span> <span class="identifier">Car</span> <span class="special">:</span> <span class="identifier">multiple_inheritance</span><span class="special">/</span><span class="identifier">car</span><span class="special">.</span><span class="identifier">cpp</span> <span class="identifier">Vehicle</span> <span class="special">:</span> <span class="special"><</span><span class="identifier">link</span><span class="special">></span><span class="identifier">shared</span> <span class="special">;</span>
-</pre>
-<p>
- </p>
-<p>
- Notice here that the Car library is linked to the Vehicle library - this
- is necessary because the Car class needs the implementation of the Vehicle
- class. This is unrelated to the Boost.Extension library, but just a standard
- requirement when inheriting from shared library classes. The same will be
- done with the other shared libraries.
+ Here, both of those directories are added as include paths.
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">lib</span> <span class="identifier">Plane</span> <span class="special">:</span> <span class="identifier">multiple_inheritance</span><span class="special">/</span><span class="identifier">plane</span><span class="special">.</span><span class="identifier">cpp</span> <span class="identifier">Vehicle</span> <span class="special">:</span> <span class="special"><</span><span class="identifier">link</span><span class="special">></span><span class="identifier">shared</span> <span class="special">;</span>
-<span class="identifier">lib</span> <span class="identifier">Boat</span> <span class="special">:</span> <span class="identifier">multiple_inheritance</span><span class="special">/</span><span class="identifier">boat</span><span class="special">.</span><span class="identifier">cpp</span> <span class="identifier">Vehicle</span> <span class="special">:</span> <span class="special"><</span><span class="identifier">link</span><span class="special">></span><span class="identifier">shared</span> <span class="special">;</span>
-<span class="identifier">lib</span> <span class="identifier">Computer</span> <span class="special">:</span> <span class="identifier">multiple_inheritance</span><span class="special">/</span><span class="identifier">computer</span><span class="special">.</span><span class="identifier">cpp</span> <span class="special">:</span> <span class="special"><</span><span class="identifier">link</span><span class="special">></span><span class="identifier">shared</span> <span class="special">;</span>
-<span class="identifier">lib</span> <span class="identifier">FlyingCar</span> <span class="special">:</span> <span class="identifier">multiple_inheritance</span><span class="special">/</span><span class="identifier">flying_car</span><span class="special">.</span><span class="identifier">cpp</span> <span class="identifier">Plane</span> <span class="identifier">Car</span> <span class="identifier">Vehicle</span>
- <span class="special">:</span> <span class="special"><</span><span class="identifier">link</span><span class="special">></span><span class="identifier">shared</span> <span class="special">;</span>
-<span class="identifier">lib</span> <span class="identifier">CarOfTheFuture</span> <span class="special">:</span>
- <span class="identifier">multiple_inheritance</span><span class="special">/</span><span class="identifier">car_of_the_future</span><span class="special">.</span><span class="identifier">cpp</span>
- <span class="identifier">Plane</span> <span class="identifier">Car</span> <span class="identifier">Vehicle</span>
- <span class="identifier">FlyingCar</span> <span class="identifier">Computer</span> <span class="identifier">Boat</span>
- <span class="special">:</span>
- <span class="special"><</span><span class="identifier">link</span><span class="special">></span><span class="identifier">shared</span>
-<span class="special">;</span>
+<pre class="programlisting"><span class="identifier">import</span> <span class="identifier">os</span> <span class="special">;</span>
-<span class="identifier">install</span> <span class="special">../</span><span class="identifier">bin</span> <span class="special">:</span>
- <span class="identifier">HelloWorld</span> <span class="identifier">HelloWorldLib</span> <span class="identifier">Vehicle</span> <span class="identifier">Boat</span> <span class="identifier">FlyingCar</span>
- <span class="identifier">CarOfTheFuture</span> <span class="identifier">MultipleInheritance</span>
- <span class="special">:</span>
- <span class="special">;</span>
-</pre>
-<p>
- </p>
-<p>
- Refer to the examples/multiple_inheritance folder for the source code of
- these classes. Only the most complex will be described here - the rest are
- similar.
- </p>
-<p>
- On the Windows platform, there are special declarations that are required
- when a dll must use a class that is defined in another dll. For interface
- only classes this is unnecessary, and is not needed on other platforms. The
- macros BOOST_EXTENSION_IMPORT_DECL and BOOST_EXTENSION_EXPORT_DECL can be
- used to insert the proper declaration. This is detailed in the appendix.
- </p>
-<p>
-
-</p>
-<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_EXTENSION_FLYING_CAR_DECL</span> <span class="identifier">BOOST_EXTENSION_IMPORT_DECL</span>
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_EXTENSION_BOAT_DECL</span> <span class="identifier">BOOST_EXTENSION_IMPORT_DECL</span>
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_EXTENSION_COMPUTER_DECL</span> <span class="identifier">BOOST_EXTENSION_IMPORT_DECL</span>
-<span class="preprocessor">#include</span> <span class="string">"flying_car.hpp"</span>
-<span class="preprocessor">#include</span> <span class="string">"boat.hpp"</span>
-<span class="preprocessor">#include</span> <span class="string">"computer.hpp"</span>
-<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
-<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">typeinfo</span><span class="special">></span>
-<span class="keyword">class</span> <span class="identifier">BOOST_EXTENSION_CAR_OF_THE_FUTURE_DECL</span>
- <span class="identifier">car_of_the_future</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">flying_car</span><span class="special">,</span> <span class="keyword">public</span> <span class="identifier">boat</span><span class="special">,</span> <span class="keyword">public</span> <span class="identifier">computer</span>
-<span class="special">{</span>
-<span class="keyword">public</span><span class="special">:</span>
- <span class="identifier">car_of_the_future</span><span class="special">(</span><span class="keyword">void</span><span class="special">){</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"\nCreated a Car of the Future"</span><span class="special">;}</span>
- <span class="special">~</span><span class="identifier">car_of_the_future</span><span class="special">(</span><span class="keyword">void</span><span class="special">){</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"\nDestroyed a Car of the Future"</span><span class="special">;}</span>
- <span class="keyword">virtual</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">list_capabilities</span><span class="special">(</span><span class="keyword">void</span><span class="special">);</span>
-<span class="special">};</span>
+<span class="identifier">local</span> <span class="identifier">BOOST_ROOT</span> <span class="special">=</span> <span class="special">[</span> <span class="identifier">os</span><span class="special">.</span><span class="identifier">environ</span> <span class="identifier">BOOST_ROOT</span> <span class="special">]</span> <span class="special">;</span>
+<span class="identifier">local</span> <span class="identifier">BOOST_SANDBOX_ROOT</span> <span class="special">=</span> <span class="special">[</span> <span class="identifier">os</span><span class="special">.</span><span class="identifier">environ</span> <span class="identifier">BOOST_SANDBOX_ROOT</span> <span class="special">]</span> <span class="special">;</span>
+<span class="identifier">project</span>
+ <span class="special">:</span> <span class="identifier">requirements</span>
+ <span class="special"><</span><span class="identifier">include</span><span class="special">></span>#<span class="special">(</span><span class="identifier">BOOST_SANDBOX_ROOT</span><span class="special">)</span>
+ <span class="special"><</span><span class="identifier">include</span><span class="special">></span>#<span class="special">(</span><span class="identifier">BOOST_ROOT</span><span class="special">)</span>
+ <span class="special">:</span>
+ <span class="special">;</span>
</pre>
<p>
</p>
-</div>
-<div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_extension.tutorials.tutorial03"></a> Tutorial 3</h3></div></div></div>
-<p>
- This tutorial shows how to register and instantiate classes that have multi-argument
- constructors (not default constructors) in Boost.Extension. In the example
- that we will describe in this tutorial (examples/parameters) we create a
- dummy class with a constructor that have six arguments. We'll register this
- class in a factory map and then get it from the main file.
- </p>
<p>
- It is expected that before following this tutorial you have gone trough the
- first tutorial at least, and you are familiar with the basic use of Boost.Extension.
+ This final section of the Jamfile compiles both the shared library and main
+ executable, and installs them into the binaries/ subdirectory.
</p>
<p>
- Let's start defining our class. Its constructor receives six parameters (we
- chose that number because it's the default argument limit of the library),
- each one of a different type including a class defined in the interface (class
- A) and a smart pointer to this class. It shows via stdout the received parameters
- at construction.
+ It is usually simplest to place all shared libraries used by an application
+ in a common directory.
</p>
<p>
</p>
-<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">six_parameters</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">lots_of_parameters_interface</span>
-<span class="special">{</span>
- <span class="keyword">public</span><span class="special">:</span>
- <span class="identifier">six_parameters</span><span class="special">(</span><span class="keyword">bool</span> <span class="identifier">b</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">int</span> <span class="identifier">i</span><span class="special">,</span> <span class="keyword">char</span> <span class="identifier">c</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">A</span> <span class="identifier">a</span><span class="special">,</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span><span class="identifier">A</span><span class="special">></span> <span class="identifier">ptr_a</span><span class="special">)</span>
- <span class="identifier">lots_of_parameters_interface</span><span class="special">(</span><span class="identifier">b</span><span class="special">,</span> <span class="identifier">i</span><span class="special">,</span> <span class="identifier">c</span><span class="special">,</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">ptr_a</span><span class="special">)</span>
- <span class="special">{</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Constructor called."</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Parameters:"</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"\tbool: "</span> <span class="special"><<</span> <span class="identifier">b</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"\tunsigned int: "</span> <span class="special"><<</span> <span class="identifier">i</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"\tchar: "</span> <span class="special"><<</span> <span class="identifier">c</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"\tstring: "</span> <span class="special"><<</span> <span class="identifier">s</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"\tA.i: "</span> <span class="special"><<</span> <span class="identifier">a</span><span class="special">.</span><span class="identifier">i</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"\tptr_a->i: "</span> <span class="special"><<</span> <span class="identifier">ptr_a</span><span class="special">-></span><span class="identifier">i</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="special">}</span>
+<pre class="programlisting"><span class="identifier">lib</span> <span class="identifier">tutorial_1</span> <span class="special">:</span> <span class="identifier">tutorial_1</span><span class="special">/</span><span class="identifier">hello_world</span><span class="special">.</span><span class="identifier">cpp</span> <span class="special">:</span> <span class="special"><</span><span class="identifier">link</span><span class="special">></span><span class="identifier">shared</span> <span class="special">;</span>
+<span class="identifier">exe</span> <span class="identifier">tutorial_1_bin</span> <span class="special">:</span> <span class="identifier">tutorial_1</span><span class="special">/</span><span class="identifier">main</span><span class="special">.</span><span class="identifier">cpp</span> <span class="special">;</span>
- <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">six_parameters</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{}</span>
-<span class="special">};</span>
+<span class="identifier">install</span> <span class="identifier">binaries</span> <span class="special">:</span>
+ <span class="identifier">tutorial_1</span> <span class="identifier">tutorial_1_bin</span>
+ <span class="special">;</span>
</pre>
<p>
- <br> The interface that we are inheriting is just the bare minimum needed
- to make it compile:
</p>
<p>
-
-</p>
-<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">A</span>
-<span class="special">{</span>
- <span class="keyword">public</span><span class="special">:</span>
- <span class="identifier">A</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="keyword">int</span> <span class="identifier">i</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">i</span><span class="special">(</span><span class="identifier">i</span><span class="special">)</span> <span class="special">{}</span>
- <span class="keyword">int</span> <span class="identifier">i</span><span class="special">;</span>
-<span class="special">};</span>
-
-
-<span class="keyword">class</span> <span class="identifier">lots_of_parameters_interface</span>
-<span class="special">{</span>
- <span class="keyword">public</span><span class="special">:</span>
- <span class="identifier">lots_of_parameters_interface</span><span class="special">(</span><span class="keyword">bool</span> <span class="identifier">b</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">int</span> <span class="identifier">i</span><span class="special">,</span> <span class="keyword">char</span> <span class="identifier">c</span><span class="special">,</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">A</span> <span class="identifier">a</span><span class="special">,</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span><span class="identifier">A</span><span class="special">></span> <span class="identifier">ptr_a</span><span class="special">)</span> <span class="special">{}</span>
- <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">lots_of_parameters_interface</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{}</span>
-<span class="special">};</span>
-</pre>
-<p>
- <br> Having the class defined, we should write the export function to register
- the class in the passed factory map. The point here is that the factory_map::add
- method must be set with the first type as the third argument, and with the
- second type as the fourth argument and so on.
+ The hello_world.cpp file is the source of the shared library. It consists
+ of a single exported function which prints out a message a number of times,
+ according to the <code class="computeroutput"><span class="identifier">repetitions</span></code>
+ parameter to the function.
</p>
<p>
-
-</p>
-<pre class="programlisting"><span class="keyword">extern</span> <span class="string">"C"</span> <span class="keyword">void</span> <span class="identifier">BOOST_EXTENSION_EXPORT_DECL</span>
-<span class="identifier">extension_export</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">extensions</span><span class="special">::</span><span class="identifier">factory_map</span> <span class="special">&</span> <span class="identifier">fm</span><span class="special">)</span>
-<span class="special">{</span>
- <span class="identifier">fm</span><span class="special">.</span><span class="identifier">get</span><span class="special"><</span><span class="identifier">lots_of_parameters_interface</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">,</span>
- <span class="keyword">unsigned</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">char</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">A</span><span class="special">,</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span><span class="identifier">A</span><span class="special">></span> <span class="special">>()[</span><span class="number">6</span><span class="special">].</span><span class="identifier">set</span><span class="special"><</span><span class="identifier">six_parameters</span><span class="special">>();</span>
-<span class="special">}</span>
-</pre>
-<p>
- <br> Finally, let's see how it is used in the main file.
+ The <iostream> header is included for <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span></code>.
+ The <boost/extension/extension.hpp> header is used for the <code class="computeroutput"><span class="identifier">BOOST_EXTENSION_EXPORT_DECL</span></code> macro.
</p>
<p>
</p>
-<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span>
-<span class="special">{</span>
- <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">extensions</span><span class="special">;</span>
-
- <span class="comment">// Create the factory_map object - it will hold all of the available
-</span> <span class="comment">// constructors. Multiple factory_maps can be constructed.
-</span> <span class="identifier">factory_map</span> <span class="identifier">fm</span><span class="special">;</span>
-
- <span class="comment">// load the shared library with
-</span> <span class="identifier">load_single_library</span><span class="special">(</span><span class="identifier">fm</span><span class="special">,</span> <span class="string">"libParametersLib.extension"</span><span class="special">,</span> <span class="string">"extension_export"</span><span class="special">);</span>
-
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">factory</span><span class="special"><</span><span class="identifier">lots_of_parameters_interface</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">int</span><span class="special">,</span>
- <span class="keyword">char</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span><span class="identifier">A</span><span class="special">></span> <span class="special">></span> <span class="special">></span> <span class="special">&</span>
- <span class="identifier">factory_list</span> <span class="special">=</span>
- <span class="identifier">fm</span><span class="special">.</span><span class="identifier">get</span><span class="special"><</span><span class="identifier">lots_of_parameters_interface</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">char</span><span class="special">,</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span><span class="identifier">A</span><span class="special">></span> <span class="special">>();</span>
- <span class="keyword">if</span> <span class="special">(</span><span class="identifier">factory_list</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special">!=</span> <span class="number">1</span><span class="special">)</span> <span class="special">{</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Error - the class was not found."</span><span class="special">;</span>
- <span class="keyword">return</span> <span class="number">1</span><span class="special">;</span>
- <span class="special">}</span>
-
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">factory</span><span class="special"><</span><span class="identifier">lots_of_parameters_interface</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">int</span><span class="special">,</span>
- <span class="keyword">char</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span><span class="identifier">A</span><span class="special">></span> <span class="special">></span> <span class="special">></span>
- <span class="special">::</span><span class="identifier">iterator</span> <span class="identifier">par</span> <span class="special">=</span> <span class="identifier">factory_list</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">auto_ptr</span><span class="special"><</span><span class="identifier">lots_of_parameters_interface</span><span class="special">></span>
- <span class="identifier">par_ptr</span><span class="special">(</span><span class="identifier">par</span><span class="special">-></span><span class="identifier">create</span><span class="special">(</span><span class="keyword">true</span><span class="special">,</span> <span class="number">4</span><span class="special">,</span> <span class="char">'c'</span><span class="special">,</span> <span class="string">"test"</span><span class="special">,</span> <span class="identifier">A</span><span class="special">(</span><span class="number">2</span><span class="special">),</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span><span class="identifier">A</span><span class="special">>(</span><span class="keyword">new</span> <span class="identifier">A</span><span class="special">(</span><span class="number">15</span><span class="special">))));</span>
-
- <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
-<span class="special">}</span>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">extension</span><span class="special">/</span><span class="identifier">extension</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
</pre>
<p>
</p>
<p>
- Please note the following details:
+ In C, each function name in a compilation unit is unique. In C++, however,
+ function overloading is permitted - as are various types of templated functions,
+ namespaces etc. Because of this, C++ function names are mangled for linking.
+ In order to find a function in a shared library, its name must be known.
+ This leaves two options:
</p>
<div class="itemizedlist"><ul type="disc">
<li>
- Shared library loading is exactly the same.
- </li>
-<li>
- When we get the factory we should specify the template parameters, as we
- did in the factory_map::add method.
+ Determine the mangled name.
</li>
<li>
- When we call the create method we just supply the needed arguments and
- just works!
+ Declare that the function has C linkage, using the <code class="computeroutput"><span class="keyword">extern</span>
+ <span class="string">"C"</span></code> declaration.
</li>
</ul></div>
<p>
- <br>
- </p>
-<p>
- It is expected that at this point you can create your own classes with multi-argument
- constructors and use them via Boost.extensions without problems.
- </p>
-</div>
-<div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_extension.tutorials.tutorial04"></a> Tutorial 4</h3></div></div></div>
-<p>
- In this tutorial we will see different features of the library related to
- multiple loading of the same library, instance or interface.
- </p>
-<p>
- We will follow some parts of versions example (<code class="literal">examples/versioning</code>).
- As we expect that at this point you've gone through the first tutorials we
- will not enter into specific details of the use of the library.
- </p>
-<p>
- First, we want to show that it is possible to load several libraries into
- one factory map. We'll create a new HelloWorld library very similar to the
- one that we have described in the first tutorial.
- </p>
-<p>
- Let's remember the classes that we have implemented (in <code class="literal">hello_world.cpp</code>)
- for the "hello world" example:
- </p>
-<p>
-
-</p>
-<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">world</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">word</span>
-<span class="special">{</span>
-<span class="keyword">public</span><span class="special">:</span>
- <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">get_val</span><span class="special">(){</span><span class="keyword">return</span> <span class="string">"world!"</span><span class="special">;}</span>
-<span class="special">};</span>
-
-<span class="keyword">class</span> <span class="identifier">hello</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">word</span>
-<span class="special">{</span>
-<span class="keyword">public</span><span class="special">:</span>
- <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">get_val</span><span class="special">(){</span><span class="keyword">return</span> <span class="string">"hello"</span><span class="special">;}</span>
-<span class="special">};</span>
-
-<span class="keyword">extern</span> <span class="string">"C"</span> <span class="keyword">void</span> <span class="identifier">BOOST_EXTENSION_EXPORT_DECL</span>
-<span class="identifier">extension_export_word</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">extensions</span><span class="special">::</span><span class="identifier">factory_map</span> <span class="special">&</span> <span class="identifier">fm</span><span class="special">)</span>
-<span class="special">{</span>
- <span class="identifier">fm</span><span class="special">.</span><span class="identifier">get</span><span class="special"><</span><span class="identifier">word</span><span class="special">,</span> <span class="keyword">int</span><span class="special">>()[</span><span class="number">1</span><span class="special">].</span><span class="identifier">set</span><span class="special"><</span><span class="identifier">hello</span><span class="special">>();</span>
- <span class="identifier">fm</span><span class="special">.</span><span class="identifier">get</span><span class="special"><</span><span class="identifier">word</span><span class="special">,</span> <span class="keyword">int</span><span class="special">>()[</span><span class="number">2</span><span class="special">].</span><span class="identifier">set</span><span class="special"><</span><span class="identifier">world</span><span class="special">>();</span>
-<span class="special">}</span>
-</pre>
-<p>
- </p>
-<p>
- And now let's see the new version that we've implemented for this example
- (as defined in <code class="literal">hello_world_versions.cpp</code>). The classes
- have the same name and methods, both implement the same interface, but the
- <code class="computeroutput"><span class="identifier">get_val</span><span class="special">()</span></code>
- methods differ in the returned string (to be able to recognize each one after
- loading them).
+ Extension uses the second approach. Though this eases portability, it also
+ poses a risk to type safety. A simple, cross-platform solution to this problem
+ would probably require direction from the C++ Standards Committee. Until
+ that time, the Type Safety section has
+ advice on avoding type safety issues when using the <code class="literal"><code class="computeroutput">shared_library</code></code>
+ class.
</p>
<p>
</p>
-<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">world</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">word</span>
-<span class="special">{</span>
-<span class="keyword">public</span><span class="special">:</span>
- <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">get_val</span><span class="special">(){</span><span class="keyword">return</span> <span class="string">"world! v2"</span><span class="special">;}</span>
-<span class="special">};</span>
+<pre class="programlisting"><span class="comment">// Any exported function or variable must be declared
+</span><span class="comment">// extern "C" to avoid C++ name mangling.
+</span><span class="keyword">extern</span> <span class="string">"C"</span>
-<span class="keyword">class</span> <span class="identifier">hello</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">word</span>
-<span class="special">{</span>
-<span class="keyword">public</span><span class="special">:</span>
- <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">get_val</span><span class="special">(){</span><span class="keyword">return</span> <span class="string">"| v2 hello"</span><span class="special">;}</span>
-<span class="special">};</span>
-
-<span class="keyword">extern</span> <span class="string">"C"</span> <span class="keyword">void</span> <span class="identifier">BOOST_EXTENSION_EXPORT_DECL</span>
-<span class="identifier">extension_export_word</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">extensions</span><span class="special">::</span><span class="identifier">factory_map</span> <span class="special">&</span> <span class="identifier">fm</span><span class="special">)</span>
-<span class="special">{</span>
- <span class="identifier">fm</span><span class="special">.</span><span class="identifier">get</span><span class="special"><</span><span class="identifier">word</span><span class="special">,</span> <span class="keyword">int</span><span class="special">>()[</span><span class="number">22</span><span class="special">].</span><span class="identifier">set</span><span class="special"><</span><span class="identifier">world</span><span class="special">>();</span>
- <span class="comment">// int could be used as version (v2 word 2)
-</span> <span class="identifier">fm</span><span class="special">.</span><span class="identifier">get</span><span class="special"><</span><span class="identifier">word</span><span class="special">,</span> <span class="keyword">int</span><span class="special">>()[</span><span class="number">21</span><span class="special">].</span><span class="identifier">set</span><span class="special"><</span><span class="identifier">hello</span><span class="special">>();</span>
- <span class="comment">// int could be used as version (v2 word 1)
-</span><span class="special">}</span>
-</pre>
-<p>
- </p>
-<p>
- Also note that we are using the Info int to store some kind of "version",
- and then we could differentiate the classes by its int (see Info class tutorial
- for more information on this).
- </p>
-<p>
-
-</p>
-<pre class="programlisting"><span class="identifier">factory_map</span> <span class="identifier">fm</span><span class="special">;</span>
-
-<span class="comment">// load hello world first version
-</span><span class="identifier">load_single_library</span><span class="special">(</span><span class="identifier">fm</span><span class="special">,</span> <span class="string">"libHelloWorldLib.extension"</span><span class="special">,</span>
- <span class="string">"extension_export_word"</span><span class="special">);</span>
-
-<span class="comment">// load hello world second version
-</span><span class="identifier">load_single_library</span><span class="special">(</span><span class="identifier">fm</span><span class="special">,</span> <span class="string">"libHelloWorldLibv2.extension"</span><span class="special">,</span>
- <span class="string">"extension_export_word"</span><span class="special">);</span>
-
-<span class="comment">// load hello world second version again
-</span><span class="identifier">load_single_library</span><span class="special">(</span><span class="identifier">fm</span><span class="special">,</span> <span class="string">"libHelloWorldLibv2.extension"</span><span class="special">,</span>
- <span class="string">"extension_export_word"</span><span class="special">);</span>
-</pre>
-<p>
- </p>
-<p>
- We can see here that loading multiple libraries is as easy as calling <code class="computeroutput"><span class="identifier">load_single_library</span></code> for each one and using
- the same factory map.
- </p>
-<p>
- Then you can access them as any other factory_map:
- </p>
-<p>
-
-</p>
-<pre class="programlisting"><span class="keyword">for</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">list</span><span class="special"><</span><span class="identifier">factory</span><span class="special"><</span><span class="identifier">word</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span> <span class="special">>::</span><span class="identifier">iterator</span> <span class="identifier">current_word</span> <span class="special">=</span>
- <span class="identifier">factory_list</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span> <span class="identifier">current_word</span> <span class="special">!=</span> <span class="identifier">factory_list</span><span class="special">.</span><span class="identifier">end</span><span class="special">();</span>
- <span class="special">++</span><span class="identifier">current_word</span><span class="special">)</span> <span class="special">{</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">auto_ptr</span><span class="special"><</span><span class="identifier">word</span><span class="special">></span> <span class="identifier">word_ptr</span><span class="special">(</span><span class="identifier">current_word</span><span class="special">-></span><span class="identifier">create</span><span class="special">());</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">word_ptr</span><span class="special">-></span><span class="identifier">get_val</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" "</span><span class="special">;</span>
-<span class="special">}</span>
-<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
</pre>
<p>
</p>
<p>
- We get the following output:
- </p>
-<div class="informaltable"><table class="table">
-<colgroup><col></colgroup>
-<tbody><tr><td>
- <p>
- <code class="literal">words:</code><br> <code class="literal">hello world! | v2 hello
- world! v2 | v2 hello world! v2</code>
- </p>
- </td></tr></tbody>
-</table></div>
-<p>
- The first "hello world" is returned by the first version of the
- library, and the second and third returned by the second version.
- </p>
-<p>
- Finally, we will show another example similar to the former but in this case
- we implement a different interface, same class name ('hello') but with different
- interface ('salute').
- </p>
-<p>
- Let's see the interface:
+ Compilers have a number of options for exporting functions, variables and
+ type information when a shared library is loaded. For some compilers, or
+ with certain compiler settings, functions are not exported by default. Using
+ the `BOOST_EXTENSION_EXPORT_DECL macro, declared in extension.hpp, puts any
+ necessary export declarations in the function definition.
</p>
<p>
</p>
-<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">salute</span>
-<span class="special">{</span>
-<span class="keyword">public</span><span class="special">:</span>
- <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">salute</span><span class="special">(){}</span>
- <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">say</span><span class="special">(){</span><span class="keyword">return</span> <span class="string">""</span><span class="special">;}</span>
-<span class="special">};</span>
-</pre>
-<p>
- </p>
-<p>
- And the implementations:
- </p>
-<p>
-
-</p>
-<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">hello</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">salute</span>
-<span class="special">{</span>
-<span class="keyword">public</span><span class="special">:</span>
- <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span><span class="identifier">say</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="string">"hello"</span><span class="special">;}</span>
-<span class="special">};</span>
-
-<span class="keyword">class</span> <span class="identifier">bye</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">salute</span>
-<span class="special">{</span>
-<span class="keyword">public</span><span class="special">:</span>
- <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span><span class="identifier">say</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="string">"bye!"</span><span class="special">;}</span>
-<span class="special">};</span>
-
-
-<span class="keyword">extern</span> <span class="string">"C"</span> <span class="keyword">void</span> <span class="identifier">BOOST_EXTENSION_EXPORT_DECL</span>
-<span class="identifier">extension_export_salute</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">extensions</span><span class="special">::</span><span class="identifier">factory_map</span> <span class="special">&</span> <span class="identifier">fm</span><span class="special">)</span>
-<span class="special">{</span>
- <span class="identifier">fm</span><span class="special">.</span><span class="identifier">get</span><span class="special"><</span><span class="identifier">salute</span><span class="special">,</span> <span class="keyword">int</span><span class="special">>()[</span><span class="number">1</span><span class="special">].</span><span class="identifier">set</span><span class="special"><</span><span class="identifier">hello</span><span class="special">>();</span>
- <span class="identifier">fm</span><span class="special">.</span><span class="identifier">get</span><span class="special"><</span><span class="identifier">salute</span><span class="special">,</span> <span class="keyword">int</span><span class="special">>()[</span><span class="number">2</span><span class="special">].</span><span class="identifier">set</span><span class="special"><</span><span class="identifier">bye</span><span class="special">>();</span>
-<span class="special">}</span>
-</pre>
-<p>
- </p>
-<p>
- Note that we are adding a new class called 'hello' too but that implements
- 'salute' interface.
- </p>
-<p>
- <br>
- </p>
-<p>
- Finally in the main function we get the factory list specifying that we want
- the 'salute' factory. We iterate it getting each of the salutes, including
- hello.
- </p>
-<p>
-
-</p>
-<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">factory</span><span class="special"><</span><span class="identifier">salute</span><span class="special">></span> <span class="special">></span> <span class="special">&</span> <span class="identifier">salute_factory_list</span> <span class="special">=</span>
- <span class="identifier">fm</span><span class="special">.</span><span class="identifier">get</span><span class="special"><</span><span class="identifier">salute</span><span class="special">,</span> <span class="keyword">int</span><span class="special">>();</span>
-
-<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"salutes: "</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
-<span class="keyword">for</span> <span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">factory</span><span class="special"><</span><span class="identifier">salute</span><span class="special">></span> <span class="special">>::</span><span class="identifier">iterator</span> <span class="identifier">current_salute</span> <span class="special">=</span>
- <span class="identifier">salute_factory_list</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span>
- <span class="identifier">current_salute</span> <span class="special">!=</span> <span class="identifier">salute_factory_list</span><span class="special">.</span><span class="identifier">end</span><span class="special">();</span>
- <span class="special">++</span><span class="identifier">current_salute</span><span class="special">)</span> <span class="special">{</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">auto_ptr</span><span class="special"><</span><span class="identifier">salute</span><span class="special">></span> <span class="identifier">salute_ptr</span><span class="special">(</span><span class="identifier">current_salute</span><span class="special">-></span><span class="identifier">second</span><span class="special">.</span><span class="identifier">create</span><span class="special">());</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">salute_ptr</span><span class="special">-></span><span class="identifier">say</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" "</span><span class="special">;</span>
+<pre class="programlisting"><span class="comment">// Depending on the compiler and settings,
+</span><span class="comment">// it may be necessary to add a specific export
+</span><span class="comment">// declaration. The BOOST_EXTENSION_EXPORT_DECL
+</span><span class="comment">// adds this if necessary.
+</span><span class="keyword">void</span> <span class="identifier">BOOST_EXTENSION_EXPORT_DECL</span>
+<span class="identifier">boost_extension_hello_world</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">repetitions</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">for</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="identifier">repetitions</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Hello World"</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="special">}</span>
<span class="special">}</span>
-<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
-</pre>
-<p>
- </p>
-<p>
- The output is:
- </p>
-<div class="informaltable"><table class="table">
-<colgroup><col></colgroup>
-<tbody><tr><td>
- <p>
- <code class="literal">salutes:</code> <br> <code class="literal">hello bye!</code>
- </p>
- </td></tr></tbody>
-</table></div>
-<p>
- In conclusion, with Boost.Extension we can implement the same class in different
- libraries, the same class for different interfaces and load multiple libraries
- into the same factory.
- </p>
-</div>
-<div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_extension.tutorials.tutorial05"></a> Tutorial 5</h3></div></div></div>
-<p>
- In this tutorial we will describe an advanced example using the Info class.
- The basics of Info classes are explained in the specific section. We expect
- that you've gone through that section before following this example.
- </p>
-<p>
- Let's imagine that we are implementing an multi-protocol instant messaging
- client. Of course we want to support the maximum quantity of protocols, and
- it would be great if 3rd party programmers can implement new protocols and
- can add them dynamically.
- </p>
-<p>
- So let's define an interface for the protocols, with the expected operations:
- </p>
-<p>
-
-</p>
-<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">protocol</span>
-<span class="special">{</span>
- <span class="keyword">public</span><span class="special">:</span>
-
- <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="identifier">login</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span><span class="identifier">user</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span><span class="identifier">pass</span><span class="special">)</span> <span class="special">{}</span>
- <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="identifier">send</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span><span class="identifier">msg</span><span class="special">)</span> <span class="special">{}</span>
- <span class="keyword">virtual</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">receive</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">(</span><span class="string">""</span><span class="special">);</span> <span class="special">}</span>
- <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="identifier">change_status</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span><span class="identifier">new_status</span><span class="special">)</span> <span class="special">{}</span>
-
- <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">protocol</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{}</span>
-<span class="special">};</span>
-</pre>
-<p>
- </p>
-<p>
- Now we will implement some example protocols:
- </p>
-<p>
-
-</p>
-<pre class="programlisting"><span class="comment">// MSN protocol implementation
-</span><span class="keyword">class</span> <span class="identifier">MSN</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">protocol</span>
-<span class="special">{</span>
-<span class="keyword">public</span><span class="special">:</span>
- <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="identifier">login</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span><span class="identifier">user</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span><span class="identifier">pass</span><span class="special">)</span> <span class="special">{</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"MSN: Logged In"</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="special">}</span>
- <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="identifier">send</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span><span class="identifier">msg</span><span class="special">)</span> <span class="special">{</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"MSN: message ["</span> <span class="special"><<</span> <span class="identifier">msg</span> <span class="special"><<</span> <span class="string">"] sent"</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="special">}</span>
- <span class="keyword">virtual</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">receive</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
- <span class="keyword">return</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">(</span><span class="string">"MSN: hello! msg received"</span><span class="special">);</span>
- <span class="special">}</span>
- <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="identifier">change_status</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span><span class="identifier">new_status</span><span class="special">)</span> <span class="special">{</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"MSN: Status changed to ["</span> <span class="special"><<</span> <span class="identifier">new_status</span> <span class="special"><<</span> <span class="string">"]"</span>
- <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="special">}</span>
-
- <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">MSN</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{}</span>
-<span class="special">};</span>
-
-<span class="comment">// Jabber protocol implementation
-</span><span class="keyword">class</span> <span class="identifier">Jabber</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">protocol</span>
-<span class="special">{</span>
-<span class="keyword">public</span><span class="special">:</span>
- <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="identifier">login</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span><span class="identifier">user</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span><span class="identifier">pass</span><span class="special">)</span> <span class="special">{</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Jabber: Logged In"</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="special">}</span>
- <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="identifier">send</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span><span class="identifier">msg</span><span class="special">)</span> <span class="special">{</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Jabber: message ["</span> <span class="special"><<</span> <span class="identifier">msg</span> <span class="special"><<</span> <span class="string">"] sent"</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="special">}</span>
- <span class="keyword">virtual</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">receive</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span>
- <span class="keyword">return</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">(</span><span class="string">"Jabber: hello! msg received"</span><span class="special">);</span>
- <span class="special">}</span>
- <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="identifier">change_status</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span><span class="identifier">new_status</span><span class="special">)</span> <span class="special">{</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Jabber: Status changed to ["</span> <span class="special"><<</span> <span class="identifier">new_status</span> <span class="special"><<</span> <span class="string">"]"</span>
- <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="special">}</span>
-
- <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">Jabber</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{}</span>
-<span class="special">};</span>
</pre>
<p>
</p>
<p>
- Apart from that we need some protocol information like the server address,
- port or modes. This data is needed for each protocol and each protocol maybe
- could have different implementations with different servers or ports.
- </p>
-<p>
- Of course our Info class is a perfect solution to store this data. But in
- this case as the information is needed for each protocol we could define
- a base class as the info class and then implement specific versions for each
- protocol (at least one, could be more for each protocol).
- </p>
-<p>
- So let's define the base class:
+ Now that the shared library contents are set, the main executable needs to
+ be written to load it, and find the boost_extension_hello_world function.
</p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ The <code class="computeroutput"><span class="special"><</span><span class="identifier">iostream</span><span class="special">></span></code> header is included for error output.
+ </li>
+<li>
+ The <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">extension</span><span class="special">/</span><span class="identifier">shared_library</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code> header is included for the <code class="literal"><code class="computeroutput">shared_library</code></code>
+ class.
+ </li>
+<li>
+ The <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code> header is included for boost::function.
+ Though ordinary function pointers can be used with the <code class="literal"><code class="computeroutput">shared_library</code></code>
+ class, Boost.Function provides a more straightforward interface.
+ </li>
+</ul></div>
<p>
</p>
-<pre class="programlisting"><span class="comment">// interface for the parameters of each plugin
-</span><span class="keyword">class</span> <span class="identifier">network_parameters</span>
-<span class="special">{</span>
- <span class="keyword">public</span><span class="special">:</span>
- <span class="keyword">virtual</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">hostname</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
- <span class="keyword">virtual</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">port</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
- <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="identifier">set_http_mode</span><span class="special">(</span><span class="keyword">void</span><span class="special">)=</span> <span class="number">0</span><span class="special">;</span>
-
- <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">network_parameters</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{};</span>
-<span class="special">};</span>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">extension</span><span class="special">/</span><span class="identifier">shared_library</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
</pre>
<p>
</p>
<p>
- And the implementation for each of the defined plugins (protocols):
+ Create a <code class="literal"><code class="computeroutput">shared_library</code></code>
+ object, and open it.
</p>
<p>
</p>
-<pre class="programlisting"><span class="comment">// MSN implementation
-</span><span class="keyword">class</span> <span class="identifier">MSN_network_parameters</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">network_parameters</span>
-<span class="special">{</span>
- <span class="keyword">public</span><span class="special">:</span>
- <span class="keyword">virtual</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">hostname</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="string">"msn.messenger.com"</span><span class="special">;</span> <span class="special">}</span>
- <span class="keyword">virtual</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">port</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="string">"1863"</span><span class="special">;</span> <span class="special">}</span>
-
- <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="identifier">set_http_mode</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"http mode set"</span>
- <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="special">}</span>
-
- <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">MSN_network_parameters</span><span class="special">()</span> <span class="special">{}</span>
-<span class="special">};</span>
-
-
-<span class="comment">// Jabber implementation
-</span><span class="keyword">class</span> <span class="identifier">Jabber_network_parameters</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">network_parameters</span>
-<span class="special">{</span>
- <span class="keyword">public</span><span class="special">:</span>
- <span class="keyword">virtual</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">hostname</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="string">"jabber.org"</span><span class="special">;</span> <span class="special">}</span>
- <span class="keyword">virtual</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">port</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="string">"7063"</span><span class="special">;</span> <span class="special">}</span>
-
- <span class="keyword">virtual</span> <span class="keyword">void</span> <span class="identifier">set_http_mode</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="special">{</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"http mode not supported"</span>
- <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="special">}</span>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">extensions</span><span class="special">;</span>
- <span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">Jabber_network_parameters</span><span class="special">()</span> <span class="special">{}</span>
-<span class="special">};</span>
-</pre>
-<p>
- We want to be able to compare smart pointers to <code class="computeroutput"><span class="identifier">network_parameters</span></code>:
-
-</p>
-<pre class="programlisting"><span class="keyword">inline</span> <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span><span class="identifier">network_parameters</span><span class="special">></span> <span class="special">&</span> <span class="identifier">first</span><span class="special">,</span>
- <span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span><span class="identifier">network_parameters</span><span class="special">></span> <span class="special">&</span> <span class="identifier">second</span><span class="special">)</span> <span class="special">{</span>
- <span class="keyword">int</span> <span class="identifier">comp</span> <span class="special">=</span> <span class="identifier">strcmp</span><span class="special">(</span><span class="identifier">first</span><span class="special">-></span><span class="identifier">hostname</span><span class="special">(),</span> <span class="identifier">second</span><span class="special">-></span><span class="identifier">hostname</span><span class="special">());</span>
- <span class="keyword">if</span> <span class="special">(!</span><span class="identifier">comp</span><span class="special">)</span> <span class="special">{</span>
- <span class="keyword">return</span> <span class="identifier">strcmp</span><span class="special">(</span><span class="identifier">first</span><span class="special">-></span><span class="identifier">port</span><span class="special">(),</span> <span class="identifier">second</span><span class="special">-></span><span class="identifier">port</span><span class="special">())</span> <span class="special"><</span> <span class="number">0</span><span class="special">;</span>
+ <span class="comment">// In the Jamfile, shared libraries are set to have the same
+</span> <span class="comment">// prefix and extension, even on different operating systems.
+</span> <span class="comment">// This is for convenience in writing cross-platform code, but
+</span> <span class="comment">// is not required. All shared libraries are set to start with
+</span> <span class="comment">// "lib" and end with "extension".
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">library_path</span> <span class="special">=</span> <span class="string">"libtutorial_1.extension"</span><span class="special">;</span>
+
+ <span class="comment">// Create shared_library object with the relative or absolute
+</span> <span class="comment">// path to the shared library.
+</span> <span class="identifier">shared_library</span> <span class="identifier">lib</span><span class="special">(</span><span class="identifier">library_path</span><span class="special">);</span>
+
+ <span class="comment">// Attempt to open the shared library.
+</span> <span class="keyword">if</span> <span class="special">(!</span><span class="identifier">lib</span><span class="special">.</span><span class="identifier">open</span><span class="special">())</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cerr</span> <span class="special"><<</span> <span class="string">"Library failed to open: "</span> <span class="special"><<</span> <span class="identifier">library_path</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="number">1</span><span class="special">;</span>
<span class="special">}</span>
- <span class="keyword">else</span> <span class="keyword">return</span> <span class="identifier">comp</span> <span class="special"><</span> <span class="number">0</span><span class="special">;</span>
-<span class="special">}</span>
</pre>
<p>
- Now we can define our Info class as a smart pointer to the <code class="computeroutput"><span class="identifier">network_parameters</span></code> class and register it
- in the factory map:
</p>
<p>
-
-</p>
-<pre class="programlisting"><span class="keyword">extern</span> <span class="string">"C"</span> <span class="keyword">void</span> <span class="identifier">BOOST_EXTENSION_EXPORT_DECL</span>
-<span class="identifier">extension_export_plugins</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">extensions</span><span class="special">::</span><span class="identifier">factory_map</span> <span class="special">&</span> <span class="identifier">fm</span><span class="special">)</span>
-<span class="special">{</span>
- <span class="identifier">fm</span><span class="special">.</span><span class="identifier">add</span><span class="special"><</span> <span class="identifier">MSN</span><span class="special">,</span> <span class="identifier">protocol</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span><span class="identifier">network_parameters</span><span class="special">></span> <span class="special">></span>
- <span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span><span class="identifier">network_parameters</span><span class="special">>(</span><span class="keyword">new</span> <span class="identifier">MSN_network_parameters</span><span class="special">));</span>
- <span class="identifier">fm</span><span class="special">.</span><span class="identifier">add</span><span class="special"><</span> <span class="identifier">Jabber</span><span class="special">,</span> <span class="identifier">protocol</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span><span class="identifier">network_parameters</span><span class="special">></span> <span class="special">></span>
- <span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span><span class="identifier">network_parameters</span><span class="special">>(</span><span class="keyword">new</span> <span class="identifier">Jabber_network_parameters</span><span class="special">));</span>
-<span class="special">}</span>
-</pre>
-<p>
- </p>
-<p>
- Finally let's use our implementation for an hypothetical connection:
+ If it opened successfully, find a call the <code class="computeroutput"><span class="identifier">boost_extension_hello_world</span></code>
+ function.
</p>
<p>
</p>
-<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span>
-<span class="special">{</span>
- <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">extensions</span><span class="special">;</span>
-
- <span class="comment">// create the factory_map object - it will hold all of the available
-</span> <span class="comment">// constructors. Multiple factory_maps can be constructed.
-</span> <span class="identifier">factory_map</span> <span class="identifier">fm</span><span class="special">;</span>
-
- <span class="comment">// load the shared library with
-</span> <span class="identifier">load_single_library</span><span class="special">(</span><span class="identifier">fm</span><span class="special">,</span> <span class="string">"libIMPlugins.extension"</span><span class="special">,</span>
- <span class="string">"extension_export_plugins"</span><span class="special">);</span>
+<pre class="programlisting"> <span class="comment">// Retrieve a function from the library, and store it in a Boost.Function
+</span> <span class="comment">// object. It is also possible to use function pointers, but the syntax
+</span> <span class="comment">// for Boost.Function is easier to understand. This retrieves a function
+</span> <span class="comment">// called "boost_extension_hello_world" with a void return type and a single
+</span> <span class="comment">// parameter of type int.
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function</span><span class="special"><</span><span class="keyword">void</span> <span class="special">(</span><span class="keyword">int</span><span class="special">)></span>
+ <span class="identifier">f</span><span class="special">(</span><span class="identifier">lib</span><span class="special">.</span><span class="identifier">get</span><span class="special"><</span><span class="keyword">void</span><span class="special">,</span> <span class="keyword">int</span><span class="special">>(</span><span class="string">"boost_extension_hello_world"</span><span class="special">));</span>
- <span class="comment">// get a reference to the list of constructors for protocols
-</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span><span class="identifier">network_parameters</span><span class="special">>,</span> <span class="identifier">factory</span><span class="special"><</span><span class="identifier">protocol</span><span class="special">></span> <span class="special">></span> <span class="special">&</span>
- <span class="identifier">factory_list</span> <span class="special">=</span> <span class="identifier">fm</span><span class="special">.</span><span class="identifier">get</span><span class="special"><</span><span class="identifier">protocol</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span><span class="identifier">network_parameters</span><span class="special">></span> <span class="special">>();</span>
-
- <span class="keyword">if</span> <span class="special">(</span><span class="identifier">factory_list</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special"><</span> <span class="number">2</span><span class="special">)</span> <span class="special">{</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Error - the classes were not found."</span><span class="special">;</span>
+ <span class="comment">// Check that the function was found.
+</span> <span class="keyword">if</span> <span class="special">(!</span><span class="identifier">f</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cerr</span> <span class="special"><<</span> <span class="string">"Function not found!"</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="keyword">return</span> <span class="number">1</span><span class="special">;</span>
<span class="special">}</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span><span class="identifier">network_parameters</span><span class="special">>,</span> <span class="identifier">factory</span><span class="special"><</span><span class="identifier">protocol</span><span class="special">></span> <span class="special">></span>
- <span class="special">::</span><span class="identifier">iterator</span> <span class="identifier">current_plugin</span> <span class="special">=</span> <span class="identifier">factory_list</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span>
-
- <span class="comment">// MSN plugin
-</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">auto_ptr</span><span class="special"><</span><span class="identifier">protocol</span><span class="special">></span> <span class="identifier">MSN_ptr</span><span class="special">(</span><span class="identifier">current_plugin</span><span class="special">-></span><span class="identifier">second</span><span class="special">.</span><span class="identifier">create</span><span class="special">());</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span><span class="identifier">network_parameters</span><span class="special">></span> <span class="identifier">msn_parameters</span> <span class="special">=</span>
- <span class="identifier">current_plugin</span><span class="special">-></span><span class="identifier">first</span><span class="special">;</span>
- <span class="identifier">current_plugin</span><span class="special">++;</span>
-
- <span class="comment">// Jabber plugin
-</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">auto_ptr</span><span class="special"><</span><span class="identifier">protocol</span><span class="special">></span> <span class="identifier">Jabber_ptr</span><span class="special">(</span><span class="identifier">current_plugin</span><span class="special">-></span><span class="identifier">second</span><span class="special">.</span><span class="identifier">create</span><span class="special">());</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span><span class="identifier">network_parameters</span><span class="special">></span> <span class="identifier">jabber_parameters</span> <span class="special">=</span>
- <span class="identifier">current_plugin</span><span class="special">-></span><span class="identifier">first</span><span class="special">;</span>
-
- <span class="comment">// server
-</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"MSN hostname: "</span> <span class="special"><<</span> <span class="identifier">msn_parameters</span><span class="special">-></span><span class="identifier">hostname</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Jabber hostname: "</span> <span class="special"><<</span> <span class="identifier">jabber_parameters</span><span class="special">-></span><span class="identifier">hostname</span><span class="special">()</span>
- <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
-
- <span class="comment">// http_mode: note that one of the implementations doesn't support it,
-</span> <span class="comment">// having a base class
-</span> <span class="comment">// and different specific concrete network parameters allow us to handle this
-</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"MSN: "</span><span class="special">;</span>
- <span class="identifier">msn_parameters</span><span class="special">-></span><span class="identifier">set_http_mode</span><span class="special">();</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Jabber: "</span><span class="special">;</span>
- <span class="identifier">jabber_parameters</span><span class="special">-></span><span class="identifier">set_http_mode</span><span class="special">();</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
-
- <span class="comment">// login
-</span> <span class="identifier">MSN_ptr</span><span class="special">-></span><span class="identifier">login</span><span class="special">(</span><span class="string">"testuser"</span><span class="special">,</span> <span class="string">"testpass"</span><span class="special">);</span>
- <span class="identifier">Jabber_ptr</span><span class="special">-></span><span class="identifier">login</span><span class="special">(</span><span class="string">"testuser"</span><span class="special">,</span> <span class="string">"testpass"</span><span class="special">);</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
-
- <span class="comment">// send message
-</span> <span class="identifier">MSN_ptr</span><span class="special">-></span><span class="identifier">send</span><span class="special">(</span><span class="string">"hi"</span><span class="special">);</span>
- <span class="identifier">Jabber_ptr</span><span class="special">-></span><span class="identifier">send</span><span class="special">(</span><span class="string">"hi"</span><span class="special">);</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
-
- <span class="comment">// change status
-</span> <span class="identifier">MSN_ptr</span><span class="special">-></span><span class="identifier">change_status</span><span class="special">(</span><span class="string">"away"</span><span class="special">);</span>
- <span class="identifier">Jabber_ptr</span><span class="special">-></span><span class="identifier">change_status</span><span class="special">(</span><span class="string">"away"</span><span class="special">);</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
-
- <span class="comment">// wait for message
-</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">MSN_ptr</span><span class="special">-></span><span class="identifier">receive</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">Jabber_ptr</span><span class="special">-></span><span class="identifier">receive</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
-
- <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+ <span class="comment">// Call the function from the shared library with
+</span> <span class="comment">// an integer parameter.
+</span> <span class="identifier">f</span><span class="special">(</span><span class="number">4</span><span class="special">);</span>
<span class="special">}</span>
-
</pre>
<p>
</p>
<p>
- And we get the following output:
- </p>
-<div class="informaltable"><table class="table">
-<colgroup><col></colgroup>
-<tbody><tr><td>
- <p>
- <code class="literal">MSN hostname: msn.messenger.com<br> Jabber hostname: jabber.org<br>
- <br> MSN: http mode set<br> Jabber: http mode not supported<br>
- <br> MSN: Logged In<br> Jabber: Logged In<br> <br> MSN: message
- [hi] sent<br> Jabber: message [hi] sent<br> <br> MSN: Status
- changed to [away]<br> Jabber: Status changed to [away]<br> <br>
- MSN: hello! msg received<br> Jabber: hello! msg received<br>
- </code>
- </p>
- </td></tr></tbody>
-</table></div>
-<p>
- The complete code is in the <code class="literal">examples/info/im</code> directory.
+ This will print out "Hello World" four times.
</p>
</div>
<p>
@@ -1012,7 +336,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="factories.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="reference.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="factories.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="tutorials/tutorial02.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/libs/extension/doc/html/boost_extension/tutorials/tutorial05.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost_extension/tutorials/tutorial05.html (original)
+++ sandbox/libs/extension/doc/html/boost_extension/tutorials/tutorial05.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -7,7 +7,8 @@
<link rel="start" href="../../index.html" title="Chapter 1. Boost.Extension">
<link rel="up" href="../tutorials.html" title="Tutorials">
<link rel="prev" href="tutorial04.html" title=" Tutorial 4">
-<link rel="next" href="../factories.html" title=" Factories">
+<link rel="next" href="../extension_reflection.html" title=" Boost.Reflection/Boost.Extension
+ Interoperability">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -20,7 +21,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="tutorial04.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorials.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../factories.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="tutorial04.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorials.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../extension_reflection.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
@@ -313,7 +314,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="tutorial04.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorials.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../factories.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="tutorial04.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tutorials.html"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../extension_reflection.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Added: sandbox/libs/extension/doc/html/boost_extension/type_safety.html
==============================================================================
--- (empty file)
+++ sandbox/libs/extension/doc/html/boost_extension/type_safety.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -0,0 +1,73 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Type Safety of Boost.Extension</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Extension">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Extension">
+<link rel="prev" href="performance_analysis.html" title=" Performance Analysis">
+<link rel="next" href="faq.html" title=" FAQ">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="performance_analysis.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="faq.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_extension.type_safety"></a> Type Safety of Boost.Extension</h2></div></div></div>
+<p>
+ This section is currently incomplete. More work is being done to avoid type
+ safety issues with the <span class="underline">instance</span> class
+ especially.
+ </p>
+<p>
+ Type-safe classes in Boost.Extension:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><code class="literal"><code class="computeroutput">factory</code></code></li>
+<li><code class="literal"><code class="computeroutput">adaptable_factory</code></code></li>
+<li><code class="literal"><code class="computeroutput">type_map</code></code></li>
+<li><code class="literal"><code class="computeroutput">parameter_map</code></code></li>
+</ul></div>
+<p>
+ Other classes:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+<code class="literal"><code class="computeroutput">reflection</code></code>,
+ <span class="underline">instance</span>: An <span class="underline">instance</span>
+ must be used only with the <code class="literal"><code class="computeroutput">reflection</code></code>
+ from which it was created. Other than this, these two classes are type safe.
+ </li>
+<li>
+<code class="literal"><code class="computeroutput">shared_library</code></code>:
+ The get functions for this class do not guarantee type safety. This is caused
+ by the fact that the underlying operating system-specific functions return
+ void pointers that must be converted to function pointers.
+ </li>
+</ul></div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2008 Jeremy Pack<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="performance_analysis.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="faq.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Modified: sandbox/libs/extension/doc/html/index.html
==============================================================================
--- sandbox/libs/extension/doc/html/index.html (original)
+++ sandbox/libs/extension/doc/html/index.html 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -5,7 +5,7 @@
<link rel="stylesheet" href="boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.67.2">
<link rel="start" href="index.html" title="Chapter 1. Boost.Extension">
-<link rel="next" href="boost_extension/motivation.html" title=" Motivation">
+<link rel="next" href="boost_extension/introduction.html" title=" Introduction">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -17,7 +17,7 @@
<td align="center">More</td>
</tr></table>
<hr>
-<div class="spirit-nav"><a accesskey="n" href="boost_extension/motivation.html"><img src="../../doc/html/images/next.png" alt="Next"></a></div>
+<div class="spirit-nav"><a accesskey="n" href="boost_extension/introduction.html"><img src="../../doc/html/images/next.png" alt="Next"></a></div>
<div class="chapter" lang="en">
<div class="titlepage"><div>
<div><h2 class="title">
@@ -36,111 +36,113 @@
<div class="toc">
<p><b>Table of Contents</b></p>
<dl>
-<dt><span class="section"> Introduction</span></dt>
+<dt><span class="section"> Recent Changes</span></dt>
+<dt><span class="section"> Introduction</span></dt>
<dt><span class="section"> Motivation</span></dt>
<dt><span class="section"> Shared Libraries</span></dt>
<dd><dl>
<dt><span class="section"><a href="boost_extension/shared_libraries.html#boost_extension.shared_libraries.name_resolution"> Name
Resolution</a></span></dt>
-<dt><span class="section"><a href="boost_extension/shared_libraries.html#boost_extension.shared_libraries.shared_library_issues">
+<dt><span class="section"><a href="boost_extension/shared_libraries/shared_library_issues.html">
Other Issues with Shared Libraries</a></span></dt>
-<dt><span class="section"><a href="boost_extension/shared_libraries.html#boost_extension.shared_libraries.shared_library_inefficiencies">
+<dt><span class="section"><a href="boost_extension/shared_libraries/shared_library_inefficiencies.html">
Possible Inefficiencies in Shared Libraries</a></span></dt>
-<dt><span class="section"><a href="boost_extension/shared_libraries.html#boost_extension.shared_libraries.shared_library_class">shared_library
+<dt><span class="section"><a href="boost_extension/shared_libraries/shared_library_class.html">shared_library
class</a></span></dt>
</dl></dd>
<dt><span class="section"> Factories</span></dt>
<dt><span class="section">Tutorials</span></dt>
<dd><dl>
-<dt><span class="section"> Tutorial 1</span></dt>
-<dt><span class="section"> Tutorial 2</span></dt>
-<dt><span class="section"> Tutorial 3</span></dt>
-<dt><span class="section"> Tutorial 4</span></dt>
-<dt><span class="section"> Tutorial 5</span></dt>
-</dl></dd>
-<dt><span class="section">Reference</span></dt>
-<dd><dl>
-<dt><span class="section">Header <boost/extension/common.hpp></span></dt>
-<dt><span class="section">Header <boost/extension/convenience.hpp></span></dt>
-<dt><span class="section">Header <boost/extension/extension.hpp></span></dt>
-<dt><span class="section">Header <boost/extension/factory.hpp></span></dt>
-<dt><span class="section">Header <boost/extension/factory_map.hpp></span></dt>
-<dt><span class="section">Header <boost/extension/filesystem.hpp></span></dt>
-<dt><span class="section">Header <boost/extension/functor.hpp></span></dt>
-<dt><span class="section">Header <boost/extension/shared_library.hpp></span></dt>
+<dt><span class="section"><a href="boost_extension/tutorials.html#boost_extension.tutorials.tutorial01"> Tutorial 1 - Using
+ the <code class="literal"><code class="computeroutput">shared_library</code></code>
+ class</a></span></dt>
+<dt><span class="section"> Tutorial 2</span></dt>
+<dt><span class="section"> Tutorial 3</span></dt>
+<dt><span class="section"> Tutorial 4</span></dt>
+<dt><span class="section"> Tutorial 5</span></dt>
</dl></dd>
<dt><span class="section"><a href="boost_extension/extension_reflection.html"> Boost.Reflection/Boost.Extension
Interoperability</a></span></dt>
-<dt><span class="section">Reference</span></dt>
-<dd><dl>
-<dt><span class="section">Header <boost/reflection/adapter.hpp></span></dt>
-<dt><span class="section">Header <boost/reflection/common.hpp></span></dt>
-<dt><span class="section">Header <boost/reflection/constructor.hpp></span></dt>
-<dt><span class="section">Header <boost/reflection/constructor_info.hpp></span></dt>
-<dt><span class="section">Header <boost/reflection/data.hpp></span></dt>
-<dt><span class="section">Header <boost/reflection/data_info.hpp></span></dt>
-<dt><span class="section">Header <boost/reflection/factory.hpp></span></dt>
-<dt><span class="section">Header <boost/reflection/function.hpp></span></dt>
-<dt><span class="section">Header <boost/reflection/function_info.hpp></span></dt>
-<dt><span class="section">Header <boost/reflection/generic_constructor.hpp></span></dt>
-<dt><span class="section">Header <boost/reflection/instance.hpp></span></dt>
-<dt><span class="section">Header <boost/reflection/parameter.hpp></span></dt>
-<dt><span class="section">Header <boost/reflection/parameter_map.hpp></span></dt>
-<dt><span class="section">Header <boost/reflection/reflection.hpp></span></dt>
-</dl></dd>
<dt><span class="section"> Info Classes</span></dt>
<dt><span class="section"> Performance Analysis</span></dt>
+<dt><span class="section"> Type Safety of Boost.Extension</span></dt>
<dt><span class="section"> FAQ</span></dt>
<dt><span class="section"> Appendices</span></dt>
<dd><dl>
-<dt><span class="section"><a href="boost_extension/appendices.html#boost_extension.appendices.appendix_a"> Appendix A -
+<dt><span class="section"><a href="boost_extension/appendices.html#boost_extension.appendices.appendices_description"> Contents
+ in Appendices</a></span></dt>
+<dt><span class="section">Reference</span></dt>
+<dt><span class="section"><a href="boost_extension/appendices/appendix_a.html"> Appendix A -
Windows Export and Import Declarations</a></span></dt>
-<dt><span class="section"><a href="boost_extension/appendices.html#boost_extension.appendices.appendix_b"> Appendix B -
+<dt><span class="section"><a href="boost_extension/appendices/appendix_b.html"> Appendix B -
Optional Dependencies</a></span></dt>
</dl></dd>
</dl>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="boost_extension.introduction"></a> Introduction</h2></div></div></div>
+<a name="boost_extension.recent_changes"></a> Recent Changes</h2></div></div></div>
<p>
- The Boost.Extension library has been developed to ease the development of plugins
- and similar extensions to software. Classes can be made available from shared
- libraries and loaded by the application.
- </p>
-<p>
- Among others, the library has the following features:
+ The most recent changes to Boost.Extension, in preparation for this library's
+ submission to Boost for review:
</p>
<div class="itemizedlist"><ul type="disc">
<li>
- Multiple and virtual inheritance are supported
- </li>
-<li>
- Library users do not need to use any macros (besides those required by Windows
- for exported functions)
+ Deprecation of <code class="literal"><code class="computeroutput">factory_map</code></code>
+ in favor of <code class="literal"><code class="computeroutput">type_map</code></code>
+ (tutorials to come).
</li>
<li>
- Only one external function required per shared library to export classes
+ All reflection documentation will be contained within the Extension docs.
+ During review, or perhaps shortly before, it will be determined whether or
+ not these should be two separate libraries, and if so, where the split should
+ occur - since they share significant functionality.
</li>
<li>
- RTTI is used by default, but it is possible to use user-defined type identification
+ The <code class="literal"><code class="computeroutput">adaptable_factory</code></code>
+ class has been added to facilitate calling factories when the parameters
+ of the constructor are unknown.
</li>
<li>
- Classes do not need to be modified to be loadable
+ The addition of the source code for a runtime compilation example. This involves
+ compiling a shared library at runtime, and calling code from it. Examples
+ will come soon.
</li>
</ul></div>
<p>
- This library is currently in development in preparation for a review for inclusion
- in the Boost C++ Libraries. For ongoing status updates, check <a href="http://boost-extension.blogspot.com/" target="_top">C++
- Plugins and Reflection</a>.
+ The latest updates in this documentation are:
+ </p>
+<p>
+ Class references:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><code class="literal"><code class="computeroutput">shared_library</code></code></li>
+<li><code class="literal"><code class="computeroutput">type_map</code></code></li>
+<li><code class="literal"><code class="computeroutput">reflection</code></code></li>
+<li><code class="literal"><code class="computeroutput">parameter</code></code></li>
+<li><code class="literal"><code class="computeroutput">parameter_map</code></code></li>
+<li><code class="literal"><code class="computeroutput">adaptable_factory</code></code></li>
+<li><code class="literal"><code class="computeroutput">factory</code></code></li>
+</ul></div>
+<p>
+ Tutorials:
+ </p>
+<div class="itemizedlist"><ul type="disc"><li>Tutorial 1: The shared_library class</li></ul></div>
+<p>
+ Other Sections:
+ </p>
+<div class="itemizedlist"><ul type="disc"><li>Motivation</li></ul></div>
+<p>
+ The other sections in the documentation should be updated over the next few
+ weeks, in preparation for review.
</p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: February 12, 2008 at 19:25:00 GMT</small></p></td>
+<td align="left"><p><small>Last revised: July 23, 2008 at 21:36:00 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
-<div class="spirit-nav"><a accesskey="n" href="boost_extension/motivation.html"><img src="../../doc/html/images/next.png" alt="Next"></a></div>
+<div class="spirit-nav"><a accesskey="n" href="boost_extension/introduction.html"><img src="../../doc/html/images/next.png" alt="Next"></a></div>
</body>
</html>
Modified: sandbox/libs/extension/doc/introduction.qbk
==============================================================================
--- sandbox/libs/extension/doc/introduction.qbk (original)
+++ sandbox/libs/extension/doc/introduction.qbk 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -8,20 +8,38 @@
[section:introduction Introduction]
The Boost.Extension library has been developed to ease the development of
-plugins and similar extensions to software. Classes can be made available from
-shared libraries and loaded by the application.
+plugins and similar extensions to software using shared libraries.
+Classes, functions and data can be made available from shared
+libraries and loaded by the application.
+
+It consists of the following parts:
+
+
+* Shared library handling
+* Typed data containers
+* Factories
+* Reflection
+
Among others, the library has the following features:
-* Multiple and virtual inheritance are supported
-* Library users do not need to use any macros (besides those required by Windows for exported functions)
-* Only one external function required per shared library to export classes
-* RTTI is used by default, but it is possible to use user-defined type identification
-* Classes do not need to be modified to be loadable
+
+* Multiple and virtual inheritance are supported.
+* Library users do not need to use any macros (besides those required by
+Windows for exported functions).
+* Only one external function required per shared library to export classes.
+* RTTI is used by default, but it is possible to use user-defined type identification.
+* Classes do not need to be modified to be loadable through factories or reflection.
+* Constructors can be called even when the signature is unknown, for both
+factories and reflection.
+* Run-time compilation and loading of shared libraries.
This library is currently in development in preparation for a review for inclusion in the
Boost C++ Libraries. For ongoing status updates, check
[@http://boost-extension.blogspot.com/ C++ Plugins and Reflection].
+The most up-to-date portions of this documentation are the header references. Other
+sections of the documentation will be updated in the coming weeks.
+
[endsect]
Added: sandbox/libs/extension/doc/old_tutorial1.qbk
==============================================================================
--- (empty file)
+++ sandbox/libs/extension/doc/old_tutorial1.qbk 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -0,0 +1,130 @@
+[/ Boost.Extension - first tutorial ]
+[/ Copyright 2008 Jeremy Pack ]
+[/ Distributed under the Boost Software License, Version 1.0. (See]
+[/ accompanying file LICENSE_1_0.txt or copy at ]
+[/ http://www.boost.org/LICENSE_1_0.txt) ]
+[/ See http://www.boost.org/ for latest version. ]
+
+
+[section:tutorial01 Tutorial 1]
+
+Create a class that we will later subclass and put it into a header file called
+word.hpp.
+``
+class word
+{
+public:
+ virtual ~word(){}
+ virtual const char * get_val(){return "";}
+};
+``
+This file will be included by both the shared library in which classes implement
+this interface, and in the executable that will load these implementations. The
+destructor ought to be virtual, just to ensure proper deletion. We create one
+virtual function. We could actually add data to this class as well.
+
+Now create a file called hello_world.cpp. This will be compiled into a shared
+library:
+
+``
+#include "word.hpp"
+#include <boost/extension/factory_map.hpp>
+
+class world : public word
+{
+public:
+ virtual const char * get_val(){return "world!";}
+};
+class hello : public word
+{
+public:
+ virtual const char * get_val(){return "hello";}
+};
+``
+Now we have two classes that are derived from word, and that both implement the
+virtual function get_val. All that's left is to declare them for exporting.
+Normally, we just put one function in the entire shared library that exports
+all exportable classes in the library.
+``
+extern "C" void BOOST_EXTENSION_EXPORT_DECL
+extension_export_word(boost::extensions::factory_map & fm)
+{
+ fm.get<word, int>()[1].set<hello>();
+ fm.get<word, int>()[2].set<world>();
+}
+``
+`extern "C"` is required to keep the function name from being mangled.
+`BOOST_EXTENSION_EXPORT_DECL` is only necessary on Windows - on other platforms
+it does nothing. On Windows, it declares that the function should be exported.
+This is the default in shared libraries on other platforms.
+
+The `factory_map::get` function takes two template arguments: the type of
+factory to get (the interface returned by it), and what type of info is used
+to identify it (which can be an arbitrary type).
+
+This returns a `std::map`, in this case, `std::map<int, factory<word> >`.
+We then index the map to find (and perhaps create) the appropriate factory,
+and set the type of class it instantiates to the template argument of the
+`set` function. The argument is the value for that identification info.
+
+Now we can write the executable.
+
+``
+#include <boost/extension/factory_map.hpp>
+#include <boost/extension/shared_library.hpp>
+#include <iostream>
+#include <boost/extension/convenience.hpp>
+#include "word.hpp"
+int main()
+{
+ using namespace boost::extensions;
+ // Create the factory_map object - it will hold all of the available
+ // constructors. Multiple factory_maps can be constructed.
+ factory_map fm;
+ // load the shared library with
+ load_single_library(fm, "libHelloWorldLib.extension",
+ "extension_export_word");
+ // Get a reference to the list of constructors for words.
+ std::list<factory<word, int> > & factory_list = fm.get<word, int>();
+ if (factory_list.size() < 2)
+ std::cout << "Error - the classes were not found.";
+ for (std::list<factory<word, int> >::iterator current_word =
+ factory_list.begin(); current_word != factory_list.end();
+ ++current_word) {
+ // Using auto_ptr to avoid needing delete. Using smart_ptrs is recommended.
+ // Note that this has a zero argument constructor - currently constructors
+ // with up to six arguments can be used.
+ std::auto_ptr<word> word_ptr(current_word->create());
+ std::cout << word_ptr->get_val() << " ";
+ }
+ std::cout << "\n";
+ return 0;
+}
+``
+Now we just need to write the build file. You may have noticed above that the
+name of the library is assumed to be libHelloWorld.extension - we'll need to
+rename whatever shared library is compiled to that. Boost.Build can do this
+automatically.
+
+``
+import type : change-generated-target-suffix ;
+import type : change-generated-target-prefix ;
+type.change-generated-target-suffix SHARED_LIB : : extension ;
+type.change-generated-target-prefix SHARED_LIB : : lib ;
+import os ;
+
+local BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
+project
+ : requirements
+ <include>../../../
+ <include>$(BOOST_ROOT)
+ :
+ ;
+
+exe HelloWorld : main.cpp ;
+lib HelloWorldLib : hello_world.cpp : <link>shared ;
+install ../bin : HelloWorld HelloWorldLib ;
+``
+If you use another build system, you'll need to make sure that the output
+shared library (dll, so, dylib etc.) is renamed correctly.
+[endsect]
\ No newline at end of file
Modified: sandbox/libs/extension/doc/tutorial1.qbk
==============================================================================
--- sandbox/libs/extension/doc/tutorial1.qbk (original)
+++ sandbox/libs/extension/doc/tutorial1.qbk 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -6,125 +6,202 @@
[/ See http://www.boost.org/ for latest version. ]
-[section:tutorial01 Tutorial 1]
+[section:tutorial01 Tutorial 1 - Using the _shared_library_ class]
-Create a class that we will later subclass and put it into a header file called
-word.hpp.
-``
-class word
-{
-public:
- virtual ~word(){}
- virtual const char * get_val(){return "";}
-};
-``
-This file will be included by both the shared library in which classes implement
-this interface, and in the executable that will load these implementations. The
-destructor ought to be virtual, just to ensure proper deletion. We create one
-virtual function. We could actually add data to this class as well.
-
-Now create a file called hello_world.cpp. This will be compiled into a shared
-library:
-
-``
-#include "word.hpp"
-#include <boost/extension/factory_map.hpp>
-
-class world : public word
-{
-public:
- virtual const char * get_val(){return "world!";}
-};
-class hello : public word
-{
-public:
- virtual const char * get_val(){return "hello";}
-};
-``
-Now we have two classes that are derived from word, and that both implement the
-virtual function get_val. All that's left is to declare them for exporting.
-Normally, we just put one function in the entire shared library that exports
-all exportable classes in the library.
-``
-extern "C" void BOOST_EXTENSION_EXPORT_DECL
-extension_export_word(boost::extensions::factory_map & fm)
-{
- fm.get<word, int>()[1].set<hello>();
- fm.get<word, int>()[2].set<world>();
-}
-``
-`extern "C"` is required to keep the function name from being mangled.
-`BOOST_EXTENSION_EXPORT_DECL` is only necessary on Windows - on other platforms
-it does nothing. On Windows, it declares that the function should be exported.
-This is the default in shared libraries on other platforms.
+The _shared_library_ class facilitates loading shared libraries
+and calling functions from them.
-The `factory_map::get` function takes two template arguments: the type of
-factory to get (the interface returned by it), and what type of info is used
-to identify it (which can be an arbitrary type).
+This tutorial will describe building a shared library with
+a single exported function, and then creating an executable
+that loads the shared library and calls the function.
-This returns a `std::map`, in this case, `std::map<int, factory<word> >`.
-We then index the map to find (and perhaps create) the appropriate factory,
-and set the type of class it instantiates to the template argument of the
-`set` function. The argument is the value for that identification info.
+For purposes of this tutorial, Boost.Build will be used
+as the build system.
-Now we can write the executable.
+The options put into this build file are boilerplate that will
+be reused for the other examples in this documentation.
+
+Shared libraries on different platforms can have different
+prefixes and/or extensions, for example:
+
+
+* .dll (Windows)
+* .so (Unix/Linux)
+* .dylib or .bundle (OS X)
+
+
+In order to simplify loading of these libraries, it is common
+to use a custom naming scheme. For these examples, all shared
+libraries are prefixed with "lib" and end with ".extension",
+but it is fine to use a different naming scheme.
+
+To achieve this in Boost.Build, add the following lines at the
+top of the Jamfile:
-``
-#include <boost/extension/factory_map.hpp>
-#include <boost/extension/shared_library.hpp>
-#include <iostream>
-#include <boost/extension/convenience.hpp>
-#include "word.hpp"
-int main()
-{
- using namespace boost::extensions;
- // Create the factory_map object - it will hold all of the available
- // constructors. Multiple factory_maps can be constructed.
- factory_map fm;
- // load the shared library with
- load_single_library(fm, "libHelloWorldLib.extension",
- "extension_export_word");
- // Get a reference to the list of constructors for words.
- std::list<factory<word, int> > & factory_list = fm.get<word, int>();
- if (factory_list.size() < 2)
- std::cout << "Error - the classes were not found.";
- for (std::list<factory<word, int> >::iterator current_word =
- factory_list.begin(); current_word != factory_list.end();
- ++current_word) {
- // Using auto_ptr to avoid needing delete. Using smart_ptrs is recommended.
- // Note that this has a zero argument constructor - currently constructors
- // with up to six arguments can be used.
- std::auto_ptr<word> word_ptr(current_word->create());
- std::cout << word_ptr->get_val() << " ";
- }
- std::cout << "\n";
- return 0;
-}
-``
-Now we just need to write the build file. You may have noticed above that the
-name of the library is assumed to be libHelloWorld.extension - we'll need to
-rename whatever shared library is compiled to that. Boost.Build can do this
-automatically.
``
import type : change-generated-target-suffix ;
import type : change-generated-target-prefix ;
type.change-generated-target-suffix SHARED_LIB : : extension ;
type.change-generated-target-prefix SHARED_LIB : : lib ;
+``
+
+This example uses code from both the main Boost tree, and from
+the Extension headers - which are currently located in the sandbox.
+Make sure that BOOST_ROOT and BOOST_SANDBOX_ROOT are set to the locations
+of these two trees - or use the related options for your compiler or IDE.
+
+Here, both of those directories are added as include paths.
+
+``
import os ;
local BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
+local BOOST_SANDBOX_ROOT = [ os.environ BOOST_SANDBOX_ROOT ] ;
project
: requirements
- <include>../../../
+ <include>$(BOOST_SANDBOX_ROOT)
<include>$(BOOST_ROOT)
:
;
+``
+
+This final section of the Jamfile compiles both the shared library
+and main executable, and installs them into the binaries/ subdirectory.
+
+It is usually simplest to place all shared libraries used by an application
+in a common directory.
+
+
+``
+lib tutorial_1 : tutorial_1/hello_world.cpp : <link>shared ;
+exe tutorial_1_bin : tutorial_1/main.cpp ;
+
+install binaries :
+ tutorial_1 tutorial_1_bin
+ ;
+``
+
+
+The hello_world.cpp file is the source of the shared library. It consists
+of a single exported function which prints out a message a number of times,
+according to the `repetitions` parameter to the function.
+
+The <iostream> header is included for `std::cout`.
+The <boost/extension/extension.hpp> header is used for the
+`BOOST_EXTENSION_EXPORT_DECL` macro.
+
+``
+#include <iostream>
+#include <boost/extension/extension.hpp>
+``
-exe HelloWorld : main.cpp ;
-lib HelloWorldLib : hello_world.cpp : <link>shared ;
-install ../bin : HelloWorld HelloWorldLib ;
+In C, each function name in a compilation unit is unique. In C++, however,
+function overloading is permitted - as are various types of templated functions,
+namespaces etc. Because of this, C++ function names are mangled for linking. In
+order to find a function in a shared library, its name must be known. This leaves
+two options:
+
+
+* Determine the mangled name.
+* Declare that the function has C linkage, using the `extern "C"` declaration.
+
+
+Extension uses the second approach. Though this eases portability, it also poses
+a risk to type safety. A simple, cross-platform solution to this problem would
+probably require direction from the C++ Standards Committee. Until that time,
+the [link type_safety Type Safety] section has advice on avoding type safety issues
+when using the _shared_library_ class.
+
+``
+// Any exported function or variable must be declared
+// extern "C" to avoid C++ name mangling.
+extern "C"
+
+``
+
+Compilers have a number of options for exporting functions, variables
+and type information when a shared library is loaded. For some compilers, or
+with certain compiler settings, functions are not exported by default. Using
+the `BOOST_EXTENSION_EXPORT_DECL macro, declared in extension.hpp, puts any
+necessary export declarations in the function definition.
+
+``
+// Depending on the compiler and settings,
+// it may be necessary to add a specific export
+// declaration. The BOOST_EXTENSION_EXPORT_DECL
+// adds this if necessary.
+void BOOST_EXTENSION_EXPORT_DECL
+boost_extension_hello_world(int repetitions) {
+ for (int i = 0; i < repetitions; ++i) {
+ std::cout << "Hello World" << std::endl;
+ }
+}
+``
+
+Now that the shared library contents are set, the main executable needs
+to be written to load it, and find the boost_extension_hello_world function.
+
+* The `<iostream>` header is included for error output.
+* The `<boost/extension/shared_library.hpp>` header is included for the
+_shared_library_ class.
+* The `<boost/function.hpp>` header is included for boost::function. Though
+ordinary function pointers can be used with the _shared_library_ class, Boost.Function
+provides a more straightforward interface.
+
+``
+#include <iostream>
+#include <boost/extension/shared_library.hpp>
+#include <boost/function.hpp>
+``
+
+Create a _shared_library_ object, and open it.
+
+``
+int main() {
+ using namespace boost::extensions;
+
+ // In the Jamfile, shared libraries are set to have the same
+ // prefix and extension, even on different operating systems.
+ // This is for convenience in writing cross-platform code, but
+ // is not required. All shared libraries are set to start with
+ // "lib" and end with "extension".
+ std::string library_path = "libtutorial_1.extension";
+
+ // Create shared_library object with the relative or absolute
+ // path to the shared library.
+ shared_library lib(library_path);
+
+ // Attempt to open the shared library.
+ if (!lib.open()) {
+ std::cerr << "Library failed to open: " << library_path << std::endl;
+ return 1;
+ }
``
-If you use another build system, you'll need to make sure that the output
-shared library (dll, so, dylib etc.) is renamed correctly.
+
+If it opened successfully, find a call the `boost_extension_hello_world` function.
+
+``
+ // Retrieve a function from the library, and store it in a Boost.Function
+ // object. It is also possible to use function pointers, but the syntax
+ // for Boost.Function is easier to understand. This retrieves a function
+ // called "boost_extension_hello_world" with a void return type and a single
+ // parameter of type int.
+ boost::function<void (int)>
+ f(lib.get<void, int>("boost_extension_hello_world"));
+
+ // Check that the function was found.
+ if (!f) {
+ std::cerr << "Function not found!" << std::endl;
+ return 1;
+ }
+
+ // Call the function from the shared library with
+ // an integer parameter.
+ f(4);
+}
+``
+
+This will print out "Hello World" four times.
+
[endsect]
\ No newline at end of file
Added: sandbox/libs/extension/doc/type_safety.qbk
==============================================================================
--- (empty file)
+++ sandbox/libs/extension/doc/type_safety.qbk 2008-07-24 23:05:25 EDT (Thu, 24 Jul 2008)
@@ -0,0 +1,29 @@
+[/ Boost.Extension - Type Safety ]
+[/ Copyright 2008 Jeremy Pack ]
+[/ Distributed under the Boost Software License, Version 1.0. (See]
+[/ accompanying file LICENSE_1_0.txt or copy at ]
+[/ http://www.boost.org/LICENSE_1_0.txt) ]
+[/ See http://www.boost.org/ for latest version. ]
+
+
+[section:type_safety Type Safety of Boost.Extension]
+
+This section is currently incomplete. More work is being done to avoid
+type safety issues with the _instance_ class especially.
+
+Type-safe classes in Boost.Extension:
+
+* _factory_
+* _adaptable_factory_
+* _type_map_
+* _parameter_map_
+
+Other classes:
+
+* _reflection_, _instance_: An _instance_ must be used only with the _reflection_ from
+which it was created. Other than this, these two classes are type safe.
+* _shared_library_: The get functions for this class do not guarantee type safety. This
+is caused by the fact that the underlying operating system-specific functions return void
+pointers that must be converted to function pointers.
+
+[endsect]
\ No newline at end of file
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk