Imported Upstream version 2.9.2
[platform/upstream/libsigc++.git] / docs / reference / html / classsigc_1_1limit__reference.html
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">
3 <head>
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&lt; T_type, I_derives_trackable &gt; 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"/>
13 </head>
14 <body>
15 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
16 <div id="titlearea">
17 <table cellspacing="0" cellpadding="0">
18  <tbody>
19  <tr style="height: 56px;">
20   <td style="padding-left: 0.5em;">
21    <div id="projectname">libsigc++
22    &#160;<span id="projectnumber">2.9.2</span>
23    </div>
24   </td>
25  </tr>
26  </tbody>
27 </table>
28 </div>
29 <!-- end header part -->
30 <!-- Generated by Doxygen 1.8.9.1 -->
31   <div id="navrow1" class="tabs">
32     <ul class="tablist">
33       <li><a href="index.html"><span>Main&#160;Page</span></a></li>
34       <li><a href="pages.html"><span>Related&#160;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>
38     </ul>
39   </div>
40   <div id="navrow2" class="tabs2">
41     <ul class="tablist">
42       <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
43       <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
44       <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
45       <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
46     </ul>
47   </div>
48 <div id="nav-path" class="navpath">
49   <ul>
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>
51 </div>
52 </div><!-- top -->
53 <div class="header">
54   <div class="summary">
55 <a href="#pub-methods">Public Member Functions</a> &#124;
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&lt; T_type, I_derives_trackable &gt; Class Template Reference</div>  </div>
59 </div><!--header-->
60 <div class="contents">
61
62 <p>A limit_reference&lt;Foo&gt; object stores a reference (Foo&amp;), 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&lt;&gt;()</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>
64
65 <p><code>#include &lt;sigc++/limit_reference.h&gt;</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">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsigc_1_1limit__reference.html#a58bf17e1eaa63d86336c831fa885bc66">limit_reference</a> (T_type&amp; _A_target)</td></tr>
70 <tr class="memdesc:a58bf17e1eaa63d86336c831fa885bc66"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="#a58bf17e1eaa63d86336c831fa885bc66">More...</a><br /></td></tr>
71 <tr class="separator:a58bf17e1eaa63d86336c831fa885bc66"><td class="memSeparator" colspan="2">&#160;</td></tr>
72 <tr class="memitem:a951ae1d15397406945d4a6b67f30936f"><td class="memItemLeft" align="right" valign="top">T_type&amp;&#160;</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">&#160;</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">&#160;</td></tr>
75 <tr class="memitem:a66b544da149f382aed7f66353d7b06ae"><td class="memItemLeft" align="right" valign="top">const T_type&amp;&#160;</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">&#160;</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">&#160;</td></tr>
78 </table>
79 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
80 <div class="textblock"><h3>template&lt;class T_type, bool I_derives_trackable = std::is_base_of&lt;trackable, T_type&gt;::value&gt;<br />
81 class sigc::limit_reference&lt; T_type, I_derives_trackable &gt;</h3>
82
83 <p>A limit_reference&lt;Foo&gt; object stores a reference (Foo&amp;), 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&lt;&gt;()</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>
88 <ul>
89 <li><em>T_type</em> The type of the reference. </li>
90 </ul>
91 </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
92 <a class="anchor" id="a58bf17e1eaa63d86336c831fa885bc66"></a>
93 <div class="memitem">
94 <div class="memproto">
95 <div class="memtemplate">
96 template &lt;class T_type, bool I_derives_trackable = std::is_base_of&lt;trackable, T_type&gt;::value&gt; </div>
97 <table class="mlabels">
98   <tr>
99   <td class="mlabels-left">
100       <table class="memname">
101         <tr>
102           <td class="memname"><a class="el" href="classsigc_1_1limit__reference.html">sigc::limit_reference</a>&lt; T_type, I_derives_trackable &gt;::<a class="el" href="classsigc_1_1limit__reference.html">limit_reference</a> </td>
103           <td>(</td>
104           <td class="paramtype">T_type &amp;&#160;</td>
105           <td class="paramname"><em>_A_target</em></td><td>)</td>
106           <td></td>
107         </tr>
108       </table>
109   </td>
110   <td class="mlabels-right">
111 <span class="mlabels"><span class="mlabel">inline</span></span>  </td>
112   </tr>
113 </table>
114 </div><div class="memdoc">
115
116 <p>Constructor. </p>
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>
120   </table>
121   </dd>
122 </dl>
123
124 </div>
125 </div>
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 &lt;class T_type, bool I_derives_trackable = std::is_base_of&lt;trackable, T_type&gt;::value&gt; </div>
132 <table class="mlabels">
133   <tr>
134   <td class="mlabels-left">
135       <table class="memname">
136         <tr>
137           <td class="memname">T_type&amp; <a class="el" href="classsigc_1_1limit__reference.html">sigc::limit_reference</a>&lt; T_type, I_derives_trackable &gt;::invoke </td>
138           <td>(</td>
139           <td class="paramname"></td><td>)</td>
140           <td> const</td>
141         </tr>
142       </table>
143   </td>
144   <td class="mlabels-right">
145 <span class="mlabels"><span class="mlabel">inline</span></span>  </td>
146   </tr>
147 </table>
148 </div><div class="memdoc">
149
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>
152
153 </div>
154 </div>
155 <a class="anchor" id="a66b544da149f382aed7f66353d7b06ae"></a>
156 <div class="memitem">
157 <div class="memproto">
158 <div class="memtemplate">
159 template &lt;class T_type, bool I_derives_trackable = std::is_base_of&lt;trackable, T_type&gt;::value&gt; </div>
160 <table class="mlabels">
161   <tr>
162   <td class="mlabels-left">
163       <table class="memname">
164         <tr>
165           <td class="memname">const T_type&amp; <a class="el" href="classsigc_1_1limit__reference.html">sigc::limit_reference</a>&lt; T_type, I_derives_trackable &gt;::visit </td>
166           <td>(</td>
167           <td class="paramname"></td><td>)</td>
168           <td> const</td>
169         </tr>
170       </table>
171   </td>
172   <td class="mlabels-right">
173 <span class="mlabels"><span class="mlabel">inline</span></span>  </td>
174   </tr>
175 </table>
176 </div><div class="memdoc">
177
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>&amp; 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>
180
181 </div>
182 </div>
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 &#160;<a href="http://www.doxygen.org/index.html">
187 <img class="footer" src="doxygen.png" alt="doxygen"/>
188 </a> 1.8.9.1
189 </small></address>
190 </body>
191 </html>