<!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++: sigc::slot1< T_return, T_arg1 > Class Template Reference</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 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 class="current"><a href="annotated.html"><span>Classes</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="namespacesigc.html">sigc</a>::<a class="el" href="classsigc_1_1slot1.html">slot1</a> </div> </div> <div class="contents"> <h1>sigc::slot1< T_return, T_arg1 > Class Template Reference<br/> <small> [<a class="el" href="group__slot.html">Slots</a>]</small> </h1><!-- doxytag: class="sigc::slot1" --><!-- doxytag: inherits="sigc::slot_base" --> <p>Converts an arbitrary functor to a unified type which is opaque. <a href="#_details">More...</a></p> <p><code>#include <sigc++/functors/slot.h></code></p> <div class="dynheader"> Inheritance diagram for sigc::slot1< T_return, T_arg1 >:</div> <div class="dynsection"> <div class="center"><img src="classsigc_1_1slot1__inherit__graph.png" border="0" usemap="#sigc_1_1slot1_3_01T__return_00_01T__arg1_01_4_inherit__map" alt="Inheritance graph"/></div> <map name="sigc_1_1slot1_3_01T__return_00_01T__arg1_01_4_inherit__map" id="sigc_1_1slot1_3_01T__return_00_01T__arg1_01_4_inherit__map"> <area shape="rect" href="classsigc_1_1slot_3_01T__return_00_01T__arg1_00_01nil_00_01nil_00_01nil_00_01nil_00_01nil_00_01nil_01_4.html" title="Convenience wrapper for the numbered sigc::slot1 template." alt="" coords="5,239,349,265"/><area shape="rect" href="classsigc_1_1slot__base.html" title="Base type for slots." alt="" coords="120,84,235,111"/><area shape="rect" href="structsigc_1_1functor__base.html" title="A hint to the compiler." alt="" coords="109,7,245,33"/></map> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <p><a href="classsigc_1_1slot1-members.html">List of all members.</a></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Public Types</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab4991fe5d80761ddab482fda9ebe6d17"></a><!-- doxytag: member="sigc::slot1::result_type" ref="ab4991fe5d80761ddab482fda9ebe6d17" args="" --> typedef T_return </td><td class="memItemRight" valign="bottom"><b>result_type</b></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1dad398bbdcf04d01cce1215d20059be"></a><!-- doxytag: member="sigc::slot1::arg1_type_" ref="a1dad398bbdcf04d01cce1215d20059be" args="" --> typedef type_trait< T_arg1 >::take </td><td class="memItemRight" valign="bottom"><b>arg1_type_</b></td></tr> <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">T_return </td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1slot1.html#a278a26f4629fb0beb286add4141c5ac8">operator()</a> (arg1_type_ _A_a1) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Invoke the contained functor unless <a class="el" href="classsigc_1_1slot.html" title="Convenience wrapper for the numbered sigc::slot# templates.">slot</a> is in blocking state. <a href="#a278a26f4629fb0beb286add4141c5ac8"></a><br/></td></tr> <tr><td class="memTemplParams" colspan="2">template<class T_functor > </td></tr> <tr><td class="memTemplItemLeft" align="right" valign="top"> </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classsigc_1_1slot1.html#abc5b60c5c3bf803b337f2a8f9c1ec5e5">slot1</a> (const T_functor& _A_func)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Constructs a <a class="el" href="classsigc_1_1slot.html" title="Convenience wrapper for the numbered sigc::slot# templates.">slot</a> from an arbitrary functor. <a href="#abc5b60c5c3bf803b337f2a8f9c1ec5e5"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac6ecaff0a20a57d2168ea126e565e36a"></a><!-- doxytag: member="sigc::slot1::slot1" ref="ac6ecaff0a20a57d2168ea126e565e36a" args="(const slot1 &src)" -->  </td><td class="memItemRight" valign="bottom"><b>slot1</b> (const <a class="el" href="classsigc_1_1slot1.html">slot1</a>& src)</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsigc_1_1slot1.html">slot1</a>& </td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1slot1.html#a2e0d65cfc434718b6c5f7d7135ac384e">operator=</a> (const <a class="el" href="classsigc_1_1slot1.html">slot1</a>& src)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Overrides this <a class="el" href="classsigc_1_1slot.html" title="Convenience wrapper for the numbered sigc::slot# templates.">slot</a> making a copy from another <a class="el" href="classsigc_1_1slot.html" title="Convenience wrapper for the numbered sigc::slot# templates.">slot</a>. <a href="#a2e0d65cfc434718b6c5f7d7135ac384e"></a><br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <h3>template <class T_return, class T_arg1><br/> class sigc::slot1< T_return, T_arg1 ></h3> <p>Converts an arbitrary functor to a unified type which is opaque. </p> <p><a class="el" href="classsigc_1_1slot.html" title="Convenience wrapper for the numbered sigc::slot# templates.">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 <a class="el" href="classsigc_1_1slot1.html#a278a26f4629fb0beb286add4141c5ac8" title="Invoke the contained functor unless slot is in blocking state.">operator()()</a>.</p> <p>The template arguments determine the function signature of <a class="el" href="classsigc_1_1slot1.html#a278a26f4629fb0beb286add4141c5ac8" title="Invoke the contained functor unless slot is in blocking state.">operator()()</a>:</p> <ul> <li><em>T_return</em> The return type of <a class="el" href="classsigc_1_1slot1.html#a278a26f4629fb0beb286add4141c5ac8" title="Invoke the contained functor unless slot is in blocking state.">operator()()</a>.</li> <li><em>T_arg1</em> Argument type used in the definition of <a class="el" href="classsigc_1_1slot1.html#a278a26f4629fb0beb286add4141c5ac8" title="Invoke the contained functor unless slot is in blocking state.">operator()()</a>. The default <code>nil</code> means no argument.</li> </ul> <p>To use simply assign the <a class="el" href="classsigc_1_1slot.html" title="Convenience wrapper for the numbered sigc::slot# templates.">slot</a> to the desired functor. If the functor is not compatible with the parameter list defined with the template arguments compiler errors are triggered. When called the <a class="el" href="classsigc_1_1slot.html" title="Convenience wrapper for the numbered sigc::slot# templates.">slot</a> will invoke the functor with minimal copies. <a class="el" href="classsigc_1_1slot__base.html#a69042c2e2b0e5449fbf8203e862192a7" title="Sets the blocking state.">block()</a> and <a class="el" href="classsigc_1_1slot__base.html#ad93eaf25fae13186a1af8f699c6004a1" title="Unsets the blocking state.">unblock()</a> can be used to block the functor's invocation from <a class="el" href="classsigc_1_1slot1.html#a278a26f4629fb0beb286add4141c5ac8" title="Invoke the contained functor unless slot is in blocking state.">operator()()</a> temporarily.</p> <p>You should use the more convenient unnumbered <a class="el" href="classsigc_1_1slot.html" title="Convenience wrapper for the numbered sigc::slot# templates.">sigc::slot</a> template. </p> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="abc5b60c5c3bf803b337f2a8f9c1ec5e5"></a><!-- doxytag: member="sigc::slot1::slot1" ref="abc5b60c5c3bf803b337f2a8f9c1ec5e5" args="(const T_functor &_A_func)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template <class T_return , class T_arg1 > </div> <div class="memtemplate"> template <class T_functor > </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="classsigc_1_1slot1.html">sigc::slot1</a>< T_return, T_arg1 >::<a class="el" href="classsigc_1_1slot1.html">slot1</a> </td> <td>(</td> <td class="paramtype">const T_functor & </td> <td class="paramname"> <em>_A_func</em></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Constructs a <a class="el" href="classsigc_1_1slot.html" title="Convenience wrapper for the numbered sigc::slot# templates.">slot</a> from an arbitrary 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_func</em> </td><td>The desirer functor the new <a class="el" href="classsigc_1_1slot.html" title="Convenience wrapper for the numbered sigc::slot# templates.">slot</a> should be assigned to. </td></tr> </table> </dd> </dl> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a278a26f4629fb0beb286add4141c5ac8"></a><!-- doxytag: member="sigc::slot1::operator()" ref="a278a26f4629fb0beb286add4141c5ac8" args="(arg1_type_ _A_a1) const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template <class T_return , class T_arg1 > </div> <table class="memname"> <tr> <td class="memname">T_return <a class="el" href="classsigc_1_1slot1.html">sigc::slot1</a>< T_return, T_arg1 >::operator() </td> <td>(</td> <td class="paramtype">arg1_type_ </td> <td class="paramname"> <em>_A_a1</em></td> <td> ) </td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Invoke the contained functor unless <a class="el" href="classsigc_1_1slot.html" title="Convenience wrapper for the numbered sigc::slot# templates.">slot</a> is in blocking state. </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_a1</em> </td><td>Argument to be passed on to the functor. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>The return value of the functor invocation. </dd></dl> </div> </div> <a class="anchor" id="a2e0d65cfc434718b6c5f7d7135ac384e"></a><!-- doxytag: member="sigc::slot1::operator=" ref="a2e0d65cfc434718b6c5f7d7135ac384e" args="(const slot1 &src)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template <class T_return , class T_arg1 > </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="classsigc_1_1slot1.html">slot1</a>& <a class="el" href="classsigc_1_1slot1.html">sigc::slot1</a>< T_return, T_arg1 >::operator= </td> <td>(</td> <td class="paramtype">const <a class="el" href="classsigc_1_1slot1.html">slot1</a>< T_return, T_arg1 >& </td> <td class="paramname"> <em>src</em></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Overrides this <a class="el" href="classsigc_1_1slot.html" title="Convenience wrapper for the numbered sigc::slot# templates.">slot</a> making a copy from another <a class="el" href="classsigc_1_1slot.html" title="Convenience wrapper for the numbered sigc::slot# templates.">slot</a>. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>src</em> </td><td>The <a class="el" href="classsigc_1_1slot.html" title="Convenience wrapper for the numbered sigc::slot# templates.">slot</a> from which to make a copy. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd><code>this</code>. </dd></dl> <p>Reimplemented from <a class="el" href="classsigc_1_1slot__base.html#a19522528264f1646f8ed982b0042ffad">sigc::slot_base</a>.</p> </div> </div> </div> <hr size="1"/><address style="text-align: right;"><small>Generated on Tue May 4 21:44:47 2010 for libsigc++ by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> </body> </html>