|
Boost-Commit : |
From: oryol_at_[hidden]
Date: 2008-07-19 22:35:04
Author: jeremypack
Date: 2008-07-19 22:35:01 EDT (Sat, 19 Jul 2008)
New Revision: 47615
URL: http://svn.boost.org/trac/boost/changeset/47615
Log:
Doc updates.
Added:
sandbox/libs/extension/doc/appendix_c.qbk (contents, props changed)
sandbox/libs/extension/doc/extension-reflection.qbk (contents, props changed)
sandbox/libs/extension/doc/extension_reflection.qbk (contents, props changed)
sandbox/libs/extension/doc/html/BOOST_EXTENSION_EXPORT_DECL.html (contents, props changed)
sandbox/libs/extension/doc/html/BOOST_EXTENSION_MAX_FUNCTOR_PARAMS.html (contents, props changed)
sandbox/libs/extension/doc/html/N.html (contents, props changed)
sandbox/libs/extension/doc/html/boost_extension/faq.html (contents, props changed)
sandbox/libs/extension/doc/html/boost_extension/motivation.html (contents, props changed)
sandbox/libs/extension/doc/motivation.qbk (contents, props changed)
Properties modified:
sandbox/libs/extension/doc/html/boost_extension/appendices.html (contents, props changed)
sandbox/libs/extension/doc/html/boost_extension/factories.html (contents, props changed)
sandbox/libs/extension/doc/html/boost_extension/info.html (contents, props changed)
sandbox/libs/extension/doc/html/boost_extension/introduction.html (props changed)
sandbox/libs/extension/doc/html/boost_extension/performance_analysis.html (contents, props changed)
sandbox/libs/extension/doc/html/boost_extension/quick_start.html (props changed)
sandbox/libs/extension/doc/html/boost_extension/quickstart.html (props changed)
sandbox/libs/extension/doc/html/boost_extension/shared_libraries.html (contents, props changed)
sandbox/libs/extension/doc/html/boost_extension/tutorial_1.html (props changed)
sandbox/libs/extension/doc/html/boost_extension/tutorial_2.html (props changed)
sandbox/libs/extension/doc/html/boost_extension/tutorial_3.html (props changed)
sandbox/libs/extension/doc/html/boost_extension/tutorial_4.html (props changed)
sandbox/libs/extension/doc/html/boost_extension/tutorial_5.html (props changed)
sandbox/libs/extension/doc/html/boost_extension/tutorial_6.html (props changed)
sandbox/libs/extension/doc/html/boost_extension/tutorials.html (contents, props changed)
sandbox/libs/extension/doc/html/index.html (contents, props changed)
Binary files modified:
sandbox/libs/extension/doc/html/boost_extension/appendices.html
Text files modified:
sandbox/libs/extension/doc/Jamfile.v2 | 27 +
sandbox/libs/extension/doc/extension.qbk | 15
sandbox/libs/extension/doc/html/boost/extensions/basic_factory_map.html | 32
sandbox/libs/extension/doc/html/boost/extensions/factory.html | 48 +-
sandbox/libs/extension/doc/html/boost/extensions/factory_map.html | 12
sandbox/libs/extension/doc/html/boost/extensions/load_single_library.html | 14
sandbox/libs/extension/doc/html/boost/extensions/shared_library.html | 48 +-
sandbox/libs/extension/doc/html/boost_extension/appendices/appendix_b.html | 2
sandbox/libs/extension/doc/html/boost_extension/factories.html | 14
sandbox/libs/extension/doc/html/boost_extension/info.html | 8
sandbox/libs/extension/doc/html/boost_extension/performance_analysis.html | 8
sandbox/libs/extension/doc/html/boost_extension/reference.html | 161 +++++++
sandbox/libs/extension/doc/html/boost_extension/shared_libraries.html | 202 ++++++---
sandbox/libs/extension/doc/html/boost_extension/tutorials.html | 820 +++++++++++++++++++++++++++++++++++++++
sandbox/libs/extension/doc/html/boost_extension/tutorials/tutorial02.html | 2
sandbox/libs/extension/doc/html/boost_extension/tutorials/tutorial03.html | 2
sandbox/libs/extension/doc/html/boost_extension/tutorials/tutorial04.html | 2
sandbox/libs/extension/doc/html/boost_extension/tutorials/tutorial05.html | 2
sandbox/libs/extension/doc/html/index.html | 71 ++
sandbox/libs/extension/doc/shared_libraries.qbk | 114 +++-
20 files changed, 1350 insertions(+), 254 deletions(-)
Modified: sandbox/libs/extension/doc/Jamfile.v2
==============================================================================
--- sandbox/libs/extension/doc/Jamfile.v2 (original)
+++ sandbox/libs/extension/doc/Jamfile.v2 2008-07-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -14,7 +14,7 @@
import os ;
local BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
-doxygen autodoc
+doxygen autodoc_extension
:
[ glob ../../../boost/extension/*.hpp ]
:
@@ -29,6 +29,22 @@
<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\" \\
+ \"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)
+ ;
xml extension : extension.qbk ;
@@ -36,10 +52,11 @@
:
extension
:
- <xsl:param>toc.max.depth=3
- <xsl:param>toc.section.depth=3
- <xsl:param>chunk.section.depth=3
- <dependency>autodoc
+ <xsl:param>toc.max.depth=2
+ <xsl:param>toc.section.depth=2
+ <xsl:param>chunk.section.depth=1
+ <dependency>autodoc_extension
+ <dependency>autodoc_reflection
;
install css : [ glob $(BOOST_ROOT)/doc/src/*.css ]
Added: sandbox/libs/extension/doc/appendix_c.qbk
==============================================================================
Added: sandbox/libs/extension/doc/extension-reflection.qbk
==============================================================================
--- (empty file)
+++ sandbox/libs/extension/doc/extension-reflection.qbk 2008-07-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -0,0 +1,138 @@
+[/ Boost.Reflection - main doc ]
+[/ 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:extension-reflection Boost.Reflection/Boost.Extension Interoperability]
+Reflections are designed to work with Boost.Extension, or with
+shared libraries in general. A simple example is included in
+examples/extension/.
+
+Declaring the reflected class itself is similar to the
+process for doing the same in Boost.Extension.
+
+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.
+``
+import type : change-generated-target-suffix ;
+import type : change-generated-target-prefix ;
+type.change-generated-target-suffix SHARED_LIB : : reflection ;
+type.change-generated-target-prefix SHARED_LIB : : lib ;
+exe extension-reflection : extension/extension.cpp ;
+lib car_lib : extension/car_lib.cpp : <link>shared ;
+``
+
+The code in the shared library is defined in
+libs/reflection/examples/extension/car_lib.cpp.
+
+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.
+``
+class suv
+{
+public:
+ suv(const char * name) : car(name) {}
+ const char * get_type(void) { return "It's an SUV."; }
+ ~suv(void) {}
+};
+
+class compact
+{
+public:
+ compact(const char * name) : car(name) {}
+ const char * get_type(void) { return "It's a compact."; }
+ ~compact(void) {}
+};
+``
+
+Just like Boost.Extension, an external function needs to be
+defined that will be called by the main module.
+
+extern "C"
+void BOOST_EXTENSION_EXPORT_DECL
+extension_export_car(std::map<std::string, reflection> reflection_map) {
+ reflection_map["suv"]
+ .reflect<suv>()
+ .constructor<const char*>()
+ .function(&suv::get_type, "get_type");
+ reflection_map["suv"]
+ .reflect<compact>()
+ .constructor<const char*>()
+ .function(&compact::get_type, "get_type");
+}
+
+This is all that is necessary to export one constructor and one
+function for each class.
+
+Now, in extension.cpp, we combine Boost.Extension and
+Boost.Reflection code to load and use the reflections declared
+in the shared library.
+
+Create a mapping of reflections to strings that
+will be populated inside the shared library.
+``
+std::map<std::string, reflection> reflection_map;
+``
+Load the shared library using Boost.Extension.
+``
+boost::extensions::shared_library lib
+ ((std::string(BOOST_EXTENSION_DIR_START) +
+ "libcar_lib.extension").c_str());
+lib.open();
+``
+Call an exported function to populate
+reflection_map.
+``
+lib.get<void, std::map<std::string,
+ reflection> &>
+ ("extension_export_car")(reflection_map);
+if (reflection_map.size() != size_t(2)) {
+ std::cout << "Could not load reflections!";
+ return 1;
+}
+``
+Pull out two reflections that were named "suv" and
+"compact" respectively.
+``
+reflection & first_reflection =
+ reflection_map["suv"];
+reflection & second_reflection =
+ reflection_map["compact"];
+``
+Use the get_constructor function to find a constructor
+that takes one argument, a const char*.
+``
+instance_constructor<const char *> first_constructor =
+ first_reflection.get_constructor<const char *>();
+``
+Use the constructor retrieved to create an instance.
+Warning! instances should only be used with functions
+and constructors generated by a single reflection object.
+``
+instance first_instance =
+ first_constructor("First Instance");
+``
+Get a function to call on this instance.
+``
+boost::reflections::function<const char *> first_function =
+ first_reflection.get_function<const char *>("get_type");
+std::cout << "First reflection: " << first_function(first_instance)
+ << std::endl;
+ ``
+Repeat the steps for the second reflection.
+``
+instance_constructor<const char *> second_constructor =
+ second_reflection.get_constructor<const char *>();
+instance second_instance =
+ second_constructor("Second Instance");
+boost::reflections::function<const char *> second_function =
+ second_reflection.get_function<const char *>("get_type");
+std::cout << "Second reflection: " << second_function(second_instance)
+ << std::endl;
+``
+[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-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -7,8 +7,10 @@
[library Boost.Extension
[quickbook 1.4]
- [copyright 2008 Jeremy Pack, Mariano G. Consoni]
- [purpose Factory management and facilities for using shared libraries]
+ [copyright 2008 Jeremy Pack]
+ [authors [Pack, Jeremy]]
+ [purpose
+ Factory management 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
@@ -24,10 +26,13 @@
[def _factory_ [^[classref boost::extensions::factory factory]]]
[include introduction.qbk]
-[include tutorials.qbk]
-[include factories.qbk]
+[include motivation.qbk]
[include shared_libraries.qbk]
-[xinclude autodoc.xml]
+[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 faq.qbk]
Added: sandbox/libs/extension/doc/extension_reflection.qbk
==============================================================================
--- (empty file)
+++ sandbox/libs/extension/doc/extension_reflection.qbk 2008-07-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -0,0 +1,138 @@
+[/ Boost.Reflection - main doc ]
+[/ 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:extension_reflection Boost.Reflection/Boost.Extension Interoperability]
+Reflections are designed to work with Boost.Extension, or with
+shared libraries in general. A simple example is included in
+examples/extension/.
+
+Declaring the reflected class itself is similar to the
+process for doing the same in Boost.Extension.
+
+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.
+``
+import type : change-generated-target-suffix ;
+import type : change-generated-target-prefix ;
+type.change-generated-target-suffix SHARED_LIB : : reflection ;
+type.change-generated-target-prefix SHARED_LIB : : lib ;
+exe extension-reflection : extension/extension.cpp ;
+lib car_lib : extension/car_lib.cpp : <link>shared ;
+``
+
+The code in the shared library is defined in
+libs/reflection/examples/extension/car_lib.cpp.
+
+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.
+``
+class suv
+{
+public:
+ suv(const char * name) : car(name) {}
+ const char * get_type(void) { return "It's an SUV."; }
+ ~suv(void) {}
+};
+
+class compact
+{
+public:
+ compact(const char * name) : car(name) {}
+ const char * get_type(void) { return "It's a compact."; }
+ ~compact(void) {}
+};
+``
+
+Just like Boost.Extension, an external function needs to be
+defined that will be called by the main module.
+
+extern "C"
+void BOOST_EXTENSION_EXPORT_DECL
+extension_export_car(std::map<std::string, reflection> reflection_map) {
+ reflection_map["suv"]
+ .reflect<suv>()
+ .constructor<const char*>()
+ .function(&suv::get_type, "get_type");
+ reflection_map["suv"]
+ .reflect<compact>()
+ .constructor<const char*>()
+ .function(&compact::get_type, "get_type");
+}
+
+This is all that is necessary to export one constructor and one
+function for each class.
+
+Now, in extension.cpp, we combine Boost.Extension and
+Boost.Reflection code to load and use the reflections declared
+in the shared library.
+
+Create a mapping of reflections to strings that
+will be populated inside the shared library.
+``
+std::map<std::string, reflection> reflection_map;
+``
+Load the shared library using Boost.Extension.
+``
+boost::extensions::shared_library lib
+ ((std::string(BOOST_EXTENSION_DIR_START) +
+ "libcar_lib.extension").c_str());
+lib.open();
+``
+Call an exported function to populate
+reflection_map.
+``
+lib.get<void, std::map<std::string,
+ reflection> &>
+ ("extension_export_car")(reflection_map);
+if (reflection_map.size() != size_t(2)) {
+ std::cout << "Could not load reflections!";
+ return 1;
+}
+``
+Pull out two reflections that were named "suv" and
+"compact" respectively.
+``
+reflection & first_reflection =
+ reflection_map["suv"];
+reflection & second_reflection =
+ reflection_map["compact"];
+``
+Use the get_constructor function to find a constructor
+that takes one argument, a const char*.
+``
+instance_constructor<const char *> first_constructor =
+ first_reflection.get_constructor<const char *>();
+``
+Use the constructor retrieved to create an instance.
+Warning! instances should only be used with functions
+and constructors generated by a single reflection object.
+``
+instance first_instance =
+ first_constructor("First Instance");
+``
+Get a function to call on this instance.
+``
+boost::reflections::function<const char *> first_function =
+ first_reflection.get_function<const char *>("get_type");
+std::cout << "First reflection: " << first_function(first_instance)
+ << std::endl;
+ ``
+Repeat the steps for the second reflection.
+``
+instance_constructor<const char *> second_constructor =
+ second_reflection.get_constructor<const char *>();
+instance second_instance =
+ second_constructor("Second Instance");
+boost::reflections::function<const char *> second_function =
+ second_reflection.get_function<const char *>("get_type");
+std::cout << "Second reflection: " << second_function(second_instance)
+ << std::endl;
+``
+[endsect]
\ No newline at end of file
Added: sandbox/libs/extension/doc/html/BOOST_EXTENSION_EXPORT_DECL.html
==============================================================================
--- (empty file)
+++ sandbox/libs/extension/doc/html/BOOST_EXTENSION_EXPORT_DECL.html 2008-07-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -0,0 +1,51 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_EXTENSION_EXPORT_DECL</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.extension.hpp" title="Header <boost/extension/extension.hpp>">
+<link rel="prev" href="boost/extensions/load_single_library.html" title="Function load_single_library">
+<link rel="next" href="boost/extensions/factory.html" title="Class template 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="boost/extensions/load_single_library.html"><img src="../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_extension/reference.html#header.boost.extension.extension.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/extensions/factory.html"><img src="../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_EXTENSION_EXPORT_DECL"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_EXTENSION_EXPORT_DECL</span></h2>
+<p>BOOST_EXTENSION_EXPORT_DECL — </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">BOOST_EXTENSION_EXPORT_DECL</pre></div>
+<div class="refsect1" lang="en">
+<a name="id449932"></a><h2>Description</h2>
+<p>Macro to place in a function definition to cause it to be exported, if necessary on the given platform and with the current compiler settings. This is always required for MSVC and other compilers, but only required depending on compiler settings for GCC and other compilers. </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="boost/extensions/load_single_library.html"><img src="../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_extension/reference.html#header.boost.extension.extension.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/extensions/factory.html"><img src="../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/libs/extension/doc/html/BOOST_EXTENSION_MAX_FUNCTOR_PARAMS.html
==============================================================================
--- (empty file)
+++ sandbox/libs/extension/doc/html/BOOST_EXTENSION_MAX_FUNCTOR_PARAMS.html 2008-07-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -0,0 +1,51 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_EXTENSION_MAX_FUNCTOR_PARAMS</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.common.hpp" title="Header <boost/extension/common.hpp>">
+<link rel="prev" href="boost_extension/reference.html" title="Reference">
+<link rel="next" href="boost/extensions/load_single_library.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.common.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/extensions/load_single_library.html"><img src="../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_EXTENSION_MAX_FUNCTOR_PARAMS"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_EXTENSION_MAX_FUNCTOR_PARAMS</span></h2>
+<p>BOOST_EXTENSION_MAX_FUNCTOR_PARAMS — </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">BOOST_EXTENSION_MAX_FUNCTOR_PARAMS</pre></div>
+<div class="refsect1" lang="en">
+<a name="id449650"></a><h2>Description</h2>
+<p>This determines the maximum number of parameters that a constructor or exported shared library function can have. 10 is the same default as Boost.Function. </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="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.common.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/extensions/load_single_library.html"><img src="../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/libs/extension/doc/html/N.html
==============================================================================
--- (empty file)
+++ sandbox/libs/extension/doc/html/N.html 2008-07-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro N</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="header/boost/extension/factory/hpp.html" title="Header <boost/extension/factory.hpp>">
+<link rel="prev" href="header/boost/extension/factory/hpp.html" title="Header <boost/extension/factory.hpp>">
+<link rel="next" href="BOOST_PP_ITERATION_LIMITS_id86926.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>
+<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="header/boost/extension/factory/hpp.html"><img src="../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="header/boost/extension/factory/hpp.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_PP_ITERATION_LIMITS_id86926.html"><img src="../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="N"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro N</span></h2>
+<p>N — </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">N</pre></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, Mariano G. Consoni<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="header/boost/extension/factory/hpp.html"><img src="../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="header/boost/extension/factory/hpp.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_PP_ITERATION_LIMITS_id86926.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-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -5,8 +5,8 @@
<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="../../header/boost/extension/factory_map/hpp.html" title="Header <boost/extension/factory_map.hpp>">
-<link rel="prev" href="../../header/boost/extension/factory_map/hpp.html" title="Header <boost/extension/factory_map.hpp>">
+<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="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="../../header/boost/extension/factory_map/hpp.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../header/boost/extension/factory_map/hpp.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="factory_map.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<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>
</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="id450849"></a><h2>Description</h2>
+<a name="id450769"></a><h2>Description</h2>
<p>
</p>
<div class="refsect2" lang="en">
-<a name="id450856"></a><h3>
+<a name="id450777"></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="id288577-bb"></a>~basic_factory_map();</pre></li></ol></div>
+<div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id290381-bb"></a>~basic_factory_map();</pre></li></ol></div>
</div>
<div class="refsect2" lang="en">
-<a name="id450897"></a><h3>
-<a name="id288517-bb"></a><code class="computeroutput">basic_factory_map</code> public member functions</h3>
+<a name="id450817"></a><h3>
+<a name="id290321-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="id288519-bb"></a>get() ;</pre>
+ <span class="type">std::map< Info, factory< Interface, Params...> > &</span> <a name="id290323-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="id288551-bb"></a><span class="bold"><strong>operator</strong></span> std::map< Info, factory< Interface, Params...> >() ;</pre>
+ <a name="id290355-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>
@@ -82,7 +82,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 © 2008 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>
@@ -90,7 +90,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../../header/boost/extension/factory_map/hpp.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../header/boost/extension/factory_map/hpp.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="factory_map.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<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>
</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-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -5,9 +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="../../header/boost/extension/factory/hpp.html" title="Header <boost/extension/factory.hpp>">
-<link rel="prev" href="../../header/boost/extension/factory/hpp.html" title="Header <boost/extension/factory.hpp>">
-<link rel="next" href="../../header/boost/extension/factory_map/hpp.html" title="Header <boost/extension/factory_map.hpp>">
+<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">
</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="../../header/boost/extension/factory/hpp.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../header/boost/extension/factory/hpp.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="../../header/boost/extension/factory_map/hpp.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.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>
</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="type">T *</span> create(Params...) ;
+ 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="id450310"></a><h2>Description</h2>
+<a name="id450219"></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="id450320"></a><h3>
+<a name="id450229"></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="id288474-bb"></a>factory();</pre></li>
-<li><pre class="literallayout"><a name="id288478-bb"></a>factory(factory< T > <span class="bold"><strong>const</strong></span> & first);</pre></li>
-<li><pre class="literallayout">factory& <a name="id288488-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="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>
</ol></div>
</div>
<div class="refsect2" lang="en">
-<a name="id450426"></a><h3>
-<a name="id93876-bb"></a><code class="computeroutput">factory</code> public member functions</h3>
+<a name="id450335"></a><h3>
+<a name="id92772-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="id93878-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="id91786-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="id89970-bb"></a>is_valid() ;</pre>
+<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>
<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="id288450-bb"></a>create(Params...) ;</pre>
+<pre class="literallayout"><span class="type">T *</span> <a name="id290255-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).
@@ -125,7 +125,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 © 2008 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>
@@ -133,7 +133,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../../header/boost/extension/factory/hpp.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../header/boost/extension/factory/hpp.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="../../header/boost/extension/factory_map/hpp.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.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>
</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-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -5,9 +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="../../header/boost/extension/factory_map/hpp.html" title="Header <boost/extension/factory_map.hpp>">
+<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="../../header/boost/extension/filesystem/hpp.html" title="Header <boost/extension/filesystem.hpp>">
+<link rel="next" href="../../BOOST_PP_ITERATION_LIMITS_id290432.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="../../header/boost/extension/factory_map/hpp.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="../../header/boost/extension/filesystem/hpp.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_id290432.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,13 +32,13 @@
<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="id451075"></a><h2>Description</h2>
+<a name="id450994"></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, 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>
@@ -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="../../header/boost/extension/factory_map/hpp.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="../../header/boost/extension/filesystem/hpp.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_id290432.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/libs/extension/doc/html/boost/extensions/load_single_library.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost/extensions/load_single_library.html (original)
+++ sandbox/libs/extension/doc/html/boost/extensions/load_single_library.html 2008-07-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -5,9 +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="../../header/boost/extension/convenience/hpp.html" title="Header <boost/extension/convenience.hpp>">
-<link rel="prev" href="../../header/boost/extension/convenience/hpp.html" title="Header <boost/extension/convenience.hpp>">
-<link rel="next" href="../../header/boost/extension/extension/hpp.html" title="Header <boost/extension/extension.hpp>">
+<link rel="up" href="../../boost_extension/reference.html#header.boost.extension.convenience.hpp" title="Header <boost/extension/convenience.hpp>">
+<link rel="prev" href="../../BOOST_EXTENSION_MAX_FUNCTOR_PARAMS.html" title="Macro BOOST_EXTENSION_MAX_FUNCTOR_PARAMS">
+<link rel="next" href="../../BOOST_EXTENSION_EXPORT_DECL.html" title="Macro BOOST_EXTENSION_EXPORT_DECL">
</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="../../header/boost/extension/convenience/hpp.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../header/boost/extension/convenience/hpp.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="../../header/boost/extension/extension/hpp.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="../../BOOST_EXTENSION_MAX_FUNCTOR_PARAMS.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.convenience.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_EXPORT_DECL.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="refentry" lang="en">
<a name="boost.extensions.load_single_library"></a><div class="titlepage"></div>
@@ -34,7 +34,7 @@
<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="refsect1" lang="en">
-<a name="id449893"></a><h2>Description</h2>
+<a name="id449790"></a><h2>Description</h2>
<p>Add any exported factories from the given library with the given function name. This uses shared_library::get internally. The function must have the signature void (factory_map&). For more general loading of shared libraries, use the shared_library class directly. If the function is not found, false is returned.</p>
<p>
@@ -89,7 +89,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 © 2008 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>
@@ -97,7 +97,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../../header/boost/extension/convenience/hpp.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../header/boost/extension/convenience/hpp.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="../../header/boost/extension/extension/hpp.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="../../BOOST_EXTENSION_MAX_FUNCTOR_PARAMS.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_extension/reference.html#header.boost.extension.convenience.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_EXPORT_DECL.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-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -5,9 +5,10 @@
<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="../../header/boost/extension/shared_library/hpp.html" title="Header <boost/extension/shared_library.hpp>">
-<link rel="prev" href="../../header/boost/extension/shared_library/hpp.html" title="Header <boost/extension/shared_library.hpp>">
-<link rel="next" href="../../boost_extension/info.html" title=" Info Classes">
+<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">
</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="../../header/boost/extension/shared_library/hpp.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../header/boost/extension/shared_library/hpp.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_extension/info.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<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>
</div>
<div class="refentry" lang="en">
<a name="boost.extensions.shared_library"></a><div class="titlepage"></div>
@@ -33,29 +34,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="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="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="id451490"></a><h2>Description</h2>
-<p>This class is inherently not type-safe. Carefully check the signature of the function or type in the shared library against the template arguments of the get functions. </p>
+<a name="id451422"></a><h2>Description</h2>
<p>
</p>
<div class="refsect2" lang="en">
-<a name="id451502"></a><h3>
+<a name="id451429"></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="id288778-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="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>
<p>shared_library constructor
</p>
<div class="variablelist"><table border="0">
@@ -82,17 +82,17 @@
</table></div>
</li>
<li>
-<pre class="literallayout"><a name="id288771-bb"></a>~shared_library();</pre>
+<pre class="literallayout"><a name="id290595-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="id451617"></a><h3>
-<a name="id288656-bb"></a><code class="computeroutput">shared_library</code> public member functions</h3>
+<a name="id451545"></a><h3>
+<a name="id290455-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="id288658-bb"></a>is_open() ;</pre>
+<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>
<p>
@@ -119,7 +119,7 @@
</table></div>
</li>
<li>
-<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id288677-bb"></a>open() ;</pre>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id290477-bb"></a>open() ;</pre>
<p>
@@ -146,7 +146,7 @@
</table></div>
</li>
<li>
-<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id288700-bb"></a>close() ;</pre>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id290500-bb"></a>close() ;</pre>
<p>
@@ -174,7 +174,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="id288725-bb"></a>get(<span class="bold"><strong>const</strong></span> std::string & name) ;</pre>
+ <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>
<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>
@@ -205,7 +205,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 © 2008 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>
@@ -213,7 +213,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../../header/boost/extension/shared_library/hpp.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../header/boost/extension/shared_library/hpp.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_extension/info.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+<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>
</div>
</body>
</html>
Modified: sandbox/libs/extension/doc/html/boost_extension/appendices.html
==============================================================================
Binary files. No diff available.
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-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -46,7 +46,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 © 2008 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>
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-19 22:35:01 EDT (Sat, 19 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="../index.html" title="Chapter 1. Boost.Extension">
-<link rel="prev" href="tutorials/tutorial05.html" title=" Tutorial 5">
-<link rel="next" href="shared_libraries.html" title=" Shared Libraries">
+<link rel="prev" href="shared_libraries.html" title=" Shared Libraries">
+<link rel="next" href="tutorials.html" title="Tutorials">
</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="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="shared_libraries.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="../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 +50,7 @@
are:
</p>
<a name="boost_extension.factories.void_set_lt_d_gt___"></a><h3>
-<a name="id448963"></a>
+<a name="id435884"></a>
<a href="factories.html#boost_extension.factories.void_set_lt_d_gt___">void set<D>()</a>
</h3>
<p>
@@ -60,7 +60,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="id449012"></a>
+<a name="id435933"></a>
<a href="factories.html#boost_extension.factories.bool_is_valid__">bool is_valid()</a>
</h3>
<p>
@@ -69,7 +69,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 © 2008 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>
@@ -77,7 +77,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<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="shared_libraries.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="../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>
Added: sandbox/libs/extension/doc/html/boost_extension/faq.html
==============================================================================
--- (empty file)
+++ sandbox/libs/extension/doc/html/boost_extension/faq.html 2008-07-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -0,0 +1,70 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> FAQ</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="appendices.html" title=" Appendices">
+</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="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">
+<a name="boost_extension.faq"></a> FAQ</h2></div></div></div>
+<p>
+ Question: What if I have multiple versions of the same interface (I've added
+ new member functions as they've become necessary), and I want to keep track
+ of which version is implemented by different plugins?
+ </p>
+<p>
+ Answer: The simplest way is to change the name of your interface (or the namespace
+ it is in) each time its contents change. This is actually what I would recommend.
+ However, it is also possible to include such information as part of the <code class="literal"><code class="computeroutput">factory</code></code>. A <code class="literal"><code class="computeroutput">factory</code></code> can contain
+ arbitrary information about the plugin that it loads through the Info type.
+ In the <code class="computeroutput"><span class="identifier">hello_world</span></code> sample,
+ the <code class="computeroutput"><span class="identifier">Info</span></code> type is an <code class="computeroutput"><span class="keyword">int</span></code>, and the <code class="computeroutput"><span class="identifier">hello</span></code>
+ class has a number (it could be a version) of 1, and the <code class="computeroutput"><span class="identifier">world</span></code>
+ class has a version of 2. In the multiple_inheritance sample, this type is
+ a string. This will be detailed in greater detail in this documentation.
+ </p>
+<p>
+ Question: What if I want to have a library close automatically when I've destroyed
+ all of the plugins in it?
+ </p>
+<p>
+ Answer: I have not yet found a general enough way to do this that doesn't introduce
+ too many constraints for programmers. I recommend developing a specific solution
+ for your use case for now if you really need this.
+ </p>
+<p>
+ Question:
+ </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="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>
+</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-19 22:35:01 EDT (Sat, 19 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="../boost/extensions/shared_library.html" title="Class shared_library">
+<link rel="prev" href="../boost/reflections/basic_reflection/reflector.html" title="Class template reflector">
<link rel="next" href="performance_analysis.html" title=" Performance Analysis">
</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="../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="performance_analysis.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="../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">
@@ -236,7 +236,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 © 2008 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>
@@ -244,7 +244,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="performance_analysis.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="../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>
Added: sandbox/libs/extension/doc/html/boost_extension/motivation.html
==============================================================================
--- (empty file)
+++ sandbox/libs/extension/doc/html/boost_extension/motivation.html 2008-07-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -0,0 +1,92 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Motivation</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="../index.html" title="Chapter 1. Boost.Extension">
+<link rel="next" href="shared_libraries.html" title=" Shared Libraries">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../index.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="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">
+<a name="boost_extension.motivation"></a> Motivation</h2></div></div></div>
+<p>
+ The original motivation for Boost.Extension was a moving-object-tracking application.
+ This application was to be used for both real-time and post-processing analysis
+ of a series of images. The types of cameras used for tracking were anything
+ from low-speed, low-resolution IR cameras, to medium-speed color camcorders
+ to high-speed, multi-spectral IR cameras.
+ </p>
+<p>
+ Each client or potential client of the application had different input types,
+ and different types of data they needed at the end. There were, in general,
+ the following major problems:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Some clients had proprietary image formats that needed to be input, or proprietary
+ algorithms they wished to use for the data. We could not give these algorithms
+ to other clients.
+ </li>
+<li>
+ Clients wanted to be able to adapt the software to work with new requirements,
+ such as a new camera type, in the future. To do this, one client in particular
+ wanted full ownership of the source code.
+ </li>
+<li>
+ Our code had become very entangled, and our application had become a mess
+ of menus covering the various bits of functionality.
+ </li>
+</ul></div>
+<p>
+ Initially, we just delivered different builds to each customer. This was tedious,
+ and only solved the first problem.
+ </p>
+<p>
+ For this reason, work was begun on using shared libraries which would each
+ contain a related set of modules. Each customer would be given two sets of
+ files:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Shared libraries for their specific data types, UI needs, algorithms, etc.
+ </li>
+<li>
+ An SDK to develop plugins in the future to handle any new requirements for
+ the software.
+ </li>
+</ul></div>
+<p>
+ Boost.Extension is designed to make this type of solution simple, portable,
+ and easily extensible.
+ </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="../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>
+</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-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -41,7 +41,7 @@
Boost) more optimization will be performed.
</p>
<a name="boost_extension.performance_analysis.first_comparison"></a><h1>
-<a name="id454829"></a>
+<a name="id463328"></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="id454916"></a>
+<a name="id463415"></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="id454923"></a>
+<a name="id463422"></a>
<a href="performance_analysis.html#boost_extension.performance_analysis.boost__function_overhead">boost::function
overhead</a>
</h1>
@@ -148,7 +148,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 © 2008 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>
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-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -6,8 +6,9 @@
<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="next" href="../BOOST_EXTENSION_MAX_FUNCTOR_PARAMS.html" title="Macro BOOST_EXTENSION_MAX_FUNCTOR_PARAMS">
+<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">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -20,32 +21,162 @@
</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="../BOOST_EXTENSION_MAX_FUNCTOR_PARAMS.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="../boost/reflections/parameter_unavailable_exception.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="toc"><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">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></div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="header.boost.extension.common.hpp"></a>Header <boost/extension/common.hpp></h3></div></div></div>
+<a name="header.boost.reflection.adapter.hpp"></a>Header <boost/reflection/adapter.hpp></h3></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;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Info = std::string,
+ <span class="bold"><strong>typename</strong></span> TypeInfo = extensions::default_type_info>
+ <span class="bold"><strong>class</strong></span> basic_parameter_map;
+ <span class="bold"><strong>typedef</strong></span> basic_parameter_map parameter_map;
+ }
+}</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>
+<pre class="synopsis">
+
+BOOST_REFLECTION_MAX_FUNCTOR_PARAMS</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>
+<pre class="synopsis">
+
+BOOST_PP_ITERATION_LIMITS
+BOOST_PP_FILENAME_1</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>
+<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;
+ <span class="bold"><strong>namespace</strong></span> impl {
+ <span class="bold"><strong>typedef</strong></span> <span class="bold"><strong>void</strong></span> *instance::* <a name="boost.reflections.impl.MemberPtr"></a>MemberPtr;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Object, <span class="bold"><strong>typename</strong></span> Data>
+ <span class="type">Data &</span> <a name="boost.reflections.impl.get_data_from_ptr"></a>get_data_from_ptr(<span class="bold"><strong>void</strong></span> * inst, MemberPtr ptr);
+ }
+ }
+}</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>
+<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;
+ }
+}</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>
<pre class="synopsis">
-BOOST_EXTENSION_MAX_FUNCTOR_PARAMS</pre>
+BOOST_REFLECTION_CONSTRUCT_FUNCTION(Z, N, _)
+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 {
+ BOOST_REFLECTION_CONSTRUCTI_FUNCTION;
+ <span class="type"></span> <a name="boost.reflections.BOOST_PP_REPEAT"></a>BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_REFLECTION_MAX_FUNCTOR_PARAMS),
+ BOOST_REFLECTION_CONSTRUCT_FUNCTION, _);
+ }
+}</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>
+<pre class="synopsis">
+
+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 {
+ <span class="bold"><strong>typedef</strong></span> <span class="bold"><strong>void</strong></span>(instance::* <a name="boost.reflections.impl.MemberFunctionPtr"></a>MemberFunctionPtr;
+ }
+ }
+}</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><h3 class="title">
+<a name="header.boost.reflection.generic_constructor.hpp"></a>Header <boost/reflection/generic_constructor.hpp></h3></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;
+ }
+}</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>
+<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;
+ }
+}</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>
+<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;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> TypeInfo = extensions::default_type_info>
+ <span class="bold"><strong>class</strong></span> generic_parameter;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> TypeInfo = extensions::default_type_info>
+ <span class="bold"><strong>class</strong></span> parameter;
+ }
+}</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><h3 class="title">
+<a name="header.boost.reflection.reflection.hpp"></a>Header <boost/reflection/reflection.hpp></h3></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>,
+ <span class="bold"><strong>typename</strong></span> TypeInfo = extensions::default_type_info>
+ <span class="bold"><strong>class</strong></span> basic_reflection;
+
+ <span class="bold"><strong>typedef</strong></span> basic_reflection <a name="boost.reflections.reflection"></a>reflection;
+ }
+}</pre>
</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, 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>
@@ -53,7 +184,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="../BOOST_EXTENSION_MAX_FUNCTOR_PARAMS.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="../boost/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/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-19 22:35:01 EDT (Sat, 19 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="../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="prev" href="motivation.html" title=" Motivation">
+<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>
@@ -20,14 +20,24 @@
</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="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>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_extension.shared_libraries"></a> Shared Libraries</h2></div></div></div>
+<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">
+ Other Issues with Shared Libraries</a></span></dt>
+<dt><span class="section"><a href="shared_libraries.html#boost_extension.shared_libraries.shared_library_inefficiencies">
+ 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
+ class</a></span></dt>
+</dl></div>
<p>
- A <code class="computeroutput"><span class="identifier">shared_library</span></code> refers to
- a loadable module, the type of which depends on the platform:
+ A <code class="literal"><code class="computeroutput">shared_library</code></code>
+ refers to a loadable module, the type of which depends on the platform:
</p>
<div class="itemizedlist"><ul type="disc">
<li>
@@ -40,80 +50,136 @@
Mac OS X: .dylib or .bundle (See Appendix C)
</li>
</ul></div>
-<a name="boost_extension.shared_libraries._code__phrase_role__identifier__shared_library__phrase__phrase_role__special_____phrase__phrase_role__keyword__const__phrase___phrase_role__keyword__char__phrase___phrase_role__special_____phrase___phrase_role__identifier__location__phrase__phrase_role__special_____phrase___phrase_role__keyword__bool__phrase___phrase_role__identifier__auto_close__phrase___phrase_role__special_____phrase___phrase_role__keyword__false__phrase__phrase_role__special_____phrase___code_"></a><h4>
-<a name="id449093"></a>
- <a href="shared_libraries.html#boost_extension.shared_libraries._code__phrase_role__identifier__shared_library__phrase__phrase_role__special_____phrase__phrase_role__keyword__const__phrase___phrase_role__keyword__char__phrase___phrase_role__special_____phrase___phrase_role__identifier__location__phrase__phrase_role__special_____phrase___phrase_role__keyword__bool__phrase___phrase_role__identifier__auto_close__phrase___phrase_role__special_____phrase___phrase_role__keyword__false__phrase__phrase_role__special_____phrase___code_"><code class="computeroutput"><span class="identifier">shared_library</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">location</span><span class="special">,</span> <span class="keyword">bool</span> <span class="identifier">auto_close</span>
- <span class="special">=</span> <span class="keyword">false</span><span class="special">)</span></code></a>
- </h4>
-<p>
- <code class="computeroutput"><span class="identifier">location</span></code> is the relative path
- of the shared library to laod, and <code class="computeroutput"><span class="identifier">auto_close</span></code>
- sets whether or not the library will be automatically closed when the <code class="computeroutput"><span class="identifier">shared_library</span></code> is destroyed. This function
- does not open the library.
- </p>
-<a name="boost_extension.shared_libraries._code__phrase_role__keyword__bool__phrase___phrase_role__identifier__open__phrase__phrase_role__special______phrase___code_"></a><h4>
-<a name="id449221"></a>
- bool open()
- </h4>
<p>
- Returns true if the library is opened successfully.
+ Normally, shared libraries are loaded by an application when it starts. This
+ is commonly used by Boost libraries that can be built as shared libraries,
+ such as Boost.Thread or Boost.Filesystem.
</p>
-<a name="boost_extension.shared_libraries._code__phrase_role__keyword__bool__phrase___phrase_role__identifier__is_open__phrase__phrase_role__special______phrase___code_"></a><h4>
-<a name="id449276"></a>
- bool is_open()
- </h4>
<p>
- Returns true if the library is open.
+ Shared libraries can also be loaded at will, during program execution.
</p>
-<a name="boost_extension.shared_libraries._code__phrase_role__keyword__void__phrase___phrase_role__identifier__close__phrase__phrase_role__special______phrase___code_"></a><h4>
-<a name="id449331"></a>
- void close()
- </h4>
-<p>
- Close the library. Note that an OS specific shared library usually keeps a
- reference count, meaning that calling this function will just decrease the
- reference count. If the reference count drops to 0, the library will be ready
- to actually closed - though the platform is not required to actually close
- the library even then. As such, this function can sometimes give a performance
- boost, by freeing up RAM, but will often do nothing.
+<p>
+ Whenever a shared library is loaded, either at load time or later during a
+ program's execution, the function and variable locations in the library are
+ resolved.
</p>
-<a name="boost_extension.shared_libraries._code__phrase_role__identifier__returnvalue__phrase___phrase_role__special______phrase__phrase_role__identifier__get__phrase__phrase_role__special_____phrase__phrase_role__keyword__const__phrase___phrase_role__keyword__char__phrase___phrase_role__special_____phrase___phrase_role__identifier__name__phrase__phrase_role__special_______phrase__phrase_role__identifier__args__phrase__phrase_role__special_____phrase___code_"></a><h4>
-<a name="id449389"></a>
- <a href="shared_libraries.html#boost_extension.shared_libraries._code__phrase_role__identifier__returnvalue__phrase___phrase_role__special______phrase__phrase_role__identifier__get__phrase__phrase_role__special_____phrase__phrase_role__keyword__const__phrase___phrase_role__keyword__char__phrase___phrase_role__special_____phrase___phrase_role__identifier__name__phrase__phrase_role__special_______phrase__phrase_role__identifier__args__phrase__phrase_role__special_____phrase___code_"><code class="computeroutput"><span class="identifier">ReturnValue</span> <span class="special">(*</span><span class="identifier">get</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="identifier">ARGS</span><span class="special">)</span></code></a>
- </h4>
-<p>
- This function returns a pointer to a function in a dll with <code class="computeroutput"><span class="identifier">name</span></code>.
- Note that a C++ function needs to have <code class="computeroutput"><span class="keyword">extern</span>
- <span class="string">"C"</span></code> before it in order for
- this to work. To get a function like this:
-</p>
-<pre class="programlisting"><span class="keyword">extern</span> <span class="string">"C"</span>
-<span class="keyword">int</span> <span class="identifier">get_value</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="keyword">return</span> <span class="number">0</span><span class="special">;</span>
-<span class="special">}</span>
-</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_extension.shared_libraries.name_resolution"></a><a href="shared_libraries.html#boost_extension.shared_libraries.name_resolution" title=" Name
+ Resolution"> Name
+ Resolution</a></h3></div></div></div>
+<p>
+ A loaded shared library can be searched for functions or data. In C++, this
+ requires that the function be marked as follows:
+ </p>
+<p>
+ \code extern "C" void MyFunction() { // do stuff } \endcode
+ </p>
<p>
- You would call:
+ The reason for this is the name-mangling that C++ performs, to give different
+ names to, for instance, multiple overloads with the same function name.
+ </p>
+<p>
+ Because different compilers mangle names differently (and in ways that are
+ often undocumented), it would be very difficult to create a cross-platform
+ solution to avoid the use of extern "C" declarations. This is the
+ primary cause of the inherent lack of type-safety with calls in the <code class="literal"><code class="computeroutput">shared_library</code></code>
+ 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">mySharedLibrary</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">const</span> <span class="keyword">char</span> <span class="special">*>(</span><span class="string">"get_value"</span><span class="special">);</span>
+<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>
-<div class="note"><table border="0" summary="Note">
-<tr>
-<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../doc/html/images/note.png"></td>
-<th align="left">Note</th>
-</tr>
-<tr><td colspan="2" align="left" valign="top"><p>
- It is recommended that you use Boost.Function to capture the return values
- of <code class="computeroutput"><span class="identifier">get</span></code>, but not required.
- </p></td></tr>
-</table></div>
+ </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>
-<td align="right"><div class="copyright-footer">Copyright © 2008 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>
@@ -121,7 +187,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="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>
</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-19 22:35:01 EDT (Sat, 19 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="../index.html" title="Chapter 1. Boost.Extension">
-<link rel="prev" href="../index.html" title="Chapter 1. Boost.Extension">
-<link rel="next" href="tutorials/tutorial02.html" title=" Tutorial 2">
+<link rel="prev" href="factories.html" title=" Factories">
+<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>
@@ -20,17 +20,17 @@
</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/tutorial02.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="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.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"> 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">
@@ -174,6 +174,808 @@
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:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ There is a vehicle class
+ </li>
+<li>
+ There is a computer class
+ </li>
+<li>
+ A car is a vehicle
+ </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.
+ </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.
+ </p>
+<p>
+ To begin with, let's look at the Jamfile:
+ </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>
+</pre>
+<p>
+ </p>
+<p>
+ First we must rename the generated libraries (this is required for cross-platform
+ use - but the prefix and suffix are arbitrary).
+ </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.
+ </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>
+
+<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>
+</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.
+ </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.
+ </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>
+
+ <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>
+</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.
+ </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.
+ </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>
+<p>
+ </p>
+<p>
+ Please note the following details:
+ </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.
+ </li>
+<li>
+ When we call the create method we just supply the needed arguments and
+ just works!
+ </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).
+ </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>
+
+<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:
+ </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>
+<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:
+ </p>
+<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>
+<p>
+ </p>
+<p>
+ And the implementation for each of the defined plugins (protocols):
+ </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>
+
+ <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="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:
+ </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>
+
+ <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="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="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.
+ </p>
+</div>
<p>
There are currently five tutorials.
</p>
@@ -202,7 +1004,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 © 2008 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>
@@ -210,7 +1012,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/tutorial02.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="reference.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/libs/extension/doc/html/boost_extension/tutorials/tutorial02.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost_extension/tutorials/tutorial02.html (original)
+++ sandbox/libs/extension/doc/html/boost_extension/tutorials/tutorial02.html 2008-07-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -162,7 +162,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 © 2008 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>
Modified: sandbox/libs/extension/doc/html/boost_extension/tutorials/tutorial03.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost_extension/tutorials/tutorial03.html (original)
+++ sandbox/libs/extension/doc/html/boost_extension/tutorials/tutorial03.html 2008-07-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -173,7 +173,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 © 2008 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>
Modified: sandbox/libs/extension/doc/html/boost_extension/tutorials/tutorial04.html
==============================================================================
--- sandbox/libs/extension/doc/html/boost_extension/tutorials/tutorial04.html (original)
+++ sandbox/libs/extension/doc/html/boost_extension/tutorials/tutorial04.html 2008-07-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -258,7 +258,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 © 2008 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>
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-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -305,7 +305,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 © 2008 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>
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-19 22:35:01 EDT (Sat, 19 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/tutorials.html" title="Tutorials">
+<link rel="next" href="boost_extension/motivation.html" title=" Motivation">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -17,14 +17,17 @@
<td align="center">More</td>
</tr></table>
<hr>
-<div class="spirit-nav"><a accesskey="n" href="boost_extension/tutorials.html"><img src="../../doc/html/images/next.png" alt="Next"></a></div>
+<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="chapter" lang="en">
<div class="titlepage"><div>
<div><h2 class="title">
<a name="boost_extension"></a>Chapter 1. Boost.Extension</h2></div>
-<div><p class="copyright">Copyright © 2008 Jeremy Pack, Mariano G. Consoni</p></div>
+<div><div class="author"><h3 class="author">
+<span class="firstname">Jeremy</span> <span class="surname">Pack</span>
+</h3></div></div>
+<div><p class="copyright">Copyright © 2008 Jeremy Pack</p></div>
<div><div class="legalnotice">
-<a name="id435092"></a><p>
+<a name="id435100"></a><p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
@@ -34,26 +37,56 @@
<p><b>Table of Contents</b></p>
<dl>
<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">
+ 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">
+ 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
+ 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>
+<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"> Factories</span></dt>
-<dt><span class="section"> Shared Libraries</span></dt>
<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">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>
+</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>
@@ -62,7 +95,7 @@
<dd><dl>
<dt><span class="section"><a href="boost_extension/appendices.html#boost_extension.appendices.appendix_a"> Appendix A -
Windows Export and Import Declarations</a></span></dt>
-<dt><span class="section"><a href="boost_extension/appendices/appendix_b.html"> Appendix B -
+<dt><span class="section"><a href="boost_extension/appendices.html#boost_extension.appendices.appendix_b"> Appendix B -
Optional Dependencies</a></span></dt>
</dl></dd>
</dl>
@@ -108,6 +141,6 @@
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
-<div class="spirit-nav"><a accesskey="n" href="boost_extension/tutorials.html"><img src="../../doc/html/images/next.png" alt="Next"></a></div>
+<div class="spirit-nav"><a accesskey="n" href="boost_extension/motivation.html"><img src="../../doc/html/images/next.png" alt="Next"></a></div>
</body>
</html>
Added: sandbox/libs/extension/doc/motivation.qbk
==============================================================================
--- (empty file)
+++ sandbox/libs/extension/doc/motivation.qbk 2008-07-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -0,0 +1,42 @@
+[/ Boost.Extension - Original Motivation ]
+[/ 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:motivation Motivation]
+
+The original motivation for Boost.Extension was a moving-object-tracking application.
+This application was to be used for both real-time and post-processing analysis
+of a series of images. The types of cameras used for tracking were anything from
+low-speed, low-resolution IR cameras, to medium-speed color camcorders to high-speed,
+multi-spectral IR cameras.
+
+Each client or potential client of the application had different input types, and
+different types of data they needed at the end. There were, in general, the following
+major problems:
+
+* Some clients had proprietary image formats that needed to be input, or proprietary
+algorithms they wished to use for the data. We could not give these algorithms to
+other clients.
+* Clients wanted to be able to adapt the software to work with new requirements,
+such as a new camera type, in the future. To do this, one client in particular
+wanted full ownership of the source code.
+* Our code had become very entangled, and our application had become a mess of
+menus covering the various bits of functionality.
+
+Initially, we just delivered different builds to each customer. This was tedious,
+and only solved the first problem.
+
+For this reason, work was begun on using shared libraries which would each contain
+a related set of modules. Each customer would be given two sets of files:
+
+* Shared libraries for their specific data types, UI needs, algorithms, etc.
+* An SDK to develop plugins in the future to handle any new requirements for
+the software.
+
+Boost.Extension is designed to make this type of solution simple, portable,
+and easily extensible.
+
+[endsect]
\ No newline at end of file
Modified: sandbox/libs/extension/doc/shared_libraries.qbk
==============================================================================
--- sandbox/libs/extension/doc/shared_libraries.qbk (original)
+++ sandbox/libs/extension/doc/shared_libraries.qbk 2008-07-19 22:35:01 EDT (Sat, 19 Jul 2008)
@@ -7,49 +7,91 @@
[section:shared_libraries Shared Libraries]
-A `shared_library` refers to a loadable module, the type of which depends
+A _shared_library_ refers to a loadable module, the type of which depends
on the platform:
* Windows: .dll
* Most Linux or Unix: .so
* Mac OS X: .dylib or .bundle (See [link appendix_c Appendix C])
+Normally, shared libraries are loaded by an application when it starts.
+This is commonly used by Boost libraries that can be built as shared libraries,
+such as Boost.Thread or Boost.Filesystem.
-[h4 `shared_library(const char * location, bool auto_close = false)`]
-`location` is the relative path of the shared library to laod, and
-`auto_close` sets whether or not the library will be automatically
-closed when the `shared_library` is destroyed. This function does
-not open the library.
-
-[h4 `bool open()`]
-Returns true if the library is opened successfully.
-
-[h4 `bool is_open()`]
-Returns true if the library is open.
-
-[h4 `void close()`]
-Close the library. Note that an OS specific shared library usually keeps a
-reference count, meaning that calling this function will just decrease the
-reference count. If the reference count drops to 0, the library will be
-ready to actually closed - though the platform is not required to actually
-close the library even then. As such, this function can sometimes give a
-performance boost, by freeing up RAM, but will often do nothing.
-[h4 `ReturnValue (*get(const char * name))(ARGS)`]
-This function returns a pointer to a function in a dll with `name`. Note
-that a C++ function needs to have `extern "C"` before it in order for this
-to work. To get a function like this:
-``
-extern "C"
-int get_value(const char * name) {
- return 0;
+Shared libraries can also be loaded at will, during program execution.
+
+Whenever a shared library is loaded, either at load time or later during
+a program's execution, the function and variable locations in the library
+are resolved.
+
+[section:name_resolution Name Resolution]
+
+A loaded shared library can be searched for functions or data. In C++,
+this requires that the function be marked as follows:
+
+\code extern "C" void MyFunction() {
+ // do stuff
}
-``
-You would call:
-``
-mySharedLibrary.get<int, const char *>("get_value");
-``
-[note
-It is recommended that you use Boost.Function to capture the return values
-of `get`, but not required.]
+\endcode
+
+The reason for this is the name-mangling that C++ performs, to give
+different names to, for instance, multiple overloads with the same
+function name.
+
+Because different compilers mangle names differently (and in ways
+that are often undocumented), it would be very difficult to create
+a cross-platform solution to avoid the use of extern "C" declarations.
+This is the primary cause of the inherent lack of type-safety with
+calls in the _shared_library_ class.
+
+[endsect]
+
+[section:shared_library_issues Other Issues with Shared Libraries]
+
+* Separate symbol tables are required in each shared library.
+* RTTI merging: Some compilers do it. Some don't.
+* Optimizations are harder because the code must be position
+independent.
+* The following may break binary compatibility between an application and
+a shared library (among other things):
+ * Any part of shared class changes. Variable ordering, public/private/
+protected, virtual function implementations, add/remove variables/
+functions etc.
+ * Different compiler or compiler options used, or headers included
+differently.
+
+[endsect]
+
+[section:shared_library_inefficiencies Possible Inefficiencies in Shared Libraries]
+
+* Position Independent Code:
+ * 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.
+ * They can take a really long time to load.
+ * OS's attempt to mitigate this in various ways.
+* Extra levels of indirection in non-virtual function calls.
+ * No inlining across library boundaries.
+
+[endsect]
+
+[section shared_library class]
+
+Provides for automatic loading of named modules, and retrieval of functions
+in those modules:
+
+```
+shared_library m("my_module_name");
+// Call a function that returns an int and takes a float parameter.
+int result = m.get<int, float>("function_name")(5.0f);
+m.close();
+```
+
+The `get()` function returns a function
+pointer that can be wrapped in Boost.Function objects or used by itself.
+
+Reference: _shared_library_
+
+[endsect]
[endsect]
\ No newline at end of file
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk