diff options
Diffstat (limited to 'doc/html/signals2/rationale.html')
-rw-r--r-- | doc/html/signals2/rationale.html | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/doc/html/signals2/rationale.html b/doc/html/signals2/rationale.html index 8b061bc956..4b283787d5 100644 --- a/doc/html/signals2/rationale.html +++ b/doc/html/signals2/rationale.html @@ -4,9 +4,9 @@ <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>Design Rationale</title> <link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css"> -<meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> +<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> <link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> -<link rel="up" href="../signals2.html" title="Chapter 30. Boost.Signals2"> +<link rel="up" href="../signals2.html" title="Chapter 33. Boost.Signals2"> <link rel="prev" href="faq.html" title="Frequently Asked Questions"> <link rel="next" href="api_changes.html" title="Signals2 API Changes"> </head> @@ -26,18 +26,18 @@ <div class="section"> <div class="titlepage"><div><div><h2 class="title" style="clear: both"> <a name="signals2.rationale"></a>Design Rationale</h2></div></div></div> -<div class="toc"><dl> -<dt><span class="section"><a href="rationale.html#idp397957936">User-level Connection Management</a></span></dt> -<dt><span class="section"><a href="rationale.html#idp397976576">Automatic Connection Management</a></span></dt> -<dt><span class="section"><a href="rationale.html#idp397993696"><code class="computeroutput">optional_last_value</code> as the Default Combiner</a></span></dt> -<dt><span class="section"><a href="rationale.html#idp398000240">Combiner Interface</a></span></dt> -<dt><span class="section"><a href="rationale.html#idp398015312">Connection Interfaces: += operator</a></span></dt> -<dt><span class="section"><a href="rationale.html#idp398034688">Signals2 Mutex Classes</a></span></dt> -<dt><span class="section"><a href="rationale.html#idp398045168">Comparison with other Signal/Slot implementations</a></span></dt> +<div class="toc"><dl class="toc"> +<dt><span class="section"><a href="rationale.html#idm45927781415552">User-level Connection Management</a></span></dt> +<dt><span class="section"><a href="rationale.html#idm45927781396912">Automatic Connection Management</a></span></dt> +<dt><span class="section"><a href="rationale.html#idm45927781379792"><code class="computeroutput">optional_last_value</code> as the Default Combiner</a></span></dt> +<dt><span class="section"><a href="rationale.html#idm45927781373248">Combiner Interface</a></span></dt> +<dt><span class="section"><a href="rationale.html#idm45927781357248">Connection Interfaces: += operator</a></span></dt> +<dt><span class="section"><a href="rationale.html#idm45927781337872">Signals2 Mutex Classes</a></span></dt> +<dt><span class="section"><a href="rationale.html#idm45927781327392">Comparison with other Signal/Slot implementations</a></span></dt> </dl></div> <div class="section"> <div class="titlepage"><div><div><h3 class="title"> -<a name="idp397957936"></a>User-level Connection Management</h3></div></div></div> +<a name="idm45927781415552"></a>User-level Connection Management</h3></div></div></div> <p> Users need to have fine control over the connection of signals to slots and their eventual disconnection. The primary approach taken by Boost.Signals2 is to return a @@ -45,14 +45,14 @@ connected/disconnected query, manual disconnection, and an automatic disconnection on destruction mode (<code class="computeroutput"><a class="link" href="../boost/signals2/scoped_connection.html" title="Class scoped_connection">signals2::scoped_connection</a></code>). In addition, two other interfaces are supported by the - <code class="computeroutput"><a class="link" href="../boost/signals2/signal.html#idp64426752-bb">signal::disconnect</a></code> overloaded method:</p> -<div class="itemizedlist"><ul class="itemizedlist" type="disc"> + <code class="computeroutput"><a class="link" href="../boost/signals2/signal.html#idm46563209009120-bb">signal::disconnect</a></code> overloaded method:</p> +<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"><p><span class="bold"><strong>Pass slot to disconnect</strong></span>: in this interface model, the disconnection of a slot connected with - <code class="computeroutput">sig.<a class="link" href="../boost/signals2/signal.html#idp134764096-bb">connect</a>(typeof(sig)::slot_type(slot_func))</code> is + <code class="computeroutput">sig.<a class="link" href="../boost/signals2/signal.html#idm46563209038672-bb">connect</a>(typeof(sig)::slot_type(slot_func))</code> is performed via - <code class="computeroutput">sig.<a class="link" href="../boost/signals2/signal.html#idp64426752-bb">disconnect</a>(slot_func)</code>. Internally, + <code class="computeroutput">sig.<a class="link" href="../boost/signals2/signal.html#idm46563209009120-bb">disconnect</a>(slot_func)</code>. Internally, a linear search using slot comparison is performed and the slot, if found, is removed from the list. Unfortunately, querying connectedness ends up as a @@ -64,7 +64,7 @@ slots to be arbitrary function objects. While this approach is essentially equivalent to the connection approach taken by Boost.Signals2, it is possibly more error-prone for several reasons:</p> -<div class="itemizedlist"><ul class="itemizedlist" type="circle"> +<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "> <li class="listitem"><p>Connections and disconnections must be paired, so the problem becomes similar to the problems incurred when pairing <code class="computeroutput">new</code> and <code class="computeroutput">delete</code> for @@ -80,14 +80,14 @@ </ul></div> <p> This type of interface is supported in Boost.Signals2 via the slot grouping mechanism, and the overload of - <code class="computeroutput"><a class="link" href="../boost/signals2/signal.html#idp64426752-bb">signal::disconnect</a></code> + <code class="computeroutput"><a class="link" href="../boost/signals2/signal.html#idm46563209009120-bb">signal::disconnect</a></code> which takes an argument of the signal's <code class="computeroutput">Group</code> type.</p> </li> </ul></div> </div> <div class="section"> <div class="titlepage"><div><div><h3 class="title"> -<a name="idp397976576"></a>Automatic Connection Management</h3></div></div></div> +<a name="idm45927781396912"></a>Automatic Connection Management</h3></div></div></div> <p>Automatic connection management in Signals2 depends on the use of <code class="computeroutput">boost::shared_ptr</code> to manage the lifetimes of tracked objects. This is differs from @@ -129,7 +129,7 @@ </div> <div class="section"> <div class="titlepage"><div><div><h3 class="title"> -<a name="idp397993696"></a><code class="computeroutput">optional_last_value</code> as the Default Combiner</h3></div></div></div> +<a name="idm45927781379792"></a><code class="computeroutput">optional_last_value</code> as the Default Combiner</h3></div></div></div> <p> The default combiner for Boost.Signals2 has changed from the <code class="computeroutput">last_value</code> combiner used by default in the original Boost.Signals library. @@ -145,7 +145,7 @@ </div> <div class="section"> <div class="titlepage"><div><div><h3 class="title"> -<a name="idp398000240"></a>Combiner Interface</h3></div></div></div> +<a name="idm45927781373248"></a>Combiner Interface</h3></div></div></div> <p> The Combiner interface was chosen to mimic a call to an algorithm in the C++ standard library. It is felt that by viewing slot call results as merely a sequence of values accessed by input @@ -273,14 +273,14 @@ private: </div> <div class="section"> <div class="titlepage"><div><div><h3 class="title"> -<a name="idp398015312"></a>Connection Interfaces: += operator</h3></div></div></div> +<a name="idm45927781357248"></a>Connection Interfaces: += operator</h3></div></div></div> <p> Boost.Signals2 supports a connection syntax with the form - <code class="computeroutput">sig.<a class="link" href="../boost/signals2/signal.html#idp134764096-bb">connect</a>(slot)</code>, but a + <code class="computeroutput">sig.<a class="link" href="../boost/signals2/signal.html#idm46563209038672-bb">connect</a>(slot)</code>, but a more terse syntax <code class="computeroutput">sig += slot</code> has been suggested (and has been used by other signals & slots implementations). There are several reasons as to why this syntax has been rejected:</p> -<div class="itemizedlist"><ul class="itemizedlist" type="disc"> +<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"><p><span class="bold"><strong>It's unnecessary</strong></span>: the connection syntax supplied by Boost.Signals2 is no less powerful that that supplied by the <code class="computeroutput">+=</code> @@ -313,7 +313,7 @@ private: </div> <div class="section"> <div class="titlepage"><div><div><h3 class="title"> -<a name="idp398034688"></a>Signals2 Mutex Classes</h3></div></div></div> +<a name="idm45927781337872"></a>Signals2 Mutex Classes</h3></div></div></div> <p> The Boost.Signals2 library provides 2 mutex classes: <code class="computeroutput"><a class="link" href="../boost/signals2/mutex.html" title="Class mutex">boost::signals2::mutex</a></code>, and <code class="computeroutput"><a class="link" href="../boost/signals2/dummy_mutex.html" title="Class dummy_mutex">boost::signals2::dummy_mutex</a></code>. The motivation for providing @@ -331,14 +331,14 @@ private: </div> <div class="section"> <div class="titlepage"><div><div><h3 class="title"> -<a name="idp398045168"></a>Comparison with other Signal/Slot implementations</h3></div></div></div> -<div class="toc"><dl> -<dt><span class="section"><a href="rationale.html#idp398045872">libsigc++</a></span></dt> -<dt><span class="section"><a href="rationale.html#idp398052992">.NET delegates</a></span></dt> +<a name="idm45927781327392"></a>Comparison with other Signal/Slot implementations</h3></div></div></div> +<div class="toc"><dl class="toc"> +<dt><span class="section"><a href="rationale.html#idm45927781326688">libsigc++</a></span></dt> +<dt><span class="section"><a href="rationale.html#idm45927781319568">.NET delegates</a></span></dt> </dl></div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> -<a name="idp398045872"></a>libsigc++</h4></div></div></div> +<a name="idm45927781326688"></a>libsigc++</h4></div></div></div> <p> <a href="http://libsigc.sourceforge.net" target="_top">libsigc++</a> is a C++ signals & slots library that originally started as part of an initiative to wrap the C interfaces to <a href="http://www.gtk.org" target="_top">GTK</a> libraries in C++, and has @@ -350,7 +350,7 @@ private: connections. There are some major differences in design that separate these libraries:</p> -<div class="itemizedlist"><ul class="itemizedlist" type="disc"> +<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"><p><span class="bold"><strong>Slot definitions</strong></span>: slots in libsigc++ are created using a set of primitives defined by the library. These primitives allow binding of @@ -368,14 +368,14 @@ private: </div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> -<a name="idp398052992"></a>.NET delegates</h4></div></div></div> +<a name="idm45927781319568"></a>.NET delegates</h4></div></div></div> <p> <a href="http://www.microsoft.com" target="_top">Microsoft</a> has introduced the .NET Framework and an associated set of languages and language extensions, one of which is the delegate. Delegates are similar to signals and slots, but they are more limited than most C++ signals and slots implementations in that they:</p> -<div class="itemizedlist"><ul class="itemizedlist" type="disc"> +<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"><p>Require exact type matches between a delegate and what it is calling.</p></li> <li class="listitem"><p>Only return the result of the last target called, with no option for customization.</p></li> |