diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-06 10:38:45 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-06 10:39:52 +0900 |
commit | 5cde13f21d36c7224b0e13d11c4b49379ae5210d (patch) | |
tree | e8269ac85a4b0f7d416e2565fa4f451b5cb41351 /doc/html/signals/tutorial.html | |
parent | d9ec475d945d3035377a0d89ed42e382d8988891 (diff) | |
download | boost-5cde13f21d36c7224b0e13d11c4b49379ae5210d.tar.gz boost-5cde13f21d36c7224b0e13d11c4b49379ae5210d.tar.bz2 boost-5cde13f21d36c7224b0e13d11c4b49379ae5210d.zip |
Imported Upstream version 1.61.0
Change-Id: I96a1f878d1e6164f01e9aadd5147f38fca448d90
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'doc/html/signals/tutorial.html')
-rw-r--r-- | doc/html/signals/tutorial.html | 194 |
1 files changed, 97 insertions, 97 deletions
diff --git a/doc/html/signals/tutorial.html b/doc/html/signals/tutorial.html index 52b1ec065f..841ee255b7 100644 --- a/doc/html/signals/tutorial.html +++ b/doc/html/signals/tutorial.html @@ -4,10 +4,10 @@ <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>Tutorial</title> <link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css"> -<meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> +<meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> <link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> -<link rel="up" href="../signals.html" title="Chapter 27. Boost.Signals"> -<link rel="prev" href="../signals.html" title="Chapter 27. Boost.Signals"> +<link rel="up" href="../signals.html" title="Chapter 29. Boost.Signals"> +<link rel="prev" href="../signals.html" title="Chapter 29. Boost.Signals"> <link rel="next" href="reference.html" title="Reference"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> @@ -26,19 +26,19 @@ <div class="section"> <div class="titlepage"><div><div><h2 class="title" style="clear: both"> <a name="signals.tutorial"></a>Tutorial</h2></div></div></div> -<div class="toc"><dl class="toc"> -<dt><span class="section"><a href="tutorial.html#idm45555134312752">How to Read this Tutorial</a></span></dt> -<dt><span class="section"><a href="tutorial.html#idm45555134305968">Compatibility Note</a></span></dt> -<dt><span class="section"><a href="tutorial.html#idm45555134291648">Hello, World! (Beginner)</a></span></dt> -<dt><span class="section"><a href="tutorial.html#idm45555134274544">Calling multiple slots</a></span></dt> -<dt><span class="section"><a href="tutorial.html#idm45555134227728">Passing values to and from slots</a></span></dt> -<dt><span class="section"><a href="tutorial.html#idm45555134120848">Connection Management</a></span></dt> -<dt><span class="section"><a href="tutorial.html#idm45555134033856">Example: Document-View</a></span></dt> -<dt><span class="section"><a href="tutorial.html#idm45555134018672">Linking against the Signals library</a></span></dt> +<div class="toc"><dl> +<dt><span class="section"><a href="tutorial.html#idp392922160">How to Read this Tutorial</a></span></dt> +<dt><span class="section"><a href="tutorial.html#idp392928944">Compatibility Note</a></span></dt> +<dt><span class="section"><a href="tutorial.html#idp392942624">Hello, World! (Beginner)</a></span></dt> +<dt><span class="section"><a href="tutorial.html#idp392959856">Calling multiple slots</a></span></dt> +<dt><span class="section"><a href="tutorial.html#idp393006672">Passing values to and from slots</a></span></dt> +<dt><span class="section"><a href="tutorial.html#idp393113552">Connection Management</a></span></dt> +<dt><span class="section"><a href="tutorial.html#idp393200736">Example: Document-View</a></span></dt> +<dt><span class="section"><a href="tutorial.html#idp393215920">Linking against the Signals library</a></span></dt> </dl></div> <div class="section"> <div class="titlepage"><div><div><h3 class="title"> -<a name="idm45555134312752"></a>How to Read this Tutorial</h3></div></div></div> +<a name="idp392922160"></a>How to Read this Tutorial</h3></div></div></div> <p>This tutorial is not meant to be read linearly. Its top-level structure roughly separates different concepts in the library (e.g., handling calling multiple slots, passing values to and from @@ -58,7 +58,7 @@ will not need to read the <span class="emphasis"><em>Advanced</em></span> sectio </div> <div class="section"> <div class="titlepage"><div><div><h3 class="title"> -<a name="idm45555134305968"></a>Compatibility Note</h3></div></div></div> +<a name="idp392928944"></a>Compatibility Note</h3></div></div></div> <p>Boost.Signals has two syntactical forms: the preferred form and the compatibility form. The preferred form fits more closely with the C++ language and reduces the number of separate template parameters @@ -83,7 +83,7 @@ we can keep this table up-to-date.</p> </tr></thead> <tbody><tr> <td align="left"> - <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> + <div class="itemizedlist"><ul class="itemizedlist" type="disc"> <li class="listitem"><p>GNU C++ 2.95.x, 3.0.x, 3.1.x</p></li> <li class="listitem"><p>Comeau C++ 4.2.45.2</p></li> <li class="listitem"><p>SGI MIPSpro 7.3.0</p></li> @@ -93,7 +93,7 @@ we can keep this table up-to-date.</p> </ul></div> </td> <td align="left"> - <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> + <div class="itemizedlist"><ul class="itemizedlist" type="disc"> <li class="listitem"><p><span class="emphasis"><em>Any compiler supporting the preferred syntax</em></span></p></li> <li class="listitem"><p>Microsoft Visual C++ 6.0, 7.0</p></li> <li class="listitem"><p>Borland C++ 5.5.1</p></li> @@ -106,7 +106,7 @@ we can keep this table up-to-date.</p> </div> <div class="section"> <div class="titlepage"><div><div><h3 class="title"> -<a name="idm45555134291648"></a>Hello, World! (Beginner)</h3></div></div></div> +<a name="idp392942624"></a>Hello, World! (Beginner)</h3></div></div></div> <p>The following example writes "Hello, World!" using signals and slots. First, we create a signal <code class="computeroutput">sig</code>, a signal that takes no arguments and has a void return value. Next, we connect @@ -142,7 +142,7 @@ struct HelloWorld // Connect a HelloWorld slot HelloWorld hello; -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(hello); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(hello); // Call all of the slots sig(); @@ -165,7 +165,7 @@ struct HelloWorld // Connect a HelloWorld slot HelloWorld hello; -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(hello); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(hello); // Call all of the slots sig(); @@ -176,14 +176,14 @@ sig(); </div> <div class="section"> <div class="titlepage"><div><div><h3 class="title"> -<a name="idm45555134274544"></a>Calling multiple slots</h3></div></div></div> -<div class="toc"><dl class="toc"> -<dt><span class="section"><a href="tutorial.html#idm45555134274000">Connecting multiple slots (Beginner)</a></span></dt> -<dt><span class="section"><a href="tutorial.html#idm45555134252736">Ordering slot call groups (Intermediate)</a></span></dt> +<a name="idp392959856"></a>Calling multiple slots</h3></div></div></div> +<div class="toc"><dl> +<dt><span class="section"><a href="tutorial.html#idp392960400">Connecting multiple slots (Beginner)</a></span></dt> +<dt><span class="section"><a href="tutorial.html#idp392981664">Ordering slot call groups (Intermediate)</a></span></dt> </dl></div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> -<a name="idm45555134274000"></a>Connecting multiple slots (Beginner)</h4></div></div></div> +<a name="idp392960400"></a>Connecting multiple slots (Beginner)</h4></div></div></div> <p>Calling a single slot from a signal isn't very interesting, so we can make the Hello, World program more interesting by splitting the work of printing "Hello, World!" into two completely separate @@ -228,8 +228,8 @@ signal, and when we call the signal both slots will be called.</p> <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"> <code class="computeroutput"><a class="link" href="../boost/signal.html" title="Class template signal">boost::signal</a></code><void ()> sig; -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(Hello()); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(World()); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(Hello()); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(World()); sig(); </pre> @@ -238,8 +238,8 @@ sig(); <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"> <code class="computeroutput"><a class="link" href="../boost/signalN.html" title="Class template signalN">boost::signal0</a></code><void> sig; -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(Hello()); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(World()); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(Hello()); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(World()); sig(); </pre> @@ -254,7 +254,7 @@ Hello, World! </div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> -<a name="idm45555134252736"></a>Ordering slot call groups (Intermediate)</h4></div></div></div> +<a name="idp392981664"></a>Ordering slot call groups (Intermediate)</h4></div></div></div> <p>Slots are free to have side effects, and that can mean that some slots will have to be called before others even if they are not connected in that order. The Boost.Signals library allows slots to be placed into groups that are ordered in @@ -278,16 +278,16 @@ are, by default, <code class="computeroutput">int</code>s, and are ordered by th <td align="left"> <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"> <code class="computeroutput"><a class="link" href="../boost/signal.html" title="Class template signal">boost::signal</a></code><void ()> sig; -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(1, World()); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(0, Hello()); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(1, World()); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(0, Hello()); sig(); </pre> </td> <td align="left"> <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"> <code class="computeroutput"><a class="link" href="../boost/signalN.html" title="Class template signalN">boost::signal0</a></code><void> sig; -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(1, World()); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(0, Hello()); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(1, World()); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(0, Hello()); sig(); </pre> </td> @@ -303,7 +303,7 @@ group parameter and those that don't? The "unnamed" slots (i.e., those that have been connected without specifying a group name) can be placed at the front or back of the slot list (by passing <code class="computeroutput">boost::signals::at_front</code> or <code class="computeroutput">boost::signals::at_back</code> -as the last parameter to <code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>, respectively), and defaults to the end of the list. When +as the last parameter to <code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>, respectively), and defaults to the end of the list. When a group is specified, the final parameter describes where the slot will be placed within the group ordering. If we add a new slot to our example like this:</p> @@ -316,7 +316,7 @@ struct GoodMorning } }; -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(GoodMorning()); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(GoodMorning()); </pre> <p>... we will get the result we wanted:</p> <pre class="programlisting"> @@ -327,14 +327,14 @@ Hello, World! </div> <div class="section"> <div class="titlepage"><div><div><h3 class="title"> -<a name="idm45555134227728"></a>Passing values to and from slots</h3></div></div></div> -<div class="toc"><dl class="toc"> -<dt><span class="section"><a href="tutorial.html#idm45555134227168">Slot Arguments (Beginner)</a></span></dt> -<dt><span class="section"><a href="tutorial.html#idm45555134197888">Signal Return Values (Advanced)</a></span></dt> +<a name="idp393006672"></a>Passing values to and from slots</h3></div></div></div> +<div class="toc"><dl> +<dt><span class="section"><a href="tutorial.html#idp393007232">Slot Arguments (Beginner)</a></span></dt> +<dt><span class="section"><a href="tutorial.html#idp393036512">Signal Return Values (Advanced)</a></span></dt> </dl></div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> -<a name="idm45555134227168"></a>Slot Arguments (Beginner)</h4></div></div></div> +<a name="idp393007232"></a>Slot Arguments (Beginner)</h4></div></div></div> <p>Signals can propagate arguments to each of the slots they call. For instance, a signal that propagates mouse motion events might want to pass along the new mouse coordinates and whether the mouse @@ -378,10 +378,10 @@ void print_quotient(float x, float y) <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"> <code class="computeroutput"><a class="link" href="../boost/signal.html" title="Class template signal">boost::signal</a></code><void (float, float)> sig; -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&print_sum); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&print_product); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&print_difference); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&print_quotient); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&print_sum); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&print_product); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&print_difference); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&print_quotient); sig(5, 3); </pre> @@ -390,10 +390,10 @@ sig(5, 3); <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"> <code class="computeroutput"><a class="link" href="../boost/signalN.html" title="Class template signalN">boost::signal2</a></code><void, float, float> sig; -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&print_sum); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&print_product); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&print_difference); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&print_quotient); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&print_sum); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&print_product); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&print_difference); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&print_quotient); sig(5, 3); </pre> @@ -418,7 +418,7 @@ connected to <code class="computeroutput">sig</code> must therefore be able to t </div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> -<a name="idm45555134197888"></a>Signal Return Values (Advanced)</h4></div></div></div> +<a name="idp393036512"></a>Signal Return Values (Advanced)</h4></div></div></div> <p>Just as slots can receive arguments, they can also return values. These values can then be returned back to the caller of the signal through a <em class="firstterm">combiner</em>. The combiner is a mechanism @@ -452,10 +452,10 @@ float difference(float x, float y) { return x-y; } <code class="computeroutput"><a class="link" href="../boost/signal.html" title="Class template signal">boost::signal</a></code><float (float x, float y)> sig; -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&product); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&quotient); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&sum); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&difference); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&product); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&quotient); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&sum); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&difference); std::cout << sig(5, 3) << std::endl; </pre> @@ -469,10 +469,10 @@ float difference(float x, float y) { return x-y; } <code class="computeroutput"><a class="link" href="../boost/signalN.html" title="Class template signalN">boost::signal2</a></code><float, float, float> sig; -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&product); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&quotient); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&sum); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&difference); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&product); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&quotient); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&sum); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&difference); std::cout << sig(5, 3) << std::endl; </pre> @@ -554,10 +554,10 @@ follows the signal's calling signature:</p> <p>Now we can connect slots that perform arithmetic functions and use the signal:</p> <pre class="programlisting"> -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&quotient); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&product); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&sum); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&difference); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&quotient); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&product); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&sum); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&difference); std::cout << sig(5, 3) << std::endl; </pre> @@ -599,10 +599,10 @@ Again, we can create a signal with this new combiner: <code class="computeroutput"><a class="link" href="../boost/signal.html" title="Class template signal">boost::signal</a></code><float (float, float), aggregate_values<std::vector<float> > > sig; -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&quotient); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&product); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&sum); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&difference); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&quotient); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&product); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&sum); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&difference); std::vector<float> results = sig(5, 3); std::copy(results.begin(), results.end(), @@ -614,10 +614,10 @@ std::copy(results.begin(), results.end(), <code class="computeroutput"><a class="link" href="../boost/signalN.html" title="Class template signalN">boost::signal2</a></code><float, float, float, aggregate_values<std::vector<float> > > sig; -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&quotient); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&product); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&sum); -sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(&difference); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&quotient); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&product); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&sum); +sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(&difference); std::vector<float> results = sig(5, 3); std::copy(results.begin(), results.end(), @@ -668,19 +668,19 @@ struct DistributeRequest { </div> <div class="section"> <div class="titlepage"><div><div><h3 class="title"> -<a name="idm45555134120848"></a>Connection Management</h3></div></div></div> -<div class="toc"><dl class="toc"> -<dt><span class="section"><a href="tutorial.html#idm45555134120304">Disconnecting Slots (Beginner)</a></span></dt> -<dt><span class="section"><a href="tutorial.html#idm45555134106288">Blocking Slots (Beginner)</a></span></dt> -<dt><span class="section"><a href="tutorial.html#idm45555134097200">Scoped connections (Intermediate)</a></span></dt> -<dt><span class="section"><a href="tutorial.html#idm45555134091600">Disconnecting equivalent slots (Intermediate)</a></span></dt> -<dt><span class="section"><a href="tutorial.html#idm45555134082128">Automatic connection management (Intermediate)</a></span></dt> -<dt><span class="section"><a href="tutorial.html#idm45555134058512">When can disconnections occur? (Intermediate)</a></span></dt> -<dt><span class="section"><a href="tutorial.html#idm45555134051024">Passing slots (Intermediate)</a></span></dt> +<a name="idp393113552"></a>Connection Management</h3></div></div></div> +<div class="toc"><dl> +<dt><span class="section"><a href="tutorial.html#idp393114096">Disconnecting Slots (Beginner)</a></span></dt> +<dt><span class="section"><a href="tutorial.html#idp393128304">Blocking Slots (Beginner)</a></span></dt> +<dt><span class="section"><a href="tutorial.html#idp393137392">Scoped connections (Intermediate)</a></span></dt> +<dt><span class="section"><a href="tutorial.html#idp393142992">Disconnecting equivalent slots (Intermediate)</a></span></dt> +<dt><span class="section"><a href="tutorial.html#idp393152464">Automatic connection management (Intermediate)</a></span></dt> +<dt><span class="section"><a href="tutorial.html#idp393176080">When can disconnections occur? (Intermediate)</a></span></dt> +<dt><span class="section"><a href="tutorial.html#idp393183568">Passing slots (Intermediate)</a></span></dt> </dl></div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> -<a name="idm45555134120304"></a>Disconnecting Slots (Beginner)</h4></div></div></div> +<a name="idp393114096"></a>Disconnecting Slots (Beginner)</h4></div></div></div> <p>Slots aren't expected to exist indefinately after they are connected. Often slots are only used to receive a few events and are then disconnected, and the programmer needs control to decide @@ -689,14 +689,14 @@ when a slot should no longer be connected.</p> <code class="computeroutput"><a class="link" href="../boost/signals/connection.html" title="Class connection">boost::signals::connection</a></code> class. The <code class="computeroutput"><a class="link" href="../boost/signals/connection.html" title="Class connection">connection</a></code> class uniquely represents the connection between a particular signal and a particular slot. The -<code class="computeroutput"><a class="link" href="../boost/signals/connection.html#idm45507041122416-bb">connected</a>()</code> method checks if the signal and slot are -still connected, and the <code class="computeroutput"><a class="link" href="../boost/signals/connection.html#idm45507165903616-bb">disconnect()</a></code> method +<code class="computeroutput"><a class="link" href="../boost/signals/connection.html#idp133401984-bb">connected</a>()</code> method checks if the signal and slot are +still connected, and the <code class="computeroutput"><a class="link" href="../boost/signals/connection.html#idp202559024-bb">disconnect()</a></code> method disconnects the signal and slot if they are connected before it is called. Each call to the signal's <code class="computeroutput">connect()</code> method returns a connection object, which can be used to determine if the connection still exists or to disconnect the signal and slot.</p> <pre class="programlisting"> -boost::signals::connection c = sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(HelloWorld()); +boost::signals::connection c = sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(HelloWorld()); if (c.<code class="computeroutput">connected</code>()) { <span class="emphasis"><em>// c is still connected to the signal</em></span> sig(); <span class="emphasis"><em>// Prints "Hello, World!"</em></span> @@ -710,7 +710,7 @@ sig(); <span class="emphasis"><em>// Does nothing: there are no connected slots< </div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> -<a name="idm45555134106288"></a>Blocking Slots (Beginner)</h4></div></div></div> +<a name="idp393128304"></a>Blocking Slots (Beginner)</h4></div></div></div> <p>Slots can be temporarily "blocked", meaning that they will be ignored when the signal is invoked but have not been disconnected. The <code class="computeroutput">block</code> member function @@ -718,7 +718,7 @@ temporarily blocks a slot, which can be unblocked via <code class="computeroutput">unblock</code>. Here is an example of blocking/unblocking slots:</p> <pre class="programlisting"> -boost::signals::connection c = sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(HelloWorld()); +boost::signals::connection c = sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(HelloWorld()); sig(); <span class="emphasis"><em>// Prints "Hello, World!"</em></span> c.<code class="computeroutput">block</code>(); <span class="emphasis"><em>// block the slot</em></span> @@ -731,7 +731,7 @@ sig(); <span class="emphasis"><em>// Prints "Hello, World!"</em></span> </div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> -<a name="idm45555134097200"></a>Scoped connections (Intermediate)</h4></div></div></div> +<a name="idp393137392"></a>Scoped connections (Intermediate)</h4></div></div></div> <p>The <code class="computeroutput">boost::signals::scoped_connection</code> class references a signal/slot connection that will be disconnected when the <code class="computeroutput">scoped_connection</code> class goes out of scope. This @@ -739,7 +739,7 @@ ability is useful when a connection need only be temporary, e.g.,</p> <pre class="programlisting"> { - boost::signals::scoped_connection c = sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(ShortLived()); + boost::signals::scoped_connection c = sig.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(ShortLived()); sig(); <span class="emphasis"><em>// will call ShortLived function object</em></span> } sig(); <span class="emphasis"><em>// ShortLived function object no longer connected to sig</em></span> @@ -747,10 +747,10 @@ sig(); <span class="emphasis"><em>// ShortLived function object no longer connec </div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> -<a name="idm45555134091600"></a>Disconnecting equivalent slots (Intermediate)</h4></div></div></div> +<a name="idp393142992"></a>Disconnecting equivalent slots (Intermediate)</h4></div></div></div> <p>One can disconnect slots that are equivalent to a given function object using a form of the -<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506982619872-bb">disconnect</a></code> method, so long as +<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp78481200-bb">disconnect</a></code> method, so long as the type of the function object has an accessible <code class="computeroutput">==</code> operator. For instance: @@ -798,7 +798,7 @@ sig.disconnect(&foo); </div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> -<a name="idm45555134082128"></a>Automatic connection management (Intermediate)</h4></div></div></div> +<a name="idp393152464"></a>Automatic connection management (Intermediate)</h4></div></div></div> <p>Boost.Signals can automatically track the lifetime of objects involved in signal/slot connections, including automatic disconnection of slots when objects involved in the slot call are @@ -853,7 +853,7 @@ public: // ... NewsMessageArea newsMessageArea = new NewsMessageArea(/* ... */); // ... -deliverNews.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(boost::bind(&NewsMessageArea::displayNews, +deliverNews.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(boost::bind(&NewsMessageArea::displayNews, newsMessageArea, _1)); </pre> <p>However, what if the user closes the news message area, @@ -886,10 +886,10 @@ this limitation.</p> </div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> -<a name="idm45555134058512"></a>When can disconnections occur? (Intermediate)</h4></div></div></div> +<a name="idp393176080"></a>When can disconnections occur? (Intermediate)</h4></div></div></div> <p>Signal/slot disconnections occur when any of these conditions occur:</p> -<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> +<div class="itemizedlist"><ul class="itemizedlist" type="disc"> <li class="listitem"><p>The connection is explicitly disconnected via the connection's <code class="computeroutput">disconnect</code> method directly, or indirectly via the signal's <code class="computeroutput">disconnect</code> method or @@ -913,7 +913,7 @@ signal.</p> </div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> -<a name="idm45555134051024"></a>Passing slots (Intermediate)</h4></div></div></div> +<a name="idp393183568"></a>Passing slots (Intermediate)</h4></div></div></div> <p>Slots in the Boost.Signals library are created from arbitrary function objects, and therefore have no fixed type. However, it is commonplace to require that slots be passed through interfaces that @@ -948,7 +948,7 @@ void Button::doOnClick( const OnClick::slot_type& slot ) { - onClick.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(slot); + onClick.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(slot); } void printCoordinates(long x, long y) @@ -979,7 +979,7 @@ void Button::doOnClick( const OnClick::slot_type& slot ) { - onClick.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idm45506985002448-bb">connect</a></code>(slot); + onClick.<code class="computeroutput"><a class="link" href="../boost/signalN.html#idp207005552-bb">connect</a></code>(slot); } void printCoordinates(long x, long y) @@ -1003,7 +1003,7 @@ hidden in an implementation detail file.</p> </div> <div class="section"> <div class="titlepage"><div><div><h3 class="title"> -<a name="idm45555134033856"></a>Example: Document-View</h3></div></div></div> +<a name="idp393200736"></a>Example: Document-View</h3></div></div></div> <p>Signals can be used to implement flexible Document-View architectures. The document will contain a signal to which each of the views can connect. The following <code class="computeroutput">Document</code> class @@ -1128,7 +1128,7 @@ public: </div> <div class="section"> <div class="titlepage"><div><div><h3 class="title"> -<a name="idm45555134018672"></a>Linking against the Signals library</h3></div></div></div> +<a name="idp393215920"></a>Linking against the Signals library</h3></div></div></div> <p>Part of the Boost.Signals library is compiled into a binary library that must be linked into your application to use Signals. Please refer to |