1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
6 <meta name="generator" content="Doxygen 1.8.9.1"/>
7 <title>libsigc++: sigc::limit_reference< T_type, I_derives_trackable > Class Template Reference</title>
8 <link href="tabs.css" rel="stylesheet" type="text/css"/>
9 <script type="text/javascript" src="jquery.js"></script>
10 <script type="text/javascript" src="dynsections.js"></script>
11 <link href="doxygen.css" rel="stylesheet" type="text/css" />
12 <link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
15 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
17 <table cellspacing="0" cellpadding="0">
19 <tr style="height: 56px;">
20 <td style="padding-left: 0.5em;">
21 <div id="projectname">libsigc++
22  <span id="projectnumber">2.9.2</span>
29 <!-- end header part -->
30 <!-- Generated by Doxygen 1.8.9.1 -->
31 <div id="navrow1" class="tabs">
33 <li><a href="index.html"><span>Main Page</span></a></li>
34 <li><a href="pages.html"><span>Related Pages</span></a></li>
35 <li><a href="modules.html"><span>Modules</span></a></li>
36 <li><a href="namespaces.html"><span>Namespaces</span></a></li>
37 <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
40 <div id="navrow2" class="tabs2">
42 <li><a href="annotated.html"><span>Class List</span></a></li>
43 <li><a href="classes.html"><span>Class Index</span></a></li>
44 <li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
45 <li><a href="functions.html"><span>Class Members</span></a></li>
48 <div id="nav-path" class="navpath">
50 <li class="navelem"><a class="el" href="namespacesigc.html">sigc</a></li><li class="navelem"><a class="el" href="classsigc_1_1limit__reference.html">limit_reference</a></li> </ul>
55 <a href="#pub-methods">Public Member Functions</a> |
56 <a href="classsigc_1_1limit__reference-members.html">List of all members</a> </div>
57 <div class="headertitle">
58 <div class="title">sigc::limit_reference< T_type, I_derives_trackable > Class Template Reference</div> </div>
60 <div class="contents">
62 <p>A limit_reference<Foo> object stores a reference (Foo&), but make sure that, if Foo inherits from <a class="el" href="structsigc_1_1trackable.html" title="Base class for objects with auto-disconnection. ">sigc::trackable</a>, then <a class="el" href="group__sigcfunctors.html#ga64cb7832acc1e58efb5ffe0b4f5e9404" title="This function performs a functor on each of the targets of a functor. ">visit_each<>()</a> will "limit" itself to the <a class="el" href="structsigc_1_1trackable.html" title="Base class for objects with auto-disconnection. ">sigc::trackable</a> reference instead of the derived reference.
63 <a href="classsigc_1_1limit__reference.html#details">More...</a></p>
65 <p><code>#include <sigc++/limit_reference.h></code></p>
66 <table class="memberdecls">
67 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
68 Public Member Functions</h2></td></tr>
69 <tr class="memitem:a58bf17e1eaa63d86336c831fa885bc66"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1limit__reference.html#a58bf17e1eaa63d86336c831fa885bc66">limit_reference</a> (T_type& _A_target)</td></tr>
70 <tr class="memdesc:a58bf17e1eaa63d86336c831fa885bc66"><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#a58bf17e1eaa63d86336c831fa885bc66">More...</a><br /></td></tr>
71 <tr class="separator:a58bf17e1eaa63d86336c831fa885bc66"><td class="memSeparator" colspan="2"> </td></tr>
72 <tr class="memitem:a951ae1d15397406945d4a6b67f30936f"><td class="memItemLeft" align="right" valign="top">T_type& </td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1limit__reference.html#a951ae1d15397406945d4a6b67f30936f">invoke</a> () const </td></tr>
73 <tr class="memdesc:a951ae1d15397406945d4a6b67f30936f"><td class="mdescLeft"> </td><td class="mdescRight">Retrieve the reference. <a href="#a951ae1d15397406945d4a6b67f30936f">More...</a><br /></td></tr>
74 <tr class="separator:a951ae1d15397406945d4a6b67f30936f"><td class="memSeparator" colspan="2"> </td></tr>
75 <tr class="memitem:a66b544da149f382aed7f66353d7b06ae"><td class="memItemLeft" align="right" valign="top">const T_type& </td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1limit__reference.html#a66b544da149f382aed7f66353d7b06ae">visit</a> () const </td></tr>
76 <tr class="memdesc:a66b544da149f382aed7f66353d7b06ae"><td class="mdescLeft"> </td><td class="mdescRight">Retrieve the entity to visit for <a class="el" href="group__sigcfunctors.html#ga64cb7832acc1e58efb5ffe0b4f5e9404" title="This function performs a functor on each of the targets of a functor. ">visit_each()</a>. <a href="#a66b544da149f382aed7f66353d7b06ae">More...</a><br /></td></tr>
77 <tr class="separator:a66b544da149f382aed7f66353d7b06ae"><td class="memSeparator" colspan="2"> </td></tr>
79 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
80 <div class="textblock"><h3>template<class T_type, bool I_derives_trackable = std::is_base_of<trackable, T_type>::value><br />
81 class sigc::limit_reference< T_type, I_derives_trackable ></h3>
83 <p>A limit_reference<Foo> object stores a reference (Foo&), but make sure that, if Foo inherits from <a class="el" href="structsigc_1_1trackable.html" title="Base class for objects with auto-disconnection. ">sigc::trackable</a>, then <a class="el" href="group__sigcfunctors.html#ga64cb7832acc1e58efb5ffe0b4f5e9404" title="This function performs a functor on each of the targets of a functor. ">visit_each<>()</a> will "limit" itself to the <a class="el" href="structsigc_1_1trackable.html" title="Base class for objects with auto-disconnection. ">sigc::trackable</a> reference instead of the derived reference. </p>
84 <p>This avoids use of a reference to the derived type when the derived destructor has run. That can be a problem when using virtual inheritance.</p>
85 <p>If Foo inherits from trackable then both the derived reference and the <a class="el" href="structsigc_1_1trackable.html" title="Base class for objects with auto-disconnection. ">sigc::trackable</a> reference are stored, so we can later retrieve the <a class="el" href="structsigc_1_1trackable.html" title="Base class for objects with auto-disconnection. ">sigc::trackable</a> reference without doing an implicit conversion. To retrieve the derived reference (so that you invoke methods or members of it), use <a class="el" href="classsigc_1_1limit__reference.html#a951ae1d15397406945d4a6b67f30936f" title="Retrieve the reference. ">invoke()</a>. To retrieve the trackable reference (so that you can call <a class="el" href="group__sigcfunctors.html#ga64cb7832acc1e58efb5ffe0b4f5e9404" title="This function performs a functor on each of the targets of a functor. ">visit_each()</a> on it), you use <a class="el" href="classsigc_1_1limit__reference.html#a66b544da149f382aed7f66353d7b06ae" title="Retrieve the entity to visit for visit_each(). ">visit()</a>.</p>
86 <p>If Foo does not inherit from <a class="el" href="structsigc_1_1trackable.html" title="Base class for objects with auto-disconnection. ">sigc::trackable</a> then <a class="el" href="classsigc_1_1limit__reference.html#a951ae1d15397406945d4a6b67f30936f" title="Retrieve the reference. ">invoke()</a> and <a class="el" href="classsigc_1_1limit__reference.html#a66b544da149f382aed7f66353d7b06ae" title="Retrieve the entity to visit for visit_each(). ">visit()</a> just return the derived reference.</p>
87 <p>This is used for bound (<a class="el" href="group__bind.html#ga2f099bc6056b32f2a58134ba8537c6f4" title="Creates an adaptor of type sigc::bind_functor which binds the passed argument to the passed functor...">sigc::bind</a>) slot parameters (via <a class="el" href="classsigc_1_1bound__argument.html" title="A bound_argument<Foo> object stores a bound (for instance, with sigc::bind(), or sigc::bind_return())...">bound_argument</a>), bound return values, and, with <a class="el" href="group__mem__fun.html#gadf6b6d22c503b439019f0a2e77352419" title="Creates a functor of type sigc::mem_functor0 which wraps a method. ">mem_fun()</a>, the reference to the handling object.</p>
89 <li><em>T_type</em> The type of the reference. </li>
91 </div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
92 <a class="anchor" id="a58bf17e1eaa63d86336c831fa885bc66"></a>
94 <div class="memproto">
95 <div class="memtemplate">
96 template <class T_type, bool I_derives_trackable = std::is_base_of<trackable, T_type>::value> </div>
97 <table class="mlabels">
99 <td class="mlabels-left">
100 <table class="memname">
102 <td class="memname"><a class="el" href="classsigc_1_1limit__reference.html">sigc::limit_reference</a>< T_type, I_derives_trackable >::<a class="el" href="classsigc_1_1limit__reference.html">limit_reference</a> </td>
104 <td class="paramtype">T_type & </td>
105 <td class="paramname"><em>_A_target</em></td><td>)</td>
110 <td class="mlabels-right">
111 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
114 </div><div class="memdoc">
117 <dl class="params"><dt>Parameters</dt><dd>
118 <table class="params">
119 <tr><td class="paramname">_A_target</td><td>The reference to limit. </td></tr>
126 <h2 class="groupheader">Member Function Documentation</h2>
127 <a class="anchor" id="a951ae1d15397406945d4a6b67f30936f"></a>
128 <div class="memitem">
129 <div class="memproto">
130 <div class="memtemplate">
131 template <class T_type, bool I_derives_trackable = std::is_base_of<trackable, T_type>::value> </div>
132 <table class="mlabels">
134 <td class="mlabels-left">
135 <table class="memname">
137 <td class="memname">T_type& <a class="el" href="classsigc_1_1limit__reference.html">sigc::limit_reference</a>< T_type, I_derives_trackable >::invoke </td>
139 <td class="paramname"></td><td>)</td>
144 <td class="mlabels-right">
145 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
148 </div><div class="memdoc">
150 <p>Retrieve the reference. </p>
151 <p>This is always a reference to the derived instance. </p><dl class="section return"><dt>Returns</dt><dd>The reference. </dd></dl>
155 <a class="anchor" id="a66b544da149f382aed7f66353d7b06ae"></a>
156 <div class="memitem">
157 <div class="memproto">
158 <div class="memtemplate">
159 template <class T_type, bool I_derives_trackable = std::is_base_of<trackable, T_type>::value> </div>
160 <table class="mlabels">
162 <td class="mlabels-left">
163 <table class="memname">
165 <td class="memname">const T_type& <a class="el" href="classsigc_1_1limit__reference.html">sigc::limit_reference</a>< T_type, I_derives_trackable >::visit </td>
167 <td class="paramname"></td><td>)</td>
172 <td class="mlabels-right">
173 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
176 </div><div class="memdoc">
178 <p>Retrieve the entity to visit for <a class="el" href="group__sigcfunctors.html#ga64cb7832acc1e58efb5ffe0b4f5e9404" title="This function performs a functor on each of the targets of a functor. ">visit_each()</a>. </p>
179 <p>Depending on the template specialization, this is either a derived reference, or <a class="el" href="structsigc_1_1trackable.html" title="Base class for objects with auto-disconnection. ">sigc::trackable</a>& if T_type derives from <a class="el" href="structsigc_1_1trackable.html" title="Base class for objects with auto-disconnection. ">sigc::trackable</a>. </p><dl class="section return"><dt>Returns</dt><dd>The reference. </dd></dl>
183 </div><!-- contents -->
184 <!-- start footer part -->
185 <hr class="footer"/><address class="footer"><small>
186 Generated on Fri Apr 8 2016 10:54:31 for libsigc++ by  <a href="http://www.doxygen.org/index.html">
187 <img class="footer" src="doxygen.png" alt="doxygen"/>