Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > media > main-release > by-pkgid > bd29e346140bd3fbcbf1674e576e565a > files > 423

libsigc++2.0-doc-2.2.7-1mdv2010.1.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>libsigc++: Slots</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>Slots<br/>
<small>
[<a class="el" href="group__sigcfunctors.html">Functors</a>]</small>
</h1>
<p>Slots are type-safe representations of callback methods and functions. <a href="#_details">More...</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class&#160;</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">&#160;</td><td class="mdescRight">Base type for slots. <a href="classsigc_1_1slot__base.html#_details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class&#160;</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">&#160;</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" align="right" valign="top">class&#160;</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">&#160;</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" align="right" valign="top">class&#160;</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">&#160;</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" align="right" valign="top">class&#160;</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">&#160;</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" align="right" valign="top">class&#160;</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">&#160;</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" align="right" valign="top">class&#160;</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">&#160;</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" align="right" valign="top">class&#160;</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">&#160;</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" align="right" valign="top">class&#160;</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">&#160;</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" align="right" valign="top">class&#160;</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">&#160;</td><td class="mdescRight">Convenience wrapper for the numbered <a class="el" href="classsigc_1_1slot.html" title="Convenience wrapper for the numbered sigc::slot# templates.">sigc::slot</a># templates. <a href="classsigc_1_1slot.html#_details">More...</a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Slots are type-safe representations of callback methods and functions. </p>
<p>A Slot can be constructed from any function, regardless of whether it is a global function, a member method, static, or virtual.</p>
<p>Use the <a class="el" href="group__mem__fun.html#ga7d9ea809173f48bf5c76cf1989591602" title="Creates a functor of type sigc::mem_functor0 which wraps a method.">sigc::mem_fun()</a> and <a class="el" href="group__ptr__fun.html#gada8b678665c14dc85eb32d25b7299465" title="Creates a functor of type sigc::pointer_functor0 which wraps an existing non-member...">sigc::ptr_fun()</a> template functions to get a <a class="el" href="classsigc_1_1slot.html" title="Convenience wrapper for the numbered sigc::slot# templates.">sigc::slot</a>, like so:</p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classsigc_1_1slot.html" title="Convenience wrapper for the numbered sigc::slot# templates.">sigc::slot&lt;void, int&gt;</a> sl = <a class="code" href="group__mem__fun.html#ga7d9ea809173f48bf5c76cf1989591602" title="Creates a functor of type sigc::mem_functor0 which wraps a method.">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" title="Convenience wrapper for the numbered sigc::slot# templates.">sigc::slot&lt;void, int&gt;</a> sl = <a class="code" href="group__ptr__fun.html#gada8b678665c14dc85eb32d25b7299465" title="Creates a functor of type sigc::pointer_functor0 which wraps an existing non-member...">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#ga7d9ea809173f48bf5c76cf1989591602" title="Creates a functor of type sigc::mem_functor0 which wraps a method.">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>
<p>You can also pass slots as method parameters where you might normally pass a function pointer. </p>
</div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Tue May 4 21:44:38 2010 for libsigc++ by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>