tobkit/libsigc++-2.2.3/docs/reference/html/group__slot.html
2009-12-29 11:14:14 +00:00

84 lines
7.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>libsigc++ 2.0: Slots</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#ffffff">
<table border="0" width="100%">
<tr>
<td width="10%" height="40"><img src="../../images/libsigc_logo.gif" alt="logo" border="0" width="100%" height="100%"/></td>
<td width="90%" height="40"><img src="../../images/top.gif" alt="top" width="100%" height="40"/></td>
</tr>
</table>
<center>
<a class="qindex" href="../../index.html">Main Page</a> &nbsp;
<a class="qindex" href="modules.html">Groups</a> &nbsp;
<a class="qindex" href="namespaces.html"> Namespaces</a> &nbsp;
</center>
<hr width="100%"/>
<!-- Generated by Doxygen 1.5.1 -->
<h1>Slots<br>
<small>
[<a class="el" href="group__functors.html">Functors</a>]</small>
</h1>
<p>
Collaboration diagram for Slots:<center><table><tr><td><img src="group__slot.png" border="0" alt="" usemap="#group____slot_map">
<map name="group____slot_map">
<area href="group__functors.html" shape="rect" coords="7,5,81,32" alt="">
</map></td></tr></table></center>
Slots are type-safe representations of callback methods and functions.
<a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1slot0.html">sigc::slot0&lt;T_return&gt;</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Converts an arbitrary functor to a unified type which is opaque. <a href="classsigc_1_1slot0.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1slot1.html">sigc::slot1&lt;T_return, T_arg1&gt;</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Converts an arbitrary functor to a unified type which is opaque. <a href="classsigc_1_1slot1.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1slot2.html">sigc::slot2&lt;T_return, T_arg1, T_arg2&gt;</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Converts an arbitrary functor to a unified type which is opaque. <a href="classsigc_1_1slot2.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1slot3.html">sigc::slot3&lt;T_return, T_arg1, T_arg2, T_arg3&gt;</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Converts an arbitrary functor to a unified type which is opaque. <a href="classsigc_1_1slot3.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1slot4.html">sigc::slot4&lt;T_return, T_arg1, T_arg2, T_arg3, T_arg4&gt;</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Converts an arbitrary functor to a unified type which is opaque. <a href="classsigc_1_1slot4.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1slot5.html">sigc::slot5&lt;T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5&gt;</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Converts an arbitrary functor to a unified type which is opaque. <a href="classsigc_1_1slot5.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1slot6.html">sigc::slot6&lt;T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6&gt;</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Converts an arbitrary functor to a unified type which is opaque. <a href="classsigc_1_1slot6.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1slot7.html">sigc::slot7&lt;T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7&gt;</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Converts an arbitrary functor to a unified type which is opaque. <a href="classsigc_1_1slot7.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1slot.html">sigc::slot&lt;T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7&gt;</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Convenience wrapper for the numbered <a class="el" href="classsigc_1_1slot.html">sigc::slot</a># templates. <a href="classsigc_1_1slot.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1slot__base.html">sigc::slot_base</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Base type for slots. <a href="classsigc_1_1slot__base.html#_details">More...</a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Slots are type-safe representations of callback methods and functions.
<p>
A Slot can be constructed from any function, regardless of whether it is a global function, a member method, static, or virtual.<p>
Use the <a class="el" href="group__mem__fun.html#g7d9ea809173f48bf5c76cf1989591602">sigc::mem_fun()</a> and <a class="el" href="group__ptr__fun.html#gda8b678665c14dc85eb32d25b7299465">sigc::ptr_fun()</a> template functions to get a <a class="el" href="classsigc_1_1slot.html">sigc::slot</a>, like so:<p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classsigc_1_1slot.html">sigc::slot&lt;void, int&gt;</a> sl = <a class="code" href="group__mem__fun.html#g7d9ea809173f48bf5c76cf1989591602">sigc::mem_fun</a>(someobj,&amp; SomeClass::somemethod);
</pre></div><p>
or<p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classsigc_1_1slot.html">sigc::slot&lt;void, int&gt;</a> sl = <a class="code" href="group__ptr__fun.html#gda8b678665c14dc85eb32d25b7299465">sigc::ptr_fun</a>(&amp;somefunction);
</pre></div><p>
or<p>
<div class="fragment"><pre class="fragment"> m_Button.signal_clicked().connect( <a class="code" href="group__mem__fun.html#g7d9ea809173f48bf5c76cf1989591602">sigc::mem_fun</a>(*<span class="keyword">this</span>, &amp;MyWindow::on_button_clicked) );
</pre></div><p>
The compiler will complain if SomeClass::somemethod, etc. have the wrong signature.<p>
You can also pass slots as method parameters where you might normally pass a function pointer. <hr><address><small>
Generated for libsigc++ 2.0 by <a href="http://www.doxygen.org/index.html">
Doxygen</a> 1.5.1 &copy;&nbsp;1997-2001</small></address>
</body>
</html>