Imported Upstream version 2.99.2
[platform/upstream/libsigc++.git] / docs / reference / html / classsigc_1_1slot.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
6 <meta name="generator" content="Doxygen 1.8.9.1"/>
7 <title>libsigc++: sigc::slot&lt; T_return, T_arg &gt; Class Template Reference</title>
8 <link href="tabs.css" rel="stylesheet" type="text/css"/>
9 <script type="text/javascript" src="jquery.js"></script>
10 <script type="text/javascript" src="dynsections.js"></script>
11 <link href="doxygen.css" rel="stylesheet" type="text/css" />
12 <link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
13 </head>
14 <body>
15 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
16 <div id="titlearea">
17 <table cellspacing="0" cellpadding="0">
18  <tbody>
19  <tr style="height: 56px;">
20   <td style="padding-left: 0.5em;">
21    <div id="projectname">libsigc++
22    &#160;<span id="projectnumber">2.99.2</span>
23    </div>
24   </td>
25  </tr>
26  </tbody>
27 </table>
28 </div>
29 <!-- end header part -->
30 <!-- Generated by Doxygen 1.8.9.1 -->
31   <div id="navrow1" class="tabs">
32     <ul class="tablist">
33       <li><a href="index.html"><span>Main&#160;Page</span></a></li>
34       <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
35       <li><a href="modules.html"><span>Modules</span></a></li>
36       <li><a href="namespaces.html"><span>Namespaces</span></a></li>
37       <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
38     </ul>
39   </div>
40   <div id="navrow2" class="tabs2">
41     <ul class="tablist">
42       <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
43       <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
44       <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
45       <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
46     </ul>
47   </div>
48 <div id="nav-path" class="navpath">
49   <ul>
50 <li class="navelem"><a class="el" href="namespacesigc.html">sigc</a></li><li class="navelem"><a class="el" href="classsigc_1_1slot.html">slot</a></li>  </ul>
51 </div>
52 </div><!-- top -->
53 <div class="header">
54   <div class="headertitle">
55 <div class="title">sigc::slot&lt; T_return, T_arg &gt; Class Template Reference<div class="ingroups"><a class="el" href="group__sigcfunctors.html">Functors</a> &raquo; <a class="el" href="group__slot.html">Slots</a></div></div>  </div>
56 </div><!--header-->
57 <div class="contents">
58
59 <p>Converts an arbitrary functor to a unified type which is opaque.  
60  <a href="classsigc_1_1slot.html#details">More...</a></p>
61
62 <p><code>#include &lt;sigc++/functors/slot.h&gt;</code></p>
63 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
64 <div class="textblock"><h3>template&lt;class T_return, class... T_arg&gt;<br />
65 class sigc::slot&lt; T_return, T_arg &gt;</h3>
66
67 <p>Converts an arbitrary functor to a unified type which is opaque. </p>
68 <p><a class="el" href="classsigc_1_1slot.html" title="Converts an arbitrary functor to a unified type which is opaque. ">sigc::slot</a> itself is a functor or, to be more precise, a closure. It contains a single, arbitrary functor (or closure) that is executed in operator()().</p>
69 <p>The template arguments determine the function signature of operator()():</p><ul>
70 <li><em>T_return</em> The return type of operator()().</li>
71 <li><em>T_arg</em> Argument types used in the definition of operator()().</li>
72 </ul>
73 <p>For instance, to declare a slot that returns void and takes two parameters of bool and int: </p><div class="fragment"><div class="line"><a class="code" href="classsigc_1_1slot.html">sigc::slot&lt;void(bool, int)&gt;</a> some_slot;</div>
74 </div><!-- fragment --><p>To use, simply assign the desired functor to the slot. If the functor is not compatible with the parameter list defined with the template arguments then compiler errors are triggered. When called, the slot will invoke the functor with minimal copies. block() and unblock() can be used to block the functor's invocation from operator()() temporarily. </p>
75 </div></div><!-- contents -->
76 <!-- start footer part -->
77 <hr class="footer"/><address class="footer"><small>
78 Generated on Wed Mar 16 2016 20:53:28 for libsigc++ by &#160;<a href="http://www.doxygen.org/index.html">
79 <img class="footer" src="doxygen.png" alt="doxygen"/>
80 </a> 1.8.9.1
81 </small></address>
82 </body>
83 </html>