1 | <html> |
---|
2 | <head> |
---|
3 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
---|
4 | <title>Class connection</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#id2543701" title="Header <boost/signals/connection.hpp>"> |
---|
9 | <link rel="prev" href="trackable.html" title="Class trackable"> |
---|
10 | <link rel="next" href="scoped_connection.html" title="Class scoped_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="trackable.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="signals/reference.html#id2543701"><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="scoped_connection.html"><img src="images/next.png" alt="Next"></a> |
---|
24 | </div> |
---|
25 | <div class="refentry" lang="en"> |
---|
26 | <a name="connection"></a><div class="titlepage"></div> |
---|
27 | <div class="refnamediv"> |
---|
28 | <h2><span class="refentrytitle">Class connection</span></h2> |
---|
29 | <p>boost::signals::connection — Query/disconnect a signal-slot connection.</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> connection { |
---|
34 | <span class="bold"><strong>public</strong></span>: |
---|
35 | <span class="emphasis"><em>// <a href="connection.html#connectionconstruct-copy-destruct">construct/copy/destruct</a></em></span> |
---|
36 | <a href="connection.html#id2553533-bb">connection</a>(); |
---|
37 | <a href="connection.html#id2583129-bb">connection</a>(<span class="bold"><strong>const</strong></span> <a href="connection.html" title="Class connection">connection</a>&); |
---|
38 | connection& <a href="connection.html#id2578224-bb"><span class="bold"><strong>operator</strong></span>=</a>(<span class="bold"><strong>const</strong></span> <a href="connection.html" title="Class connection">connection</a>&); |
---|
39 | |
---|
40 | <span class="emphasis"><em>// <a href="connection.html#id2558787-bb">connection management</a></em></span> |
---|
41 | <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="connection.html#id2558792-bb">disconnect</a>() <span class="bold"><strong>const</strong></span>; |
---|
42 | <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="connection.html#id2558732-bb">connected</a>() <span class="bold"><strong>const</strong></span>; |
---|
43 | |
---|
44 | <span class="emphasis"><em>// <a href="connection.html#id2575036-bb">blocking</a></em></span> |
---|
45 | <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="connection.html#id2542286-bb">block</a>(<span class="bold"><strong>bool</strong></span> = true); |
---|
46 | <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="connection.html#id2587349-bb">unblock</a>(); |
---|
47 | <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="connection.html#id2583758-bb">blocked</a>() <span class="bold"><strong>const</strong></span>; |
---|
48 | |
---|
49 | <span class="emphasis"><em>// <a href="connection.html#id2553604-bb">modifiers</a></em></span> |
---|
50 | <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="connection.html#id2560411-bb">swap</a>(<span class="bold"><strong>const</strong></span> <a href="connection.html" title="Class connection">connection</a>&); |
---|
51 | |
---|
52 | <span class="emphasis"><em>// <a href="connection.html#id2583629-bb">comparisons</a></em></span> |
---|
53 | <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="connection.html#id2591430-bb"><span class="bold"><strong>operator</strong></span>==</a>(<span class="bold"><strong>const</strong></span> <a href="connection.html" title="Class connection">connection</a>&) <span class="bold"><strong>const</strong></span>; |
---|
54 | <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="connection.html#id2566739-bb"><span class="bold"><strong>operator</strong></span><</a>(<span class="bold"><strong>const</strong></span> <a href="connection.html" title="Class connection">connection</a>&) <span class="bold"><strong>const</strong></span>; |
---|
55 | }; |
---|
56 | |
---|
57 | <span class="emphasis"><em>// <a href="connection.html#id2539555-bb">specialized algorithms</a></em></span> |
---|
58 | <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="connection.html#id2558035">swap</a>(<a href="connection.html" title="Class connection">connection</a>&, <a href="connection.html" title="Class connection">connection</a>&);</pre></div> |
---|
59 | <div class="refsect1" lang="en"> |
---|
60 | <a name="id2736771"></a><h2>Description</h2> |
---|
61 | <p>The <a href="connection.html" title="Class connection">connection</a> class represents |
---|
62 | a connection between a Signal and a Slot. It is a |
---|
63 | lightweight object that has the ability to query whether the |
---|
64 | signal and slot are currently connected, and to disconnect |
---|
65 | the signal and slot. It is always safe to query or |
---|
66 | disconnect a connection.</p> |
---|
67 | <div class="refsect2" lang="en"> |
---|
68 | <a name="id2736789"></a><h3> |
---|
69 | <a name="connectionconstruct-copy-destruct"></a><code class="computeroutput">connection</code> construct/copy/destruct</h3> |
---|
70 | <div class="orderedlist"><ol type="1"> |
---|
71 | <li> |
---|
72 | <pre class="literallayout"><a name="id2553533-bb"></a>connection();</pre> |
---|
73 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>: |
---|
74 | |
---|
75 | Sets the currently represented connection to the |
---|
76 | NULL connection.<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Postconditions</span></b>: |
---|
77 | |
---|
78 | <code class="computeroutput">!this-><a href="connection.html#id2558732-bb">connected</a>()</code>.<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>: |
---|
79 | |
---|
80 | Will not throw.</p> |
---|
81 | </li> |
---|
82 | <li> |
---|
83 | <pre class="literallayout"><a name="id2583129-bb"></a>connection(<span class="bold"><strong>const</strong></span> <a href="connection.html" title="Class connection">connection</a>& other);</pre> |
---|
84 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>: |
---|
85 | |
---|
86 | <code class="computeroutput">this</code> references |
---|
87 | the connection referenced by |
---|
88 | <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>: |
---|
89 | |
---|
90 | Will not throw.</p> |
---|
91 | </li> |
---|
92 | <li> |
---|
93 | <pre class="literallayout">connection& <a name="id2578224-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>const</strong></span> <a href="connection.html" title="Class connection">connection</a>& other);</pre> |
---|
94 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>: |
---|
95 | |
---|
96 | <code class="computeroutput">this</code> references |
---|
97 | the connection referenced by |
---|
98 | <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>: |
---|
99 | |
---|
100 | Will not throw.</p> |
---|
101 | </li> |
---|
102 | </ol></div> |
---|
103 | </div> |
---|
104 | <div class="refsect2" lang="en"> |
---|
105 | <a name="id2736977"></a><h3> |
---|
106 | <a name="id2558787-bb"></a><code class="computeroutput">connection</code> connection management</h3> |
---|
107 | <div class="orderedlist"><ol type="1"> |
---|
108 | <li> |
---|
109 | <pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id2558792-bb"></a>disconnect() <span class="bold"><strong>const</strong></span>;</pre> |
---|
110 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>: |
---|
111 | |
---|
112 | If |
---|
113 | <code class="computeroutput">this-><a href="connection.html#id2558732-bb">connected</a>()</code>, |
---|
114 | disconnects the signal and slot referenced by this; |
---|
115 | 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>: |
---|
116 | |
---|
117 | <code class="computeroutput">!this-><a href="connection.html#id2558732-bb">connected</a>()</code>.</p> |
---|
118 | </li> |
---|
119 | <li> |
---|
120 | <pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2558732-bb"></a>connected() <span class="bold"><strong>const</strong></span>;</pre> |
---|
121 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
122 | |
---|
123 | <code class="computeroutput">true</code> if this |
---|
124 | references a non-NULL connection that is still active |
---|
125 | (connected), and <code class="computeroutput">false</code> |
---|
126 | otherwise.<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>: |
---|
127 | |
---|
128 | Will not throw.</p> |
---|
129 | </li> |
---|
130 | </ol></div> |
---|
131 | </div> |
---|
132 | <div class="refsect2" lang="en"> |
---|
133 | <a name="id2737123"></a><h3> |
---|
134 | <a name="id2575036-bb"></a><code class="computeroutput">connection</code> blocking</h3> |
---|
135 | <div class="orderedlist"><ol type="1"> |
---|
136 | <li> |
---|
137 | <pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id2542286-bb"></a>block(<span class="bold"><strong>bool</strong></span> should_block = true);</pre> |
---|
138 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Requires</span></b>: |
---|
139 | |
---|
140 | <code class="computeroutput">connected()</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Postconditions</span></b>: |
---|
141 | |
---|
142 | <code class="computeroutput">blocked() == should_block</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>: |
---|
143 | |
---|
144 | Will not throw.</p> |
---|
145 | </li> |
---|
146 | <li> |
---|
147 | <pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id2587349-bb"></a>unblock();</pre> |
---|
148 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Requires</span></b>: |
---|
149 | |
---|
150 | <code class="computeroutput">connected()</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Postconditions</span></b>: |
---|
151 | |
---|
152 | <code class="computeroutput">!blocked()</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>: |
---|
153 | |
---|
154 | Will not throw.</p> |
---|
155 | </li> |
---|
156 | <li> |
---|
157 | <pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2583758-bb"></a>blocked() <span class="bold"><strong>const</strong></span>;</pre> |
---|
158 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
159 | |
---|
160 | <code class="computeroutput">true</code> if the associated slot is either disconnected or blocked, <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>: |
---|
161 | |
---|
162 | Will not throw.</p> |
---|
163 | </li> |
---|
164 | </ol></div> |
---|
165 | </div> |
---|
166 | <div class="refsect2" lang="en"> |
---|
167 | <a name="id2737308"></a><h3> |
---|
168 | <a name="id2553604-bb"></a><code class="computeroutput">connection</code> modifiers</h3> |
---|
169 | <div class="orderedlist"><ol type="1"><li> |
---|
170 | <pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id2560411-bb"></a>swap(<span class="bold"><strong>const</strong></span> <a href="connection.html" title="Class connection">connection</a>& other);</pre> |
---|
171 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>: |
---|
172 | |
---|
173 | Swaps the connections referenced in |
---|
174 | <code class="computeroutput">this</code> and |
---|
175 | <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>: |
---|
176 | |
---|
177 | Will not throw.</p> |
---|
178 | </li></ol></div> |
---|
179 | </div> |
---|
180 | <div class="refsect2" lang="en"> |
---|
181 | <a name="id2737390"></a><h3> |
---|
182 | <a name="id2583629-bb"></a><code class="computeroutput">connection</code> comparisons</h3> |
---|
183 | <div class="orderedlist"><ol type="1"> |
---|
184 | <li> |
---|
185 | <pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2591430-bb"></a><span class="bold"><strong>operator</strong></span>==(<span class="bold"><strong>const</strong></span> <a href="connection.html" title="Class connection">connection</a>& other) <span class="bold"><strong>const</strong></span>;</pre> |
---|
186 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
187 | |
---|
188 | <code class="computeroutput">true</code> if |
---|
189 | <code class="computeroutput">this</code> and |
---|
190 | <code class="computeroutput">other</code> reference the same |
---|
191 | connection or both reference the NULL connection, and |
---|
192 | <code class="computeroutput">false</code> |
---|
193 | otherwise.<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>: |
---|
194 | |
---|
195 | Will not throw.</p> |
---|
196 | </li> |
---|
197 | <li> |
---|
198 | <pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2566739-bb"></a><span class="bold"><strong>operator</strong></span><(<span class="bold"><strong>const</strong></span> <a href="connection.html" title="Class connection">connection</a>& other) <span class="bold"><strong>const</strong></span>;</pre> |
---|
199 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
200 | |
---|
201 | <code class="computeroutput">true</code> if the |
---|
202 | connection referenced by |
---|
203 | <code class="computeroutput">this</code> precedes the |
---|
204 | connection referenced by |
---|
205 | <code class="computeroutput">other</code> based on some |
---|
206 | unspecified ordering, and |
---|
207 | <code class="computeroutput">false</code> |
---|
208 | otherwise.<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>: |
---|
209 | |
---|
210 | Will not throw.</p> |
---|
211 | </li> |
---|
212 | </ol></div> |
---|
213 | </div> |
---|
214 | <div class="refsect2" lang="en"> |
---|
215 | <a name="id2737582"></a><h3> |
---|
216 | <a name="id2539555-bb"></a><code class="computeroutput">connection</code> specialized algorithms</h3> |
---|
217 | <div class="orderedlist"><ol type="1"><li> |
---|
218 | <pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id2558035"></a>swap(<a href="connection.html" title="Class connection">connection</a>& x, <a href="connection.html" title="Class connection">connection</a>& y);</pre> |
---|
219 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>: |
---|
220 | |
---|
221 | <code class="computeroutput">x.swap(y)</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>: |
---|
222 | |
---|
223 | Will not throw.</p> |
---|
224 | </li></ol></div> |
---|
225 | </div> |
---|
226 | </div> |
---|
227 | </div> |
---|
228 | <table width="100%"><tr> |
---|
229 | <td align="left"></td> |
---|
230 | <td align="right"><small>Copyright © 2001-2004 Douglas Gregor</small></td> |
---|
231 | </tr></table> |
---|
232 | <hr> |
---|
233 | <div class="spirit-nav"> |
---|
234 | <a accesskey="p" href="trackable.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="signals/reference.html#id2543701"><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="scoped_connection.html"><img src="images/next.png" alt="Next"></a> |
---|
235 | </div> |
---|
236 | </body> |
---|
237 | </html> |
---|