File: refcounted_8h_source.html

package info (click to toggle)
mysql%2B%2B 3.2.5-2.3
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 18,356 kB
  • sloc: cpp: 35,788; sh: 3,693; perl: 789; makefile: 728
file content (96 lines) | stat: -rwxr-xr-x 34,756 bytes parent folder | download | duplicates (3)
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
<!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>
  <title>MySQL++ Reference Manual</title>
  <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.15"/>
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
  <title>MySQL++: refcounted.h Source File</title>
  <link href="tabs.css" rel="stylesheet" type="text/css"/>
  <link href="doxygen.css" rel="stylesheet" type="text/css">
  <script type="text/javascript" src="jquery.js"></script>
  <script type="text/javascript" src="dynsections.js"></script>
  <link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
  <link href="doxygen.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 id="projectalign" style="padding-left: 0.5em;">
       <div id="projectname">MySQL++
       &#160;<span id="projectnumber">3.2.5</span>
       </div>
      </td>
     </tr>
     </tbody>
    </table>
    </div>
    <!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">refcounted.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="refcounted_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">/***********************************************************************</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> Copyright © 2007-2011, 2018 by Educational Technology Resources, Inc.</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> and © 2007 by Jonathan Wakely.  Others may also hold copyrights on</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> code in this file.  See the CREDITS.txt file in the top directory</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> of the distribution for details.</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> This file is part of MySQL++.</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> MySQL++ is free software; you can redistribute it and/or modify it</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> under the terms of the GNU Lesser General Public License as published</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> by the Free Software Foundation; either version 2.1 of the License, or</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> (at your option) any later version.</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> MySQL++ is distributed in the hope that it will be useful, but WITHOUT</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> License for more details.</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> You should have received a copy of the GNU Lesser General Public</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"> License along with MySQL++; if not, write to the Free Software</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"> Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment"> USA</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment">***********************************************************************/</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#if !defined(MYSQLPP_REFCOUNTED_H)</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#define MYSQLPP_REFCOUNTED_H</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="common_8h.html">common.h</a>&quot;</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &lt;memory&gt;</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &lt;stddef.h&gt;</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="keyword">namespace </span>mysqlpp {</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;</div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="structmysqlpp_1_1RefCountedPointerDestroyer.html">   47</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structmysqlpp_1_1RefCountedPointerDestroyer.html">RefCountedPointerDestroyer</a></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;{</div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="structmysqlpp_1_1RefCountedPointerDestroyer.html#a2bb4681a031201322d3a10fae7be7dfc">   50</a></span>&#160;        <span class="keywordtype">void</span> <a class="code" href="structmysqlpp_1_1RefCountedPointerDestroyer.html#a2bb4681a031201322d3a10fae7be7dfc">operator()</a>(T* doomed)<span class="keyword"> const </span>{ <span class="keyword">delete</span> doomed; }</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;};</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">class</span> T, <span class="keyword">class</span> Destroyer = RefCountedPo<span class="keywordtype">int</span>erDestroyer&lt;T&gt; &gt;</div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="classmysqlpp_1_1RefCountedPointer.html">   82</a></span>&#160;<span class="keyword">class </span><a class="code" href="classmysqlpp_1_1RefCountedPointer.html">RefCountedPointer</a></div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;{</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="classmysqlpp_1_1RefCountedPointer.html#a745d3cf3d478d70c09474eb8766bae3a">   85</a></span>&#160;        <span class="keyword">typedef</span> <a class="code" href="classmysqlpp_1_1RefCountedPointer.html">RefCountedPointer&lt;T&gt;</a> <a class="code" href="classmysqlpp_1_1RefCountedPointer.html#a745d3cf3d478d70c09474eb8766bae3a">ThisType</a>;  </div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;</div><div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="classmysqlpp_1_1RefCountedPointer.html#a02aa2860b0644b6333cee8f321477fee">   91</a></span>&#160;        <a class="code" href="classmysqlpp_1_1RefCountedPointer.html#a02aa2860b0644b6333cee8f321477fee">RefCountedPointer</a>() :</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        counted_(0),</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;        refs_(0)</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;        {</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;        }</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;        </div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="classmysqlpp_1_1RefCountedPointer.html#a586313b144a88e487d77adf7d64bd3bb">  102</a></span>&#160;        <span class="keyword">explicit</span> <a class="code" href="classmysqlpp_1_1RefCountedPointer.html#a586313b144a88e487d77adf7d64bd3bb">RefCountedPointer</a>(T* c) :</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;        counted_(c),</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;        refs_(0)</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;        {</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;                UNIQUE_PTR(T) exception_guard(counted_);</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;                <span class="keywordflow">if</span> (counted_) {</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;                        refs_ = <span class="keyword">new</span> size_t(1);</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;                }</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;                exception_guard.release();      <span class="comment">// previous new didn&#39;t throw</span></div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;        }</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="classmysqlpp_1_1RefCountedPointer.html#ae25ec10685c0c1ae2c7afa6bd72f483c">  114</a></span>&#160;        <a class="code" href="classmysqlpp_1_1RefCountedPointer.html#ae25ec10685c0c1ae2c7afa6bd72f483c">RefCountedPointer</a>(<span class="keyword">const</span> <a class="code" href="classmysqlpp_1_1RefCountedPointer.html">ThisType</a>&amp; other) :</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;        counted_(other.counted_),</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;        refs_(other.counted_ ? other.refs_ : 0)</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;        {</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;                <span class="keywordflow">if</span> (counted_) {</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;                        ++(*refs_);</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;                }</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;        }</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div><div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="classmysqlpp_1_1RefCountedPointer.html#a67b7d093310fa6112a45c361c37d5ed3">  127</a></span>&#160;        <a class="code" href="classmysqlpp_1_1RefCountedPointer.html#a67b7d093310fa6112a45c361c37d5ed3">~RefCountedPointer</a>()</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        {</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;                <span class="keywordflow">if</span> (refs_ &amp;&amp; (--(*refs_) == 0)) {</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;                        Destroyer()(counted_);</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;                        <span class="keyword">delete</span> refs_;</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;                }</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;        }</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;</div><div class="line"><a name="l00142"></a><span class="lineno"><a class="line" href="classmysqlpp_1_1RefCountedPointer.html#ac6a54b0c4fdac3d05389639c5bc71168">  142</a></span>&#160;        <a class="code" href="classmysqlpp_1_1RefCountedPointer.html">ThisType</a>&amp; <a class="code" href="classmysqlpp_1_1RefCountedPointer.html#ac6a54b0c4fdac3d05389639c5bc71168">assign</a>(T* c)</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;        {</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;                <span class="comment">// The create-temporary-and-swap idiom lets us keep memory</span></div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;                <span class="comment">// allocation in the ctor and deallocation in the dtor so</span></div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;                <span class="comment">// we don&#39;t leak in the face of an exception.</span></div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;                <a class="code" href="classmysqlpp_1_1RefCountedPointer.html#a745d3cf3d478d70c09474eb8766bae3a">ThisType</a>(c).swap(*<span class="keyword">this</span>);</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;                <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;        }</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;</div><div class="line"><a name="l00159"></a><span class="lineno"><a class="line" href="classmysqlpp_1_1RefCountedPointer.html#aa806e37d44b4d0384dc0bcd1deefd1b9">  159</a></span>&#160;        <a class="code" href="classmysqlpp_1_1RefCountedPointer.html">ThisType</a>&amp; <a class="code" href="classmysqlpp_1_1RefCountedPointer.html#aa806e37d44b4d0384dc0bcd1deefd1b9">assign</a>(<span class="keyword">const</span> <a class="code" href="classmysqlpp_1_1RefCountedPointer.html">ThisType</a>&amp; other)</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;        {</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;                <span class="comment">// The create-temporary-and-swap idiom lets us keep memory</span></div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;                <span class="comment">// allocation in the ctor and deallocation in the dtor so</span></div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;                <span class="comment">// we don&#39;t leak in the face of an exception.</span></div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;                <a class="code" href="classmysqlpp_1_1RefCountedPointer.html#a745d3cf3d478d70c09474eb8766bae3a">ThisType</a>(other).swap(*<span class="keyword">this</span>);</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;                <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;        }</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;</div><div class="line"><a name="l00172"></a><span class="lineno"><a class="line" href="classmysqlpp_1_1RefCountedPointer.html#a33e254256ace5abc2b07d8a630e55188">  172</a></span>&#160;        <a class="code" href="classmysqlpp_1_1RefCountedPointer.html">ThisType</a>&amp; <a class="code" href="classmysqlpp_1_1RefCountedPointer.html#a33e254256ace5abc2b07d8a630e55188">operator =</a>(T* c)</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;        {</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classmysqlpp_1_1RefCountedPointer.html#ac6a54b0c4fdac3d05389639c5bc71168">assign</a>(c);</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;        }</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;</div><div class="line"><a name="l00182"></a><span class="lineno"><a class="line" href="classmysqlpp_1_1RefCountedPointer.html#a506a85c3e871b5436eb20d6436fb5d9d">  182</a></span>&#160;        <a class="code" href="classmysqlpp_1_1RefCountedPointer.html">ThisType</a>&amp; <a class="code" href="classmysqlpp_1_1RefCountedPointer.html#a33e254256ace5abc2b07d8a630e55188">operator =</a>(<span class="keyword">const</span> <a class="code" href="classmysqlpp_1_1RefCountedPointer.html">ThisType</a>&amp; rhs)</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;        {</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classmysqlpp_1_1RefCountedPointer.html#ac6a54b0c4fdac3d05389639c5bc71168">assign</a>(rhs);</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;        }</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;</div><div class="line"><a name="l00188"></a><span class="lineno"><a class="line" href="classmysqlpp_1_1RefCountedPointer.html#a0da9202a1a89d96bbc5654b9c974b6fd">  188</a></span>&#160;        T* <a class="code" href="classmysqlpp_1_1RefCountedPointer.html#a0da9202a1a89d96bbc5654b9c974b6fd">operator -&gt;</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;<span class="keyword">        </span>{</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;                <span class="keywordflow">return</span> counted_;</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;        }       </div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;</div><div class="line"><a name="l00194"></a><span class="lineno"><a class="line" href="classmysqlpp_1_1RefCountedPointer.html#ac5ac8567c830e0f3985af0125ff676e4">  194</a></span>&#160;        T&amp; <a class="code" href="classmysqlpp_1_1RefCountedPointer.html#ac5ac8567c830e0f3985af0125ff676e4">operator *</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;<span class="keyword">        </span>{</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;                <span class="keywordflow">return</span> *counted_;</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;        }       </div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;</div><div class="line"><a name="l00218"></a><span class="lineno"><a class="line" href="classmysqlpp_1_1RefCountedPointer.html#a48f681f74dbe025e8c639f65850e2302">  218</a></span>&#160;        <span class="keyword">operator</span> <span class="keywordtype">void</span>*()</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;        {</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;                <span class="keywordflow">return</span> counted_;</div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;        }</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;</div><div class="line"><a name="l00226"></a><span class="lineno"><a class="line" href="classmysqlpp_1_1RefCountedPointer.html#a70e3f29073ff9707cec12ba841910ca8">  226</a></span>&#160;        <span class="keyword">operator</span> <span class="keyword">const</span> <span class="keywordtype">void</span>*() <span class="keyword">const</span></div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;        {</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;                <span class="keywordflow">return</span> counted_;</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;        }</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;</div><div class="line"><a name="l00232"></a><span class="lineno"><a class="line" href="classmysqlpp_1_1RefCountedPointer.html#a26757f1138dded33faeb1978004d0639">  232</a></span>&#160;        T* <a class="code" href="classmysqlpp_1_1RefCountedPointer.html#a26757f1138dded33faeb1978004d0639">raw</a>()</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;        {</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;                <span class="keywordflow">return</span> counted_;</div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;        }</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;</div><div class="line"><a name="l00238"></a><span class="lineno"><a class="line" href="classmysqlpp_1_1RefCountedPointer.html#aca68d9c999240bd05e992b15fa38fef9">  238</a></span>&#160;        <span class="keyword">const</span> T* <a class="code" href="classmysqlpp_1_1RefCountedPointer.html#aca68d9c999240bd05e992b15fa38fef9">raw</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;<span class="keyword">        </span>{</div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;                <span class="keywordflow">return</span> counted_;</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;        }</div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;</div><div class="line"><a name="l00247"></a><span class="lineno"><a class="line" href="classmysqlpp_1_1RefCountedPointer.html#ac6de38aa306bfe6166384e70bc9dbaef">  247</a></span>&#160;        <span class="keywordtype">void</span> <a class="code" href="classmysqlpp_1_1RefCountedPointer.html#ac6de38aa306bfe6166384e70bc9dbaef">swap</a>(<a class="code" href="classmysqlpp_1_1RefCountedPointer.html">ThisType</a>&amp; other)</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;        {</div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;                std::swap(counted_, other.counted_);</div><div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;                std::swap(refs_, other.refs_);</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;        }       </div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;</div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;        T* counted_;</div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;</div><div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;        <span class="keywordtype">size_t</span>* refs_;</div><div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;};</div><div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;</div><div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;</div><div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;} <span class="comment">// end namespace mysqlpp</span></div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;</div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;<span class="preprocessor">#endif // !defined(MYSQLPP_REFCOUNTED_H)</span></div><div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;</div><div class="ttc" id="classmysqlpp_1_1RefCountedPointer_html_a26757f1138dded33faeb1978004d0639"><div class="ttname"><a href="classmysqlpp_1_1RefCountedPointer.html#a26757f1138dded33faeb1978004d0639">mysqlpp::RefCountedPointer::raw</a></div><div class="ttdeci">T * raw()</div><div class="ttdoc">Return the raw pointer in T* context.</div><div class="ttdef"><b>Definition:</b> refcounted.h:232</div></div>
<div class="ttc" id="classmysqlpp_1_1RefCountedPointer_html_a67b7d093310fa6112a45c361c37d5ed3"><div class="ttname"><a href="classmysqlpp_1_1RefCountedPointer.html#a67b7d093310fa6112a45c361c37d5ed3">mysqlpp::RefCountedPointer::~RefCountedPointer</a></div><div class="ttdeci">~RefCountedPointer()</div><div class="ttdoc">Destructor.</div><div class="ttdef"><b>Definition:</b> refcounted.h:127</div></div>
<div class="ttc" id="classmysqlpp_1_1RefCountedPointer_html_ae25ec10685c0c1ae2c7afa6bd72f483c"><div class="ttname"><a href="classmysqlpp_1_1RefCountedPointer.html#ae25ec10685c0c1ae2c7afa6bd72f483c">mysqlpp::RefCountedPointer::RefCountedPointer</a></div><div class="ttdeci">RefCountedPointer(const ThisType &amp;other)</div><div class="ttdoc">Copy constructor.</div><div class="ttdef"><b>Definition:</b> refcounted.h:114</div></div>
<div class="ttc" id="classmysqlpp_1_1RefCountedPointer_html_ac6de38aa306bfe6166384e70bc9dbaef"><div class="ttname"><a href="classmysqlpp_1_1RefCountedPointer.html#ac6de38aa306bfe6166384e70bc9dbaef">mysqlpp::RefCountedPointer::swap</a></div><div class="ttdeci">void swap(ThisType &amp;other)</div><div class="ttdoc">Exchange our managed memory with another pointer.</div><div class="ttdef"><b>Definition:</b> refcounted.h:247</div></div>
<div class="ttc" id="structmysqlpp_1_1RefCountedPointerDestroyer_html"><div class="ttname"><a href="structmysqlpp_1_1RefCountedPointerDestroyer.html">mysqlpp::RefCountedPointerDestroyer</a></div><div class="ttdoc">Functor to call delete on the pointer you pass to it.</div><div class="ttdef"><b>Definition:</b> refcounted.h:47</div></div>
<div class="ttc" id="classmysqlpp_1_1RefCountedPointer_html_aca68d9c999240bd05e992b15fa38fef9"><div class="ttname"><a href="classmysqlpp_1_1RefCountedPointer.html#aca68d9c999240bd05e992b15fa38fef9">mysqlpp::RefCountedPointer::raw</a></div><div class="ttdeci">const T * raw() const</div><div class="ttdoc">Return the raw pointer when used in const T* context.</div><div class="ttdef"><b>Definition:</b> refcounted.h:238</div></div>
<div class="ttc" id="classmysqlpp_1_1RefCountedPointer_html_a586313b144a88e487d77adf7d64bd3bb"><div class="ttname"><a href="classmysqlpp_1_1RefCountedPointer.html#a586313b144a88e487d77adf7d64bd3bb">mysqlpp::RefCountedPointer::RefCountedPointer</a></div><div class="ttdeci">RefCountedPointer(T *c)</div><div class="ttdoc">Standard constructor.</div><div class="ttdef"><b>Definition:</b> refcounted.h:102</div></div>
<div class="ttc" id="structmysqlpp_1_1RefCountedPointerDestroyer_html_a2bb4681a031201322d3a10fae7be7dfc"><div class="ttname"><a href="structmysqlpp_1_1RefCountedPointerDestroyer.html#a2bb4681a031201322d3a10fae7be7dfc">mysqlpp::RefCountedPointerDestroyer::operator()</a></div><div class="ttdeci">void operator()(T *doomed) const</div><div class="ttdoc">Functor implementation.</div><div class="ttdef"><b>Definition:</b> refcounted.h:50</div></div>
<div class="ttc" id="classmysqlpp_1_1RefCountedPointer_html_aa806e37d44b4d0384dc0bcd1deefd1b9"><div class="ttname"><a href="classmysqlpp_1_1RefCountedPointer.html#aa806e37d44b4d0384dc0bcd1deefd1b9">mysqlpp::RefCountedPointer::assign</a></div><div class="ttdeci">ThisType &amp; assign(const ThisType &amp;other)</div><div class="ttdoc">Copy an existing refcounted pointer.</div><div class="ttdef"><b>Definition:</b> refcounted.h:159</div></div>
<div class="ttc" id="classmysqlpp_1_1RefCountedPointer_html_ac5ac8567c830e0f3985af0125ff676e4"><div class="ttname"><a href="classmysqlpp_1_1RefCountedPointer.html#ac5ac8567c830e0f3985af0125ff676e4">mysqlpp::RefCountedPointer::operator *</a></div><div class="ttdeci">T &amp; operator *() const</div><div class="ttdoc">Dereference the smart pointer.</div><div class="ttdef"><b>Definition:</b> refcounted.h:194</div></div>
<div class="ttc" id="classmysqlpp_1_1RefCountedPointer_html_a745d3cf3d478d70c09474eb8766bae3a"><div class="ttname"><a href="classmysqlpp_1_1RefCountedPointer.html#a745d3cf3d478d70c09474eb8766bae3a">mysqlpp::RefCountedPointer::ThisType</a></div><div class="ttdeci">RefCountedPointer&lt; T &gt; ThisType</div><div class="ttdoc">alias for this object's type</div><div class="ttdef"><b>Definition:</b> refcounted.h:85</div></div>
<div class="ttc" id="classmysqlpp_1_1RefCountedPointer_html"><div class="ttname"><a href="classmysqlpp_1_1RefCountedPointer.html">mysqlpp::RefCountedPointer</a></div><div class="ttdoc">Creates an object that acts as a reference-counted pointer to another object.</div><div class="ttdef"><b>Definition:</b> refcounted.h:82</div></div>
<div class="ttc" id="common_8h_html"><div class="ttname"><a href="common_8h.html">common.h</a></div><div class="ttdoc">This file includes top-level definitions for use both internal to the library, and outside it....</div></div>
<div class="ttc" id="classmysqlpp_1_1RefCountedPointer_html_ac6a54b0c4fdac3d05389639c5bc71168"><div class="ttname"><a href="classmysqlpp_1_1RefCountedPointer.html#ac6a54b0c4fdac3d05389639c5bc71168">mysqlpp::RefCountedPointer::assign</a></div><div class="ttdeci">ThisType &amp; assign(T *c)</div><div class="ttdoc">Sets (or resets) the pointer to the counted object.</div><div class="ttdef"><b>Definition:</b> refcounted.h:142</div></div>
<div class="ttc" id="classmysqlpp_1_1RefCountedPointer_html_a0da9202a1a89d96bbc5654b9c974b6fd"><div class="ttname"><a href="classmysqlpp_1_1RefCountedPointer.html#a0da9202a1a89d96bbc5654b9c974b6fd">mysqlpp::RefCountedPointer::operator -&gt;</a></div><div class="ttdeci">T * operator -&gt;() const</div><div class="ttdoc">Access the object through the smart pointer.</div><div class="ttdef"><b>Definition:</b> refcounted.h:188</div></div>
<div class="ttc" id="classmysqlpp_1_1RefCountedPointer_html_a02aa2860b0644b6333cee8f321477fee"><div class="ttname"><a href="classmysqlpp_1_1RefCountedPointer.html#a02aa2860b0644b6333cee8f321477fee">mysqlpp::RefCountedPointer::RefCountedPointer</a></div><div class="ttdeci">RefCountedPointer()</div><div class="ttdoc">Default constructor.</div><div class="ttdef"><b>Definition:</b> refcounted.h:91</div></div>
<div class="ttc" id="classmysqlpp_1_1RefCountedPointer_html_a33e254256ace5abc2b07d8a630e55188"><div class="ttname"><a href="classmysqlpp_1_1RefCountedPointer.html#a33e254256ace5abc2b07d8a630e55188">mysqlpp::RefCountedPointer::operator=</a></div><div class="ttdeci">ThisType &amp; operator=(T *c)</div><div class="ttdoc">Set (or reset) the pointer to the counted object.</div><div class="ttdef"><b>Definition:</b> refcounted.h:172</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Jul 21 2019 05:32:21 for MySQL++ by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>