1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.9.1"/>
7 <meta name="viewport" content="width=device-width, initial-scale=1"/>
8 <title>libsigc++: sigc::volatile_limit_reference< T_type, I_derives_trackable > Class Template Reference</title>
9 <link href="tabs.css" rel="stylesheet" type="text/css"/>
10 <script type="text/javascript" src="jquery.js"></script>
11 <script type="text/javascript" src="dynsections.js"></script>
12 <link href="doxygen.css" rel="stylesheet" type="text/css" />
13 <link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
16 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
18 <table cellspacing="0" cellpadding="0">
20 <tr style="height: 56px;">
21 <td id="projectalign" style="padding-left: 0.5em;">
22 <div id="projectname">libsigc++
23  <span id="projectnumber">2.10.8</span>
30 <!-- end header part -->
31 <!-- Generated by Doxygen 1.9.1 -->
32 <script type="text/javascript" src="menudata.js"></script>
33 <script type="text/javascript" src="menu.js"></script>
34 <script type="text/javascript">
35 /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
37 initMenu('',false,false,'search.php','Search');
39 /* @license-end */</script>
40 <div id="main-nav"></div>
41 <div id="nav-path" class="navpath">
43 <li class="navelem"><a class="el" href="namespacesigc.html">sigc</a></li><li class="navelem"><a class="el" href="classsigc_1_1volatile__limit__reference.html">volatile_limit_reference</a></li> </ul>
48 <a href="#pub-methods">Public Member Functions</a> |
49 <a href="classsigc_1_1volatile__limit__reference-members.html">List of all members</a> </div>
50 <div class="headertitle">
51 <div class="title">sigc::volatile_limit_reference< T_type, I_derives_trackable > Class Template Reference</div> </div>
53 <div class="contents">
55 <p>A volatile_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.
56 <a href="classsigc_1_1volatile__limit__reference.html#details">More...</a></p>
58 <p><code>#include <sigc++/limit_reference.h></code></p>
59 <table class="memberdecls">
60 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
61 Public Member Functions</h2></td></tr>
62 <tr class="memitem:acb3e6e1ecc628343f94faae718b58066"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1volatile__limit__reference.html#acb3e6e1ecc628343f94faae718b58066">volatile_limit_reference</a> (T_type & _A_target)</td></tr>
63 <tr class="memdesc:acb3e6e1ecc628343f94faae718b58066"><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="classsigc_1_1volatile__limit__reference.html#acb3e6e1ecc628343f94faae718b58066">More...</a><br /></td></tr>
64 <tr class="separator:acb3e6e1ecc628343f94faae718b58066"><td class="memSeparator" colspan="2"> </td></tr>
65 <tr class="memitem:a0157cc89d9db4032c7a8f9159ebaeff3"><td class="memItemLeft" align="right" valign="top">volatile T_type & </td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1volatile__limit__reference.html#a0157cc89d9db4032c7a8f9159ebaeff3">invoke</a> () const</td></tr>
66 <tr class="memdesc:a0157cc89d9db4032c7a8f9159ebaeff3"><td class="mdescLeft"> </td><td class="mdescRight">Retrieve the reference. <a href="classsigc_1_1volatile__limit__reference.html#a0157cc89d9db4032c7a8f9159ebaeff3">More...</a><br /></td></tr>
67 <tr class="separator:a0157cc89d9db4032c7a8f9159ebaeff3"><td class="memSeparator" colspan="2"> </td></tr>
68 <tr class="memitem:a4d67fe2d9d27c326136a9e5ac13a1a75"><td class="memItemLeft" align="right" valign="top">const T_type & </td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1volatile__limit__reference.html#a4d67fe2d9d27c326136a9e5ac13a1a75">visit</a> () const</td></tr>
69 <tr class="memdesc:a4d67fe2d9d27c326136a9e5ac13a1a75"><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="classsigc_1_1volatile__limit__reference.html#a4d67fe2d9d27c326136a9e5ac13a1a75">More...</a><br /></td></tr>
70 <tr class="separator:a4d67fe2d9d27c326136a9e5ac13a1a75"><td class="memSeparator" colspan="2"> </td></tr>
72 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
73 <div class="textblock"><h3>template<class T_type, bool I_derives_trackable = std::is_base_of<trackable, T_type>::value><br />
74 class sigc::volatile_limit_reference< T_type, I_derives_trackable ></h3>
76 <p>A volatile_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>
77 <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>
78 <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_1volatile__limit__reference.html#a0157cc89d9db4032c7a8f9159ebaeff3" 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_1volatile__limit__reference.html#a4d67fe2d9d27c326136a9e5ac13a1a75" title="Retrieve the entity to visit for visit_each().">visit()</a>.</p>
79 <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_1volatile__limit__reference.html#a0157cc89d9db4032c7a8f9159ebaeff3" title="Retrieve the reference.">invoke()</a> and <a class="el" href="classsigc_1_1volatile__limit__reference.html#a4d67fe2d9d27c326136a9e5ac13a1a75" title="Retrieve the entity to visit for visit_each().">visit()</a> just return the derived reference.</p>
80 <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>
82 <li><em>T_type</em> The type of the reference. </li>
84 </div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
85 <a id="acb3e6e1ecc628343f94faae718b58066"></a>
86 <h2 class="memtitle"><span class="permalink"><a href="#acb3e6e1ecc628343f94faae718b58066">◆ </a></span>volatile_limit_reference()</h2>
89 <div class="memproto">
90 <div class="memtemplate">
91 template <class T_type , bool I_derives_trackable = std::is_base_of<trackable, T_type>::value> </div>
92 <table class="mlabels">
94 <td class="mlabels-left">
95 <table class="memname">
97 <td class="memname"><a class="el" href="classsigc_1_1volatile__limit__reference.html">sigc::volatile_limit_reference</a>< T_type, I_derives_trackable >::<a class="el" href="classsigc_1_1volatile__limit__reference.html">volatile_limit_reference</a> </td>
99 <td class="paramtype">T_type & </td>
100 <td class="paramname"><em>_A_target</em></td><td>)</td>
105 <td class="mlabels-right">
106 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
109 </div><div class="memdoc">
112 <dl class="params"><dt>Parameters</dt><dd>
113 <table class="params">
114 <tr><td class="paramname">_A_target</td><td>The reference to limit. </td></tr>
121 <h2 class="groupheader">Member Function Documentation</h2>
122 <a id="a0157cc89d9db4032c7a8f9159ebaeff3"></a>
123 <h2 class="memtitle"><span class="permalink"><a href="#a0157cc89d9db4032c7a8f9159ebaeff3">◆ </a></span>invoke()</h2>
125 <div class="memitem">
126 <div class="memproto">
127 <div class="memtemplate">
128 template <class T_type , bool I_derives_trackable = std::is_base_of<trackable, T_type>::value> </div>
129 <table class="mlabels">
131 <td class="mlabels-left">
132 <table class="memname">
134 <td class="memname">volatile T_type& <a class="el" href="classsigc_1_1volatile__limit__reference.html">sigc::volatile_limit_reference</a>< T_type, I_derives_trackable >::invoke </td>
136 <td class="paramname"></td><td>)</td>
141 <td class="mlabels-right">
142 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
145 </div><div class="memdoc">
147 <p>Retrieve the reference. </p>
148 <p>This is always a reference to the derived instance. </p><dl class="section return"><dt>Returns</dt><dd>The reference. </dd></dl>
152 <a id="a4d67fe2d9d27c326136a9e5ac13a1a75"></a>
153 <h2 class="memtitle"><span class="permalink"><a href="#a4d67fe2d9d27c326136a9e5ac13a1a75">◆ </a></span>visit()</h2>
155 <div class="memitem">
156 <div class="memproto">
157 <div class="memtemplate">
158 template <class T_type , bool I_derives_trackable = std::is_base_of<trackable, T_type>::value> </div>
159 <table class="mlabels">
161 <td class="mlabels-left">
162 <table class="memname">
164 <td class="memname">const T_type& <a class="el" href="classsigc_1_1volatile__limit__reference.html">sigc::volatile_limit_reference</a>< T_type, I_derives_trackable >::visit </td>
166 <td class="paramname"></td><td>)</td>
171 <td class="mlabels-right">
172 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
175 </div><div class="memdoc">
177 <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>
178 <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>
182 </div><!-- contents -->
183 <!-- start footer part -->
184 <hr class="footer"/><address class="footer"><small>
185 Generated on Fri Feb 11 2022 15:40:59 for libsigc++ by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1