libsigcplusplus/docs/reference/html/group__hide.html

207 lines
16 KiB
HTML

<!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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>libsigc++: hide(), hide_return()</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">libsigc++
&#160;<span id="projectnumber">2.10.3</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li class="current"><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><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">hide(), hide_return()<div class="ingroups"><a class="el" href="group__adaptors.html">Adaptors</a></div></div> </div>
</div><!--header-->
<div class="contents">
<p><a class="el" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the passed functor...">sigc::hide()</a> alters an arbitrary functor in that it adds a parameter whose value is ignored on invocation of the returned functor.
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsigc_1_1hide__functor.html">sigc::hide_functor&lt; I_location, T_functor &gt;</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adaptor that adds a dummy parameter to the wrapped functor. <a href="structsigc_1_1hide__functor.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsigc_1_1hide__functor_3_010_00_01T__functor_01_4.html">sigc::hide_functor&lt; 0, T_functor &gt;</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adaptor that adds a dummy parameter to the wrapped functor. <a href="structsigc_1_1hide__functor_3_010_00_01T__functor_01_4.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsigc_1_1hide__functor_3-1_00_01T__functor_01_4.html">sigc::hide_functor&lt;-1, T_functor &gt;</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adaptor that adds a dummy parameter to the wrapped functor. <a href="structsigc_1_1hide__functor_3-1_00_01T__functor_01_4.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaf2cefea3a99acd44f68121424103172d"><td class="memTemplParams" colspan="2">template&lt;int I_location, class T_functor &gt; </td></tr>
<tr class="memitem:gaf2cefea3a99acd44f68121424103172d"><td class="memTemplItemLeft" align="right" valign="top">hide_functor&lt; I_location, T_functor &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d">sigc::hide</a> (const T_functor&amp; _A_func)</td></tr>
<tr class="memdesc:gaf2cefea3a99acd44f68121424103172d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an adaptor of type <a class="el" href="structsigc_1_1hide__functor.html" title="Adaptor that adds a dummy parameter to the wrapped functor. ">sigc::hide_functor</a> which adds a dummy parameter to the passed functor. <a href="group__hide.html#gaf2cefea3a99acd44f68121424103172d">More...</a><br /></td></tr>
<tr class="separator:gaf2cefea3a99acd44f68121424103172d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacbbacd3553268d85b95e3a85aefb67e5"><td class="memTemplParams" colspan="2">template&lt;class T_functor &gt; </td></tr>
<tr class="memitem:gacbbacd3553268d85b95e3a85aefb67e5"><td class="memTemplItemLeft" align="right" valign="top">hide_functor&lt;-1, T_functor &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__hide.html#gacbbacd3553268d85b95e3a85aefb67e5">sigc::hide</a> (const T_functor&amp; _A_func)</td></tr>
<tr class="memdesc:gacbbacd3553268d85b95e3a85aefb67e5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an adaptor of type <a class="el" href="structsigc_1_1hide__functor.html" title="Adaptor that adds a dummy parameter to the wrapped functor. ">sigc::hide_functor</a> which adds a dummy parameter to the passed functor. <a href="group__hide.html#gacbbacd3553268d85b95e3a85aefb67e5">More...</a><br /></td></tr>
<tr class="separator:gacbbacd3553268d85b95e3a85aefb67e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae4e6f5491471c12440f1c5d480726b98"><td class="memTemplParams" colspan="2">template&lt;class T_functor &gt; </td></tr>
<tr class="memitem:gae4e6f5491471c12440f1c5d480726b98"><td class="memTemplItemLeft" align="right" valign="top">retype_return_functor&lt; void, T_functor &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__hide.html#gae4e6f5491471c12440f1c5d480726b98">sigc::hide_return</a> (const T_functor&amp; _A_functor)</td></tr>
<tr class="memdesc:gae4e6f5491471c12440f1c5d480726b98"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an adaptor of type <a class="el" href="structsigc_1_1retype__return__functor.html" title="Adaptor that performs a C-style cast on the return value of a functor. ">sigc::retype_return_functor</a> which drops the return value of the passed functor. <a href="group__hide.html#gae4e6f5491471c12440f1c5d480726b98">More...</a><br /></td></tr>
<tr class="separator:gae4e6f5491471c12440f1c5d480726b98"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p><a class="el" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the passed functor...">sigc::hide()</a> alters an arbitrary functor in that it adds a parameter whose value is ignored on invocation of the returned functor. </p>
<p>Thus you can discard one argument of a signal.</p>
<p>You may optionally specify the zero-based position of the parameter to ignore as a template argument. The default is to ignore the last parameter. (A value of <code>-1</code> adds a parameter at the end so <a class="el" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the passed functor...">sigc::hide</a>&lt;-1&gt;() gives the same result as <a class="el" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the passed functor...">sigc::hide()</a>.)</p>
<p>The type of the parameter can optionally be specified if not deduced.</p>
<dl class="section user"><dt>Examples:</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">void</span> foo(<span class="keywordtype">int</span>, <span class="keywordtype">int</span>);</div><div class="line"><span class="comment">// single argument hiding ...</span></div><div class="line"><a class="code" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d">sigc::hide</a>(&amp;foo)(1,2,3); <span class="comment">// adds a dummy parameter at the back and calls foo(1,2)</span></div><div class="line"><a class="code" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d">sigc::hide</a>&lt;-1&gt;(&amp;foo)(1,2,3); <span class="comment">// same as sigc::hide(&amp;foo)(1,2,3) (calls foo(1,2))</span></div><div class="line">sigc::hide&lt;0&gt;(&amp;foo)(1,2,3); <span class="comment">// adds a dummy parameter at the beginning and calls foo(2,3)</span></div><div class="line">sigc::hide&lt;1&gt;(&amp;foo)(1,2,3); <span class="comment">// adds a dummy parameter in the middle and calls foo(1,3)</span></div><div class="line">sigc::hide&lt;2&gt;(&amp;foo)(1,2,3); <span class="comment">// adds a dummy parameter at the back and calls foo(1,2)</span></div></div><!-- fragment --></dd></dl>
<p>The functor <a class="el" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the passed functor...">sigc::hide()</a> returns can be directly passed into <a class="el" href="classsigc_1_1signal7.html#adc55ac9b0f935fd87a67904022e03cb2" title="Add a slot to the list of slots. ">sigc::signal::connect()</a>.</p>
<dl class="section user"><dt>Example:</dt><dd><div class="fragment"><div class="line"><a class="code" href="classsigc_1_1signal.html">sigc::signal&lt;void,int&gt;</a> some_signal;</div><div class="line"><span class="keywordtype">void</span> foo();</div><div class="line">some_signal.<a class="code" href="classsigc_1_1signal7.html#adc55ac9b0f935fd87a67904022e03cb2">connect</a>(<a class="code" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d">sigc::hide</a>(&amp;foo));</div></div><!-- fragment --></dd></dl>
<p><a class="el" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the passed functor...">sigc::hide()</a> can be nested in order to discard multiple arguments. </p><dl class="section user"><dt>Example:</dt><dd><div class="fragment"><div class="line"><span class="comment">// multiple argument hiding ...</span></div><div class="line"><a class="code" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d">sigc::hide</a>(<a class="code" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d">sigc::hide</a>(&amp; foo))(1,2,3,4); <span class="comment">// adds two dummy parameters at the back and calls foo(1,2)</span></div></div><!-- fragment --></dd></dl>
<p><a class="el" href="group__hide.html#gae4e6f5491471c12440f1c5d480726b98" title="Creates an adaptor of type sigc::retype_return_functor which drops the return value of the passed fun...">sigc::hide_return()</a> alters an arbitrary functor by dropping its return value, thus converting it to a void functor. </p>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gaf2cefea3a99acd44f68121424103172d"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template &lt;int I_location, class T_functor &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">hide_functor&lt;I_location, T_functor&gt; sigc::hide </td>
<td>(</td>
<td class="paramtype">const T_functor &amp;&#160;</td>
<td class="paramname"><em>_A_func</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates an adaptor of type <a class="el" href="structsigc_1_1hide__functor.html" title="Adaptor that adds a dummy parameter to the wrapped functor. ">sigc::hide_functor</a> which adds a dummy parameter to the passed functor. </p>
<p>The optional template argument <em>I_location</em> specifies the zero-based position of the dummy parameter in the returned functor (<code>-1</code> stands for the last parameter).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">_A_func</td><td>Functor that should be wrapped. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Adaptor that executes <em>_A_func</em>, ignoring the value of the dummy parameter. </dd></dl>
</div>
</div>
<a class="anchor" id="gacbbacd3553268d85b95e3a85aefb67e5"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template &lt;class T_functor &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">hide_functor&lt;-1, T_functor&gt; sigc::hide </td>
<td>(</td>
<td class="paramtype">const T_functor &amp;&#160;</td>
<td class="paramname"><em>_A_func</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates an adaptor of type <a class="el" href="structsigc_1_1hide__functor.html" title="Adaptor that adds a dummy parameter to the wrapped functor. ">sigc::hide_functor</a> which adds a dummy parameter to the passed functor. </p>
<p>This overload adds a dummy parameter at the back of the functor's parameter list.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">_A_func</td><td>Functor that should be wrapped. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Adaptor that executes <em>_A_func</em>, ignoring the value of the last parameter. </dd></dl>
</div>
</div>
<a class="anchor" id="gae4e6f5491471c12440f1c5d480726b98"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template &lt;class T_functor &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">retype_return_functor&lt;void, T_functor&gt; sigc::hide_return </td>
<td>(</td>
<td class="paramtype">const T_functor &amp;&#160;</td>
<td class="paramname"><em>_A_functor</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates an adaptor of type <a class="el" href="structsigc_1_1retype__return__functor.html" title="Adaptor that performs a C-style cast on the return value of a functor. ">sigc::retype_return_functor</a> which drops the return value of the passed functor. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">_A_functor</td><td>Functor that should be wrapped. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Adaptor that executes <em>_A_functor</em> dropping its return value. </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Mar 25 2020 10:13:27 for libsigc++ by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>