<!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::slot< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > 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_1slot.html">slot</a> </div> </div> <div class="contents"> <h1>sigc::slot< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > Class Template Reference<br/> <small> [<a class="el" href="group__slot.html">Slots</a>]</small> </h1><!-- doxytag: class="sigc::slot" --><!-- doxytag: inherits="sigc::slot7" --> <p>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="#_details">More...</a></p> <p><code>#include <sigc++/functors/slot.h></code></p> <div class="dynheader"> Inheritance diagram for sigc::slot< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >:</div> <div class="dynsection"> <div class="center"><img src="classsigc_1_1slot__inherit__graph.png" border="0" usemap="#sigc_1_1slot_3_01T__return_00_01T__arg1_00_01T__arg2_00_01T__arg3_00_01T__arg4_00_01T__arg5_00_01T__arg6_00_01T__arg7_01_4_inherit__map" alt="Inheritance graph"/></div> <map name="sigc_1_1slot_3_01T__return_00_01T__arg1_00_01T__arg2_00_01T__arg3_00_01T__arg4_00_01T__arg5_00_01T__arg6_00_01T__arg7_01_4_inherit__map" id="sigc_1_1slot_3_01T__return_00_01T__arg1_00_01T__arg2_00_01T__arg3_00_01T__arg4_00_01T__arg5_00_01T__arg6_00_01T__arg7_01_4_inherit__map"> <area shape="rect" href="classsigc_1_1slot7.html" title="Converts an arbitrary functor to a unified type which is opaque." alt="" coords="5,161,531,188"/><area shape="rect" href="classsigc_1_1slot__base.html" title="Base type for slots." alt="" coords="211,84,325,111"/><area shape="rect" href="structsigc_1_1functor__base.html" title="A hint to the compiler." alt="" coords="200,7,336,33"/></map> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <p><a href="classsigc_1_1slot-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="a1966941e9654adfb3af4b994fd18a7f3"></a><!-- doxytag: member="sigc::slot::parent_type" ref="a1966941e9654adfb3af4b994fd18a7f3" args="" --> typedef <a class="el" href="classsigc_1_1slot7.html">slot7</a>< T_return, <br class="typebreak"/> T_arg1, T_arg2, T_arg3, T_arg4, <br class="typebreak"/> T_arg5, T_arg6, T_arg7 > </td><td class="memItemRight" valign="bottom"><b>parent_type</b></td></tr> <tr><td colspan="2"><h2>Public Member Functions</h2></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_1slot.html#a5ef6d7b77b877fda0a67d33ea5d08c30">slot</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="#a5ef6d7b77b877fda0a67d33ea5d08c30"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac53122c7f0f1f4dd9493e9ac88837ae2"></a><!-- doxytag: member="sigc::slot::slot" ref="ac53122c7f0f1f4dd9493e9ac88837ae2" args="(const slot &src)" -->  </td><td class="memItemRight" valign="bottom"><b>slot</b> (const <a class="el" href="classsigc_1_1slot.html">slot</a>& src)</td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <h3>template <class T_return, class T_arg1 = nil, class T_arg2 = nil, class T_arg3 = nil, class T_arg4 = nil, class T_arg5 = nil, class T_arg6 = nil, class T_arg7 = nil><br/> class sigc::slot< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 ></h3> <p>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. </p> <p>Slots convert arbitrary functors to unified types which are opaque. <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_1slot7.html#a115f4dc171664e693a6bb7afc41778d4" 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_1slot7.html#a115f4dc171664e693a6bb7afc41778d4" 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_1slot7.html#a115f4dc171664e693a6bb7afc41778d4" 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_1slot7.html#a115f4dc171664e693a6bb7afc41778d4" title="Invoke the contained functor unless slot is in blocking state.">operator()()</a>. The default <code>nil</code> means no argument.</li> <li><em>T_arg2</em> Argument type used in the definition of <a class="el" href="classsigc_1_1slot7.html#a115f4dc171664e693a6bb7afc41778d4" title="Invoke the contained functor unless slot is in blocking state.">operator()()</a>. The default <code>nil</code> means no argument.</li> <li><em>T_arg3</em> Argument type used in the definition of <a class="el" href="classsigc_1_1slot7.html#a115f4dc171664e693a6bb7afc41778d4" title="Invoke the contained functor unless slot is in blocking state.">operator()()</a>. The default <code>nil</code> means no argument.</li> <li><em>T_arg4</em> Argument type used in the definition of <a class="el" href="classsigc_1_1slot7.html#a115f4dc171664e693a6bb7afc41778d4" title="Invoke the contained functor unless slot is in blocking state.">operator()()</a>. The default <code>nil</code> means no argument.</li> <li><em>T_arg5</em> Argument type used in the definition of <a class="el" href="classsigc_1_1slot7.html#a115f4dc171664e693a6bb7afc41778d4" title="Invoke the contained functor unless slot is in blocking state.">operator()()</a>. The default <code>nil</code> means no argument.</li> <li><em>T_arg6</em> Argument type used in the definition of <a class="el" href="classsigc_1_1slot7.html#a115f4dc171664e693a6bb7afc41778d4" title="Invoke the contained functor unless slot is in blocking state.">operator()()</a>. The default <code>nil</code> means no argument.</li> <li><em>T_arg7</em> Argument type used in the definition of <a class="el" href="classsigc_1_1slot7.html#a115f4dc171664e693a6bb7afc41778d4" 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_1slot7.html#a115f4dc171664e693a6bb7afc41778d4" title="Invoke the contained functor unless slot is in blocking state.">operator()()</a> temporarily.</p> <dl class="user"><dt><b>Example:</b></dt><dd><div class="fragment"><pre class="fragment"> <span class="keywordtype">void</span> foo(<span class="keywordtype">int</span>) {} <a class="code" href="classsigc_1_1slot.html" title="Convenience wrapper for the numbered sigc::slot# templates.">sigc::slot<void, long></a> s = <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>(&foo); s(19); </pre></div> </dd></dl> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a5ef6d7b77b877fda0a67d33ea5d08c30"></a><!-- doxytag: member="sigc::slot::slot" ref="a5ef6d7b77b877fda0a67d33ea5d08c30" args="(const T_functor &_A_func)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template <class T_return, class T_arg1 = nil, class T_arg2 = nil, class T_arg3 = nil, class T_arg4 = nil, class T_arg5 = nil, class T_arg6 = nil, class T_arg7 = nil> </div> <div class="memtemplate"> template <class T_functor > </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="classsigc_1_1slot.html">sigc::slot</a>< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::<a class="el" href="classsigc_1_1slot.html">slot</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> </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>