Sophie

Sophie

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

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++: hide(), hide_return()</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>hide(), hide_return()<br/>
<small>
[<a class="el" href="group__adaptors.html">Adaptors</a>]</small>
</h1>
<p><a class="el" href="group__hide.html#gaf28d43958b26c67e314f726540463c44" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the...">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 border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Classes</h2></td></tr>
<tr><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><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><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><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><td class="memItemLeft" align="right" valign="top">struct&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsigc_1_1hide__functor_3_011_00_01T__functor_01_4.html">sigc::hide_functor&lt; 1, T_functor &gt;</a></td></tr>
<tr><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_011_00_01T__functor_01_4.html#_details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsigc_1_1hide__functor_3_012_00_01T__functor_01_4.html">sigc::hide_functor&lt; 2, T_functor &gt;</a></td></tr>
<tr><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_012_00_01T__functor_01_4.html#_details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsigc_1_1hide__functor_3_013_00_01T__functor_01_4.html">sigc::hide_functor&lt; 3, T_functor &gt;</a></td></tr>
<tr><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_013_00_01T__functor_01_4.html#_details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsigc_1_1hide__functor_3_014_00_01T__functor_01_4.html">sigc::hide_functor&lt; 4, T_functor &gt;</a></td></tr>
<tr><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_014_00_01T__functor_01_4.html#_details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsigc_1_1hide__functor_3_015_00_01T__functor_01_4.html">sigc::hide_functor&lt; 5, T_functor &gt;</a></td></tr>
<tr><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_015_00_01T__functor_01_4.html#_details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsigc_1_1hide__functor_3_016_00_01T__functor_01_4.html">sigc::hide_functor&lt; 6, T_functor &gt;</a></td></tr>
<tr><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_016_00_01T__functor_01_4.html#_details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;class T_functor &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">retype_return_functor&lt; void, <br class="typebreak"/>
T_functor &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__hide.html#gad7e18e1edbbefe13216eb344bd522f0a">sigc::hide_return</a> (const T_functor&amp; _A_functor)</td></tr>
<tr><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 perform 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="#gad7e18e1edbbefe13216eb344bd522f0a"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;class T_action , int I_location, class T_functor &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__hide.html#gaa07f0ffec52a12cd7dcf1601938b247c">sigc::visit_each</a> (const T_action&amp; _A_action, const hide_functor&lt; I_location, T_functor &gt;&amp; _A_target)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs a functor on each of the targets of a functor. <a href="#gaa07f0ffec52a12cd7dcf1601938b247c"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;int I_location, class T_functor &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">hide_functor&lt; I_location, <br class="typebreak"/>
T_functor &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__hide.html#gaf28d43958b26c67e314f726540463c44">sigc::hide</a> (const T_functor&amp; _A_func)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the passed functor. <a href="#gaf28d43958b26c67e314f726540463c44"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p><a class="el" href="group__hide.html#gaf28d43958b26c67e314f726540463c44" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the...">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 <a class="el" href="classsigc_1_1signal.html" title="Convenience wrapper for the numbered sigc::signal# templates.">signal</a>.</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#gaf28d43958b26c67e314f726540463c44" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the...">sigc::hide</a>&lt;-1&gt;() gives the same result as <a class="el" href="group__hide.html#gaf28d43958b26c67e314f726540463c44" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the...">sigc::hide()</a>.)</p>
<p>The type of the parameter can optionally be specified if not deduced.</p>
<dl class="user"><dt><b>Examples:</b></dt><dd><div class="fragment"><pre class="fragment"> <span class="keywordtype">void</span> foo(<span class="keywordtype">int</span>, <span class="keywordtype">int</span>);
   <span class="comment">// single argument hiding ...</span>
   <a class="code" href="group__hide.html#gaf28d43958b26c67e314f726540463c44" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the...">sigc::hide</a>(&amp;foo)(1,2,3); <span class="comment">// adds a dummy parameter at the back and calls foo(1,2)</span>
   <a class="code" href="group__hide.html#gaf28d43958b26c67e314f726540463c44" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the...">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>
   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>
   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>
   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>
</pre></div></dd></dl>
<p>The functor <a class="el" href="group__hide.html#gaf28d43958b26c67e314f726540463c44" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the...">sigc::hide()</a> returns can be passed into <a class="el" href="classsigc_1_1signal7.html#adc55ac9b0f935fd87a67904022e03cb2" title="Add a slot to the list of slots.">sigc::signal::connect()</a> directly.</p>
<dl class="user"><dt><b>Example:</b></dt><dd><div class="fragment"><pre class="fragment"> <a class="code" href="classsigc_1_1signal.html" title="Convenience wrapper for the numbered sigc::signal# templates.">sigc::signal&lt;void,int&gt;</a> some_signal;
   <span class="keywordtype">void</span> foo();
   some_signal.<a class="code" href="classsigc_1_1signal7.html#adc55ac9b0f935fd87a67904022e03cb2" title="Add a slot to the list of slots.">connect</a>(<a class="code" href="group__hide.html#gaf28d43958b26c67e314f726540463c44" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the...">sigc::hide</a>(&amp;foo));
</pre></div></dd></dl>
<p><a class="el" href="group__hide.html#gaf28d43958b26c67e314f726540463c44" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the...">sigc::hide()</a> can be nested in order to discard multiple arguments. </p>
<dl class="user"><dt><b>Example:</b></dt><dd><div class="fragment"><pre class="fragment"> <span class="comment">// multiple argument hiding ...</span>
   <a class="code" href="group__hide.html#gaf28d43958b26c67e314f726540463c44" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the...">sigc::hide</a>(<a class="code" href="group__hide.html#gaf28d43958b26c67e314f726540463c44" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the...">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>
</pre></div></dd></dl>
<p><a class="el" href="group__hide.html#gad7e18e1edbbefe13216eb344bd522f0a" title="Creates an adaptor of type sigc::retype_return_functor which drops the return value...">sigc::hide_return()</a> alters an arbitrary functor by dropping its return value, thus converting it to a void functor.</p>
<p>For a more powerful version of this functionality see the <a class="el" href="structsigc_1_1lambda.html" title="Lambda type.">lambda</a> library adaptor sigc::group() which can bind, hide and reorder arguments arbitrarily. Although sigc::group() is more flexible, <a class="el" href="group__hide.html#gaf28d43958b26c67e314f726540463c44" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the...">sigc::hide()</a> provides a means of hiding parameters when then total number of parameters called is variable. </p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gaf28d43958b26c67e314f726540463c44"></a><!-- doxytag: member="sigc::hide" ref="gaf28d43958b26c67e314f726540463c44" args="(const T_functor &amp;_A_func)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template &lt;int I_location, class T_functor &gt; </div>
      <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>&#160;)&#160;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates an adaptor of type sigc::hide_functor 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><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>_A_func</em>&#160;</td><td>Functor that should be wrapped. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Adaptor that executes <em>_A_func</em> ignoring the value of the dummy parameter. </dd></dl>

</div>
</div>
<a class="anchor" id="gad7e18e1edbbefe13216eb344bd522f0a"></a><!-- doxytag: member="sigc::hide_return" ref="gad7e18e1edbbefe13216eb344bd522f0a" args="(const T_functor &amp;_A_functor)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template &lt;class T_functor &gt; </div>
      <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>&#160;)&#160;</td>
          <td><code> [inline]</code></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 perform 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><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>_A_functor</em>&#160;</td><td>Functor that should be wrapped. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Adaptor that executes <em>_A_functor</em> dropping its return value. </dd></dl>

</div>
</div>
<a class="anchor" id="gaa07f0ffec52a12cd7dcf1601938b247c"></a><!-- doxytag: member="sigc::visit_each" ref="gaa07f0ffec52a12cd7dcf1601938b247c" args="(const T_action &amp;_A_action, const hide_functor&lt; I_location, T_functor &gt; &amp;_A_target)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template &lt;class T_action , int I_location, class T_functor &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void sigc::visit_each </td>
          <td>(</td>
          <td class="paramtype">const T_action &amp;&#160;</td>
          <td class="paramname"> <em>_A_action</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const hide_functor&lt; I_location, T_functor &gt; &amp;&#160;</td>
          <td class="paramname"> <em>_A_target</em></td><td>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Performs a functor on each of the targets of a functor. </p>
<p>The function overload for sigc::hide_functor performs a functor on the functor stored in the sigc::hide_functor object. </p>

</div>
</div>
</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>