| 1 | <html> |
|---|
| 2 | <head> |
|---|
| 3 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
|---|
| 4 | <title>Class trackable</title> |
|---|
| 5 | <link rel="stylesheet" href="boostbook.css" type="text/css"> |
|---|
| 6 | <meta name="generator" content="DocBook XSL Stylesheets V1.69.1"> |
|---|
| 7 | <link rel="start" href="index.html" title="The Boost C++ Libraries"> |
|---|
| 8 | <link rel="up" href="signals/reference.html#id2587580" title="Header <boost/signals/trackable.hpp>"> |
|---|
| 9 | <link rel="prev" href="slot.html" title="Class template slot"> |
|---|
| 10 | <link rel="next" href="connection.html" title="Class connection"> |
|---|
| 11 | </head> |
|---|
| 12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
|---|
| 13 | <table cellpadding="2" width="100%"> |
|---|
| 14 | <td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../boost.png"></td> |
|---|
| 15 | <td align="center"><a href="../../index.htm">Home</a></td> |
|---|
| 16 | <td align="center"><a href="../../libs/libraries.htm">Libraries</a></td> |
|---|
| 17 | <td align="center"><a href="../../people/people.htm">People</a></td> |
|---|
| 18 | <td align="center"><a href="../../more/faq.htm">FAQ</a></td> |
|---|
| 19 | <td align="center"><a href="../../more/index.htm">More</a></td> |
|---|
| 20 | </table> |
|---|
| 21 | <hr> |
|---|
| 22 | <div class="spirit-nav"> |
|---|
| 23 | <a accesskey="p" href="slot.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="signals/reference.html#id2587580"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="connection.html"><img src="images/next.png" alt="Next"></a> |
|---|
| 24 | </div> |
|---|
| 25 | <div class="refentry" lang="en"> |
|---|
| 26 | <a name="trackable"></a><div class="titlepage"></div> |
|---|
| 27 | <div class="refnamediv"> |
|---|
| 28 | <h2><span class="refentrytitle">Class trackable</span></h2> |
|---|
| 29 | <p>boost::signals::trackable — Enables safe use of multicast callbacks.</p> |
|---|
| 30 | </div> |
|---|
| 31 | <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> |
|---|
| 32 | <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"> |
|---|
| 33 | <span class="bold"><strong>class</strong></span> trackable { |
|---|
| 34 | <span class="bold"><strong>public</strong></span>: |
|---|
| 35 | <span class="emphasis"><em>// <a href="trackable.html#trackableconstruct-copy-destruct">construct/copy/destruct</a></em></span> |
|---|
| 36 | <a href="trackable.html#id2501283-bb">trackable</a>(); |
|---|
| 37 | <a href="trackable.html#id2558432-bb">trackable</a>(<span class="bold"><strong>const</strong></span> <a href="trackable.html" title="Class trackable">trackable</a>&); |
|---|
| 38 | trackable& <a href="trackable.html#id2345319-bb"><span class="bold"><strong>operator</strong></span>=</a>(<span class="bold"><strong>const</strong></span> <a href="trackable.html" title="Class trackable">trackable</a>&); |
|---|
| 39 | <a href="trackable.html#id2553044-bb">~trackable</a>(); |
|---|
| 40 | };</pre></div> |
|---|
| 41 | <div class="refsect1" lang="en"> |
|---|
| 42 | <a name="id2736040"></a><h2>Description</h2> |
|---|
| 43 | <p>The <code class="computeroutput">trackable</code> class provides automatic |
|---|
| 44 | disconnection of signals and slots when objects bound in |
|---|
| 45 | slots (via pointer or reference) are destroyed. The |
|---|
| 46 | <code class="computeroutput">trackable</code> class may only be used as a public |
|---|
| 47 | base class for some other class; when used as such, that |
|---|
| 48 | class may be bound to function objects used as part of |
|---|
| 49 | slots. The manner in which a <code class="computeroutput">trackable</code> object |
|---|
| 50 | tracks the set of signal-slot connections it is a part of is |
|---|
| 51 | unspecified.</p> |
|---|
| 52 | <p>The actual use of <code class="computeroutput">trackable</code> is contingent |
|---|
| 53 | on the presence of appropriate |
|---|
| 54 | <a href="visit_each.html" title="Function template visit_each">visit_each</a> overloads for any |
|---|
| 55 | type that may contain pointers or references to trackable |
|---|
| 56 | objects.</p> |
|---|
| 57 | <div class="refsect2" lang="en"> |
|---|
| 58 | <a name="id2736089"></a><h3> |
|---|
| 59 | <a name="trackableconstruct-copy-destruct"></a><code class="computeroutput">trackable</code> construct/copy/destruct</h3> |
|---|
| 60 | <div class="orderedlist"><ol type="1"> |
|---|
| 61 | <li> |
|---|
| 62 | <pre class="literallayout"><a name="id2501283-bb"></a>trackable();</pre> |
|---|
| 63 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>: |
|---|
| 64 | |
|---|
| 65 | Sets the list of connected slots to empty.<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>: |
|---|
| 66 | |
|---|
| 67 | Will not throw.</p> |
|---|
| 68 | </li> |
|---|
| 69 | <li> |
|---|
| 70 | <pre class="literallayout"><a name="id2558432-bb"></a>trackable(<span class="bold"><strong>const</strong></span> <a href="trackable.html" title="Class trackable">trackable</a>& other);</pre> |
|---|
| 71 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>: |
|---|
| 72 | |
|---|
| 73 | Sets the list of connected slots to empty.<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>: |
|---|
| 74 | |
|---|
| 75 | Will not throw.<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Rationale</span></b>: |
|---|
| 76 | |
|---|
| 77 | Signal-slot connections can only be created via calls to an explicit connect method, and therefore cannot be created here when trackable objects are copied.</p> |
|---|
| 78 | </li> |
|---|
| 79 | <li> |
|---|
| 80 | <pre class="literallayout">trackable& <a name="id2345319-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>const</strong></span> <a href="trackable.html" title="Class trackable">trackable</a>& other);</pre> |
|---|
| 81 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>: |
|---|
| 82 | |
|---|
| 83 | Sets the list of connected slots to empty.<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
|---|
| 84 | |
|---|
| 85 | <code class="computeroutput">*this</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>: |
|---|
| 86 | |
|---|
| 87 | Will not throw.<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Rationale</span></b>: |
|---|
| 88 | |
|---|
| 89 | Signal-slot connections can only be created via calls to an explicit connect method, and therefore cannot be created here when trackable objects are copied.</p> |
|---|
| 90 | </li> |
|---|
| 91 | <li> |
|---|
| 92 | <pre class="literallayout"><a name="id2553044-bb"></a>~trackable();</pre> |
|---|
| 93 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>: |
|---|
| 94 | |
|---|
| 95 | Disconnects all signal/slot connections that |
|---|
| 96 | contain a pointer or reference to this trackable object that |
|---|
| 97 | can be found by |
|---|
| 98 | <a href="visit_each.html" title="Function template visit_each">visit_each</a>.</p> |
|---|
| 99 | </li> |
|---|
| 100 | </ol></div> |
|---|
| 101 | </div> |
|---|
| 102 | </div> |
|---|
| 103 | </div> |
|---|
| 104 | <table width="100%"><tr> |
|---|
| 105 | <td align="left"></td> |
|---|
| 106 | <td align="right"><small>Copyright © 2001-2004 Douglas Gregor</small></td> |
|---|
| 107 | </tr></table> |
|---|
| 108 | <hr> |
|---|
| 109 | <div class="spirit-nav"> |
|---|
| 110 | <a accesskey="p" href="slot.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="signals/reference.html#id2587580"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="connection.html"><img src="images/next.png" alt="Next"></a> |
|---|
| 111 | </div> |
|---|
| 112 | </body> |
|---|
| 113 | </html> |
|---|