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
|
<!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"/>
<title>wxWidgets: wxScopedTiedPtr Class 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="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="page_container">
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0" style="width: 100%;">
<tbody>
<tr>
<td id="projectlogo">
<a href="http://www.wxwidgets.org/" target="_new">
<img alt="wxWidgets" src="logo.png"/>
</a>
</td>
<td style="padding-left: 0.5em; text-align: right;">
<span id="projectnumber">Version: 3.0.2</span>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.8.2 -->
<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>Categories</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</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="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="classwx_scoped_tied_ptr-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">wxScopedTiedPtr Class Reference<div class="ingroups"><a class="el" href="group__group__class__smartpointers.html">Smart Pointers</a></div></div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include <wx/scopedptr.h></code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for wxScopedTiedPtr:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="classwx_scoped_tied_ptr__inherit__graph.png" border="0" usemap="#wx_scoped_tied_ptr_inherit__map" alt="Inheritance graph"/></div>
<map name="wx_scoped_tied_ptr_inherit__map" id="wx_scoped_tied_ptr_inherit__map">
<area shape="rect" id="node2" href="classwx_scoped_ptr.html" title="This is a simple scoped smart pointer implementation that is similar to the Boost smart pointers (see..." alt="" coords="17,6,116,34"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This is a variation on the topic of <a class="el" href="classwx_scoped_ptr.html" title="This is a simple scoped smart pointer implementation that is similar to the Boost smart pointers (see...">wxScopedPtr</a>. </p>
<p>This class is also a smart pointer but in addition it "ties" the pointer value to another variable. In other words, during the life time of this class the value of that variable is set to be the same as the value of the pointer itself and it is reset to its old value when the object is destroyed. This class is especially useful when converting the existing code (which may already store the pointers value in some variable) to the smart pointers.</p>
<h2></h2>
<div><span class="lib">Library:</span>  <span class="lib_text"><a class="el" href="page_libs.html#page_libs_wxbase">wxBase</a></span></div><div><span class="category">Category:</span>  <span class="category_text"><a class="el" href="group__group__class__smartpointers.html">Smart Pointers</a></span></div> </div><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:a2dc579447d98ab3eac0cf92d6fbca18a"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_scoped_tied_ptr.html#a2dc579447d98ab3eac0cf92d6fbca18a">wxScopedTiedPtr</a> (T **ppTie, T *ptr)</td></tr>
<tr class="memdesc:a2dc579447d98ab3eac0cf92d6fbca18a"><td class="mdescLeft"> </td><td class="mdescRight">Constructor creates a smart pointer initialized with <em>ptr</em> and stores <em>ptr</em> in the location specified by <em>ppTie</em> which must not be <span class="literal">NULL</span>. <a href="#a2dc579447d98ab3eac0cf92d6fbca18a"></a><br/></td></tr>
<tr class="separator:a2dc579447d98ab3eac0cf92d6fbca18a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abbc9e9f23fef38c4fac5ed8d1b9e6c86"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_scoped_tied_ptr.html#abbc9e9f23fef38c4fac5ed8d1b9e6c86">~wxScopedTiedPtr</a> ()</td></tr>
<tr class="memdesc:abbc9e9f23fef38c4fac5ed8d1b9e6c86"><td class="mdescLeft"> </td><td class="mdescRight">Destructor frees the pointer help by this object and restores the value stored at the tied location (as specified in the <a class="el" href="classwx_scoped_tied_ptr.html#a2dc579447d98ab3eac0cf92d6fbca18a">wxScopedTiedPtr()</a> constructor) to the old value. <a href="#abbc9e9f23fef38c4fac5ed8d1b9e6c86"></a><br/></td></tr>
<tr class="separator:abbc9e9f23fef38c4fac5ed8d1b9e6c86"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_classwx_scoped_ptr"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classwx_scoped_ptr')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classwx_scoped_ptr.html">wxScopedPtr</a></td></tr>
<tr class="memitem:a30fbfa2b44f99f62320b744b113144d8 inherit pub_methods_classwx_scoped_ptr"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_scoped_ptr.html#a30fbfa2b44f99f62320b744b113144d8">wxScopedPtr</a> (type *T=NULL)</td></tr>
<tr class="memdesc:a30fbfa2b44f99f62320b744b113144d8 inherit pub_methods_classwx_scoped_ptr"><td class="mdescLeft"> </td><td class="mdescRight">Creates the smart pointer with the given pointer or none if <span class="literal">NULL</span>. <a href="#a30fbfa2b44f99f62320b744b113144d8"></a><br/></td></tr>
<tr class="separator:a30fbfa2b44f99f62320b744b113144d8 inherit pub_methods_classwx_scoped_ptr"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae824b3ae060054eb348a93c9004269a4 inherit pub_methods_classwx_scoped_ptr"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_scoped_ptr.html#ae824b3ae060054eb348a93c9004269a4">~wxScopedPtr</a> ()</td></tr>
<tr class="memdesc:ae824b3ae060054eb348a93c9004269a4 inherit pub_methods_classwx_scoped_ptr"><td class="mdescLeft"> </td><td class="mdescRight">Destructor frees the pointer help by this object if it is not <span class="literal">NULL</span>. <a href="#ae824b3ae060054eb348a93c9004269a4"></a><br/></td></tr>
<tr class="separator:ae824b3ae060054eb348a93c9004269a4 inherit pub_methods_classwx_scoped_ptr"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3ccb3a9b7842b33dd7f05f0f425118ea inherit pub_methods_classwx_scoped_ptr"><td class="memItemLeft" align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_scoped_ptr.html#a3ccb3a9b7842b33dd7f05f0f425118ea">get</a> () const </td></tr>
<tr class="memdesc:a3ccb3a9b7842b33dd7f05f0f425118ea inherit pub_methods_classwx_scoped_ptr"><td class="mdescLeft"> </td><td class="mdescRight">This operator gets the pointer stored in the smart pointer or returns <span class="literal">NULL</span> if there is none. <a href="#a3ccb3a9b7842b33dd7f05f0f425118ea"></a><br/></td></tr>
<tr class="separator:a3ccb3a9b7842b33dd7f05f0f425118ea inherit pub_methods_classwx_scoped_ptr"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad7209afd14b11f0ae06102b59fcfa47f inherit pub_methods_classwx_scoped_ptr"><td class="memItemLeft" align="right" valign="top">T & </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_scoped_ptr.html#ad7209afd14b11f0ae06102b59fcfa47f">operator*</a> () const </td></tr>
<tr class="memdesc:ad7209afd14b11f0ae06102b59fcfa47f inherit pub_methods_classwx_scoped_ptr"><td class="mdescLeft"> </td><td class="mdescRight">This operator works like the standard C++ pointer operator to return the object being pointed to by the pointer. <a href="#ad7209afd14b11f0ae06102b59fcfa47f"></a><br/></td></tr>
<tr class="separator:ad7209afd14b11f0ae06102b59fcfa47f inherit pub_methods_classwx_scoped_ptr"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a39a4b959af080169c094799804ff889c inherit pub_methods_classwx_scoped_ptr"><td class="memItemLeft" align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_scoped_ptr.html#a39a4b959af080169c094799804ff889c">operator-></a> () const </td></tr>
<tr class="memdesc:a39a4b959af080169c094799804ff889c inherit pub_methods_classwx_scoped_ptr"><td class="mdescLeft"> </td><td class="mdescRight">Smart pointer member access. <a href="#a39a4b959af080169c094799804ff889c"></a><br/></td></tr>
<tr class="separator:a39a4b959af080169c094799804ff889c inherit pub_methods_classwx_scoped_ptr"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af4f140f5486b9dc3bffee6b7ae6afb88 inherit pub_methods_classwx_scoped_ptr"><td class="memItemLeft" align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_scoped_ptr.html#af4f140f5486b9dc3bffee6b7ae6afb88">release</a> ()</td></tr>
<tr class="memdesc:af4f140f5486b9dc3bffee6b7ae6afb88 inherit pub_methods_classwx_scoped_ptr"><td class="mdescLeft"> </td><td class="mdescRight">Returns the currently hold pointer and resets the smart pointer object to <span class="literal">NULL</span>. <a href="#af4f140f5486b9dc3bffee6b7ae6afb88"></a><br/></td></tr>
<tr class="separator:af4f140f5486b9dc3bffee6b7ae6afb88 inherit pub_methods_classwx_scoped_ptr"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a56e9edc9ce458e8170c8cc7f51eb6e6d inherit pub_methods_classwx_scoped_ptr"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_scoped_ptr.html#a56e9edc9ce458e8170c8cc7f51eb6e6d">reset</a> (T *p=NULL)</td></tr>
<tr class="memdesc:a56e9edc9ce458e8170c8cc7f51eb6e6d inherit pub_methods_classwx_scoped_ptr"><td class="mdescLeft"> </td><td class="mdescRight">Deletes the currently held pointer and sets it to <em>p</em> or to <span class="literal">NULL</span> if no arguments are specified. <a href="#a56e9edc9ce458e8170c8cc7f51eb6e6d"></a><br/></td></tr>
<tr class="separator:a56e9edc9ce458e8170c8cc7f51eb6e6d inherit pub_methods_classwx_scoped_ptr"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a79d42258949a19d90c021dce70dd61c7 inherit pub_methods_classwx_scoped_ptr"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_scoped_ptr.html#a79d42258949a19d90c021dce70dd61c7">swap</a> (<a class="el" href="classwx_scoped_ptr.html">wxScopedPtr</a> &other)</td></tr>
<tr class="memdesc:a79d42258949a19d90c021dce70dd61c7 inherit pub_methods_classwx_scoped_ptr"><td class="mdescLeft"> </td><td class="mdescRight">Swap the pointer inside the smart pointer with <em>other</em>. <a href="#a79d42258949a19d90c021dce70dd61c7"></a><br/></td></tr>
<tr class="separator:a79d42258949a19d90c021dce70dd61c7 inherit pub_methods_classwx_scoped_ptr"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a class="anchor" id="a2dc579447d98ab3eac0cf92d6fbca18a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">wxScopedTiedPtr::wxScopedTiedPtr </td>
<td>(</td>
<td class="paramtype">T ** </td>
<td class="paramname"><em>ppTie</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">T * </td>
<td class="paramname"><em>ptr</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructor creates a smart pointer initialized with <em>ptr</em> and stores <em>ptr</em> in the location specified by <em>ppTie</em> which must not be <span class="literal">NULL</span>. </p>
</div>
</div>
<a class="anchor" id="abbc9e9f23fef38c4fac5ed8d1b9e6c86"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">wxScopedTiedPtr::~wxScopedTiedPtr </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Destructor frees the pointer help by this object and restores the value stored at the tied location (as specified in the <a class="el" href="classwx_scoped_tied_ptr.html#a2dc579447d98ab3eac0cf92d6fbca18a">wxScopedTiedPtr()</a> constructor) to the old value. </p>
<dl class="section warning"><dt>Warning</dt><dd>This location may now contain an uninitialized value if it hadn't been initialized previously, in particular don't count on it magically being <span class="literal">NULL</span>! </dd></dl>
</div>
</div>
</div><!-- contents -->
<address class="footer">
<small>
Generated on Thu Nov 27 2014 13:46:56 for wxWidgets by <a href="http://www.doxygen.org/index.html" target="_new">Doxygen</a> 1.8.2
</small>
</address>
<script src="wxwidgets.js" type="text/javascript"></script>
</div><!-- #page_container -->
</body>
</html>
|