1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
|
<!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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>libsigc++: sigc::const_limit_reference< T_type, I_derives_trackable > Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">libsigc++
 <span id="projectnumber">2.10.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</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 id="navrow2" class="tabs2">
<ul class="tablist">
<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="inherits.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacesigc.html">sigc</a></li><li class="navelem"><a class="el" href="classsigc_1_1const__limit__reference.html">const_limit_reference</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="classsigc_1_1const__limit__reference-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">sigc::const_limit_reference< T_type, I_derives_trackable > Class Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>A const_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.
<a href="classsigc_1_1const__limit__reference.html#details">More...</a></p>
<p><code>#include <sigc++/limit_reference.h></code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:acee8a4c09720730cd5f66696fd018b4c"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1const__limit__reference.html#acee8a4c09720730cd5f66696fd018b4c">const_limit_reference</a> (const T_type& _A_target)</td></tr>
<tr class="memdesc:acee8a4c09720730cd5f66696fd018b4c"><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#acee8a4c09720730cd5f66696fd018b4c">More...</a><br /></td></tr>
<tr class="separator:acee8a4c09720730cd5f66696fd018b4c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2cb583845b99f2fdb56297bc6dff57d0"><td class="memItemLeft" align="right" valign="top">const T_type& </td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1const__limit__reference.html#a2cb583845b99f2fdb56297bc6dff57d0">invoke</a> () const </td></tr>
<tr class="memdesc:a2cb583845b99f2fdb56297bc6dff57d0"><td class="mdescLeft"> </td><td class="mdescRight">Retrieve the reference. <a href="#a2cb583845b99f2fdb56297bc6dff57d0">More...</a><br /></td></tr>
<tr class="separator:a2cb583845b99f2fdb56297bc6dff57d0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9518c78a342f7d4bba9ca01b129c894d"><td class="memItemLeft" align="right" valign="top">const T_type& </td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1const__limit__reference.html#a9518c78a342f7d4bba9ca01b129c894d">visit</a> () const </td></tr>
<tr class="memdesc:a9518c78a342f7d4bba9ca01b129c894d"><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="#a9518c78a342f7d4bba9ca01b129c894d">More...</a><br /></td></tr>
<tr class="separator:a9518c78a342f7d4bba9ca01b129c894d"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template<class T_type, bool I_derives_trackable = std::is_base_of<trackable, T_type>::value><br />
class sigc::const_limit_reference< T_type, I_derives_trackable ></h3>
<p>A const_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>
<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>
<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_1const__limit__reference.html#a2cb583845b99f2fdb56297bc6dff57d0" 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_1const__limit__reference.html#a9518c78a342f7d4bba9ca01b129c894d" title="Retrieve the entity to visit for visit_each(). ">visit()</a>.</p>
<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_1const__limit__reference.html#a2cb583845b99f2fdb56297bc6dff57d0" title="Retrieve the reference. ">invoke()</a> and <a class="el" href="classsigc_1_1const__limit__reference.html#a9518c78a342f7d4bba9ca01b129c894d" title="Retrieve the entity to visit for visit_each(). ">visit()</a> just return the derived reference.</p>
<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>
<ul>
<li><em>T_type</em> The type of the reference. </li>
</ul>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a class="anchor" id="acee8a4c09720730cd5f66696fd018b4c"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template <class T_type, bool I_derives_trackable = std::is_base_of<trackable, T_type>::value> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsigc_1_1const__limit__reference.html">sigc::const_limit_reference</a>< T_type, I_derives_trackable >::<a class="el" href="classsigc_1_1const__limit__reference.html">const_limit_reference</a> </td>
<td>(</td>
<td class="paramtype">const T_type & </td>
<td class="paramname"><em>_A_target</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">_A_target</td><td>The reference to limit. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a2cb583845b99f2fdb56297bc6dff57d0"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template <class T_type, bool I_derives_trackable = std::is_base_of<trackable, T_type>::value> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const T_type& <a class="el" href="classsigc_1_1const__limit__reference.html">sigc::const_limit_reference</a>< T_type, I_derives_trackable >::invoke </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieve the reference. </p>
<p>This is always a reference to the derived instance. </p><dl class="section return"><dt>Returns</dt><dd>The reference. </dd></dl>
</div>
</div>
<a class="anchor" id="a9518c78a342f7d4bba9ca01b129c894d"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template <class T_type, bool I_derives_trackable = std::is_base_of<trackable, T_type>::value> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const T_type& <a class="el" href="classsigc_1_1const__limit__reference.html">sigc::const_limit_reference</a>< T_type, I_derives_trackable >::visit </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<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>
<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>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Sep 20 2016 12:13:57 for libsigc++ by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
|