summaryrefslogtreecommitdiff
path: root/doc/html/scoped_connection.html
blob: 4fcbd770f1334a04183ef57ec78c734a3e2d88b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Class scoped_connection</title>
<link rel="stylesheet" href="boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
<link rel="start" href="index.html" title="The Boost C++ Libraries">
<link rel="up" href="signals/reference.html#id1188227" title="Header &lt;boost/signals/connection.hpp&gt;">
<link rel="prev" href="connection.html" title="Class connection">
<link rel="next" href="visit_each.html" title="Function template visit_each">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%">
<td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../boost.png"></td>
<td align="center"><a href="../../index.htm">Home</a></td>
<td align="center"><a href="../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="../../people/people.htm">People</a></td>
<td align="center"><a href="../../more/faq.htm">FAQ</a></td>
<td align="center"><a href="../../more/index.htm">More</a></td>
</table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="connection.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="signals/reference.html#id1188227"><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="visit_each.html"><img src="images/next.png" alt="Next"></a>
</div>
<div class="refentry" lang="en">
<a name="scoped_connection"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class scoped_connection</span></h2>
<p>boost::signals::scoped_connection &#8212; Limits a signal-slot connection lifetime to a particular scope.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
<span class="bold"><strong>class</strong></span> scoped_connection : <span class="bold"><strong>private</strong></span> noncopyable   <span class="emphasis"><em>// Exposition only</em></span>
{
<span class="bold"><strong>public</strong></span>:
  <span class="emphasis"><em>// <a href="scoped_connection.html#scoped_connectionconstruct-copy-destruct">construct/copy/destruct</a></em></span>
  <a href="scoped_connection.html#id1181802-bb">scoped_connection</a>(<span class="bold"><strong>const</strong></span> <a href="connection.html" title="Class connection">connection</a>&amp;);
  <a href="scoped_connection.html#id1006932-bb">~scoped_connection</a>();

  <span class="emphasis"><em>// <a href="scoped_connection.html#id1075473-bb">connection management</a></em></span>
  <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="scoped_connection.html#id725789-bb">disconnect</a>() <span class="bold"><strong>const</strong></span>;
  <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="scoped_connection.html#id1187176-bb">connected</a>() <span class="bold"><strong>const</strong></span>;
};</pre></div>
<div class="refsect1" lang="en">
<a name="id1286250"></a><h2>Description</h2>
<div class="refsect2" lang="en">
<a name="id1286253"></a><h3>
<a name="scoped_connectionconstruct-copy-destruct"></a><code class="computeroutput">scoped_connection</code> construct/copy/destruct</h3>
<div class="orderedlist"><ol type="1">
<li>
<pre class="literallayout"><a name="id1181802-bb"></a>scoped_connection(<span class="bold"><strong>const</strong></span> <a href="connection.html" title="Class connection">connection</a>&amp; other);</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>:

    <code class="computeroutput">this</code> references
          the connection referenced by
          <code class="computeroutput">other</code>.<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>:

    Will not throw.</p>
</li>
<li>
<pre class="literallayout"><a name="id1006932-bb"></a>~scoped_connection();</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>:

    If
          <code class="computeroutput">this-&gt;<a href="scoped_connection.html#id1187176-bb">connected</a>()</code>,
          disconnects the signal-slot connection.</p>
</li>
</ol></div>
</div>
<div class="refsect2" lang="en">
<a name="id1286365"></a><h3>
<a name="id1075473-bb"></a><code class="computeroutput">scoped_connection</code> connection management</h3>
<div class="orderedlist"><ol type="1">
<li>
<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id725789-bb"></a>disconnect() <span class="bold"><strong>const</strong></span>;</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>:

    If
             <code class="computeroutput">this-&gt;<a href="scoped_connection.html#id1187176-bb">connected</a>()</code>,
             disconnects the signal and slot referenced by this;
             otherwise, this operation is a no-op.<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Postconditions</span></b>:

    <code class="computeroutput">!this-&gt;<a href="scoped_connection.html#id1187176-bb">connected</a>()</code>.</p>
</li>
<li>
<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id1187176-bb"></a>connected() <span class="bold"><strong>const</strong></span>;</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>:

    <code class="computeroutput">true</code> if this
            references a non-NULL connection that is still active
            (connected), and <code class="computeroutput">false</code>
            otherwise.<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>:

    Will not throw.</p>
</li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><small>Copyright © 2001-2004 Douglas Gregor</small></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="connection.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="signals/reference.html#id1188227"><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="visit_each.html"><img src="images/next.png" alt="Next"></a>
</div>
</body>
</html>