148 lines
16 KiB
HTML
148 lines
16 KiB
HTML
<!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.6"/>
|
|
<title>Boost.Locale: boost/locale/hold_ptr.hpp Source File</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="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(initResizable);
|
|
$(window).load(resizeHeight);
|
|
</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="projectlogo"><img alt="Logo" src="boost-small.png"/></td>
|
|
<td style="padding-left: 0.5em;">
|
|
<div id="projectname">Boost.Locale
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.6 -->
|
|
<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><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="navrow2" class="tabs2">
|
|
<ul class="tablist">
|
|
<li><a href="files.html"><span>File List</span></a></li>
|
|
</ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
$(document).ready(function(){initNavTree('hold__ptr_8hpp_source.html','');});
|
|
</script>
|
|
<div id="doc-content">
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">hold_ptr.hpp</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">// Copyright (c) 2010 Artyom Beilis (Tonkikh)</span></div>
|
|
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">// Distributed under the Boost Software License, Version 1.0. (See</span></div>
|
|
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">// accompanying file LICENSE_1_0.txt or copy at</span></div>
|
|
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">// http://www.boost.org/LICENSE_1_0.txt)</span></div>
|
|
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="preprocessor">#ifndef BOOST_LOCALE_HOLD_PTR_H</span></div>
|
|
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="preprocessor"></span><span class="preprocessor">#define BOOST_LOCALE_HOLD_PTR_H</span></div>
|
|
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor"></span></div>
|
|
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="keyword">namespace </span>boost { </div>
|
|
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="keyword">namespace </span>locale {</div>
|
|
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>  <span class="keyword">template</span><<span class="keyword">typename</span> T></div>
|
|
<div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="classboost_1_1locale_1_1hold__ptr.html"> 18</a></span>  <span class="keyword">class </span><a class="code" href="classboost_1_1locale_1_1hold__ptr.html">hold_ptr</a> {</div>
|
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  <a class="code" href="classboost_1_1locale_1_1hold__ptr.html#a681ee3d579435f9f2f171b830c402072">hold_ptr</a>(<a class="code" href="classboost_1_1locale_1_1hold__ptr.html">hold_ptr</a> <span class="keyword">const</span> &other); <span class="comment">// non copyable </span></div>
|
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>  <a class="code" href="classboost_1_1locale_1_1hold__ptr.html">hold_ptr</a> <span class="keyword">const</span> &operator=(<a class="code" href="classboost_1_1locale_1_1hold__ptr.html">hold_ptr</a> <span class="keyword">const</span> &other); <span class="comment">// non assignable</span></div>
|
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>  <span class="keyword">public</span>:</div>
|
|
<div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="classboost_1_1locale_1_1hold__ptr.html#a681ee3d579435f9f2f171b830c402072"> 25</a></span>  <a class="code" href="classboost_1_1locale_1_1hold__ptr.html#a681ee3d579435f9f2f171b830c402072">hold_ptr</a>() : ptr_(0) {}</div>
|
|
<div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="classboost_1_1locale_1_1hold__ptr.html#a0007514dc0410ccb16adf01c56874f52"> 29</a></span>  <span class="keyword">explicit</span> <a class="code" href="classboost_1_1locale_1_1hold__ptr.html#a0007514dc0410ccb16adf01c56874f52">hold_ptr</a>(T *v) : ptr_(v) {}</div>
|
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div>
|
|
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="classboost_1_1locale_1_1hold__ptr.html#aace934e7a8b3f1880d1a06fa85795a48"> 34</a></span>  <a class="code" href="classboost_1_1locale_1_1hold__ptr.html#aace934e7a8b3f1880d1a06fa85795a48">~hold_ptr</a>() </div>
|
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  {</div>
|
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  <span class="keyword">delete</span> ptr_;</div>
|
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  }</div>
|
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div>
|
|
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="classboost_1_1locale_1_1hold__ptr.html#a907a9385c1a15dab07aade7466620bf6"> 42</a></span>  T <span class="keyword">const</span> *<span class="keyword">get</span>() <span class="keyword">const</span> { <span class="keywordflow">return</span> ptr_; }</div>
|
|
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="classboost_1_1locale_1_1hold__ptr.html#a30dbc88eb9fde35198774f3ace282712"> 46</a></span>  T *<span class="keyword">get</span>() { <span class="keywordflow">return</span> ptr_; }</div>
|
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> </div>
|
|
<div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="classboost_1_1locale_1_1hold__ptr.html#a2c8a19e35ff3c57100b24371854f31b7"> 51</a></span>  T <span class="keyword">const</span> &<a class="code" href="classboost_1_1locale_1_1hold__ptr.html#a2c8a19e35ff3c57100b24371854f31b7">operator *</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> *ptr_; }</div>
|
|
<div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="classboost_1_1locale_1_1hold__ptr.html#af99f3719b755b787b022253aa6f8d1c0"> 55</a></span>  T &<a class="code" href="classboost_1_1locale_1_1hold__ptr.html#a2c8a19e35ff3c57100b24371854f31b7">operator *</a>() { <span class="keywordflow">return</span> *ptr_; }</div>
|
|
<div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="classboost_1_1locale_1_1hold__ptr.html#a7ae6b54ed5471dd9560904c7ff8a7971"> 59</a></span>  T <span class="keyword">const</span> *<a class="code" href="classboost_1_1locale_1_1hold__ptr.html#a7ae6b54ed5471dd9560904c7ff8a7971">operator-></a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> ptr_; }</div>
|
|
<div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="classboost_1_1locale_1_1hold__ptr.html#a474f2619452b63408e1e761f414328f4"> 63</a></span>  T *<a class="code" href="classboost_1_1locale_1_1hold__ptr.html#a474f2619452b63408e1e761f414328f4">operator-></a>() { <span class="keywordflow">return</span> ptr_; }</div>
|
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> </div>
|
|
<div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="classboost_1_1locale_1_1hold__ptr.html#a2d7b2957c037589b65b2cdd4f61ebe03"> 68</a></span>  T *<a class="code" href="classboost_1_1locale_1_1hold__ptr.html#a2d7b2957c037589b65b2cdd4f61ebe03">release</a>() { T *tmp=ptr_; ptr_=0; <span class="keywordflow">return</span> tmp; }</div>
|
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span> </div>
|
|
<div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="classboost_1_1locale_1_1hold__ptr.html#acb84b86bb220d663ffe13e5be9cfd72e"> 73</a></span>  <span class="keywordtype">void</span> <a class="code" href="classboost_1_1locale_1_1hold__ptr.html#acb84b86bb220d663ffe13e5be9cfd72e">reset</a>(T *p=0)</div>
|
|
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  {</div>
|
|
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="keywordflow">if</span>(ptr_) <span class="keyword">delete</span> ptr_;</div>
|
|
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  ptr_=p;</div>
|
|
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  }</div>
|
|
<div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="classboost_1_1locale_1_1hold__ptr.html#a3e2640b5df80f86aeb68a6ee78dfd6f9"> 79</a></span>  <span class="keywordtype">void</span> <a class="code" href="classboost_1_1locale_1_1hold__ptr.html#a3e2640b5df80f86aeb68a6ee78dfd6f9">swap</a>(<a class="code" href="classboost_1_1locale_1_1hold__ptr.html">hold_ptr</a> &other)</div>
|
|
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  {</div>
|
|
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  T *tmp=other.ptr_;</div>
|
|
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  other.ptr_=ptr_;</div>
|
|
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  ptr_=tmp;</div>
|
|
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  }</div>
|
|
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <span class="keyword">private</span>:</div>
|
|
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  T *ptr_;</div>
|
|
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  };</div>
|
|
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span> </div>
|
|
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span> } <span class="comment">// locale</span></div>
|
|
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span> } <span class="comment">// boost</span></div>
|
|
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span> </div>
|
|
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span> <span class="preprocessor">#endif</span></div>
|
|
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span> <span class="preprocessor"></span><span class="comment">// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4</span></div>
|
|
<div class="ttc" id="classboost_1_1locale_1_1hold__ptr_html_a681ee3d579435f9f2f171b830c402072"><div class="ttname"><a href="classboost_1_1locale_1_1hold__ptr.html#a681ee3d579435f9f2f171b830c402072">boost::locale::hold_ptr::hold_ptr</a></div><div class="ttdeci">hold_ptr()</div><div class="ttdef"><b>Definition:</b> hold_ptr.hpp:25</div></div>
|
|
<div class="ttc" id="classboost_1_1locale_1_1hold__ptr_html_a2c8a19e35ff3c57100b24371854f31b7"><div class="ttname"><a href="classboost_1_1locale_1_1hold__ptr.html#a2c8a19e35ff3c57100b24371854f31b7">boost::locale::hold_ptr::operator*</a></div><div class="ttdeci">T const & operator*() const </div><div class="ttdef"><b>Definition:</b> hold_ptr.hpp:51</div></div>
|
|
<div class="ttc" id="classboost_1_1locale_1_1hold__ptr_html_a0007514dc0410ccb16adf01c56874f52"><div class="ttname"><a href="classboost_1_1locale_1_1hold__ptr.html#a0007514dc0410ccb16adf01c56874f52">boost::locale::hold_ptr::hold_ptr</a></div><div class="ttdeci">hold_ptr(T *v)</div><div class="ttdef"><b>Definition:</b> hold_ptr.hpp:29</div></div>
|
|
<div class="ttc" id="classboost_1_1locale_1_1hold__ptr_html"><div class="ttname"><a href="classboost_1_1locale_1_1hold__ptr.html">boost::locale::hold_ptr</a></div><div class="ttdoc">a smart pointer similar to std::auto_ptr but it is non-copyable and the underlying object has the sam...</div><div class="ttdef"><b>Definition:</b> hold_ptr.hpp:18</div></div>
|
|
<div class="ttc" id="classboost_1_1locale_1_1hold__ptr_html_a7ae6b54ed5471dd9560904c7ff8a7971"><div class="ttname"><a href="classboost_1_1locale_1_1hold__ptr.html#a7ae6b54ed5471dd9560904c7ff8a7971">boost::locale::hold_ptr::operator-></a></div><div class="ttdeci">T const * operator->() const </div><div class="ttdef"><b>Definition:</b> hold_ptr.hpp:59</div></div>
|
|
<div class="ttc" id="classboost_1_1locale_1_1hold__ptr_html_aace934e7a8b3f1880d1a06fa85795a48"><div class="ttname"><a href="classboost_1_1locale_1_1hold__ptr.html#aace934e7a8b3f1880d1a06fa85795a48">boost::locale::hold_ptr::~hold_ptr</a></div><div class="ttdeci">~hold_ptr()</div><div class="ttdef"><b>Definition:</b> hold_ptr.hpp:34</div></div>
|
|
<div class="ttc" id="classboost_1_1locale_1_1hold__ptr_html_acb84b86bb220d663ffe13e5be9cfd72e"><div class="ttname"><a href="classboost_1_1locale_1_1hold__ptr.html#acb84b86bb220d663ffe13e5be9cfd72e">boost::locale::hold_ptr::reset</a></div><div class="ttdeci">void reset(T *p=0)</div><div class="ttdef"><b>Definition:</b> hold_ptr.hpp:73</div></div>
|
|
<div class="ttc" id="classboost_1_1locale_1_1hold__ptr_html_a2d7b2957c037589b65b2cdd4f61ebe03"><div class="ttname"><a href="classboost_1_1locale_1_1hold__ptr.html#a2d7b2957c037589b65b2cdd4f61ebe03">boost::locale::hold_ptr::release</a></div><div class="ttdeci">T * release()</div><div class="ttdef"><b>Definition:</b> hold_ptr.hpp:68</div></div>
|
|
<div class="ttc" id="classboost_1_1locale_1_1hold__ptr_html_a3e2640b5df80f86aeb68a6ee78dfd6f9"><div class="ttname"><a href="classboost_1_1locale_1_1hold__ptr.html#a3e2640b5df80f86aeb68a6ee78dfd6f9">boost::locale::hold_ptr::swap</a></div><div class="ttdeci">void swap(hold_ptr &other)</div><div class="ttdoc">Swap two pointers. </div><div class="ttdef"><b>Definition:</b> hold_ptr.hpp:79</div></div>
|
|
<div class="ttc" id="classboost_1_1locale_1_1hold__ptr_html_a474f2619452b63408e1e761f414328f4"><div class="ttname"><a href="classboost_1_1locale_1_1hold__ptr.html#a474f2619452b63408e1e761f414328f4">boost::locale::hold_ptr::operator-></a></div><div class="ttdeci">T * operator->()</div><div class="ttdef"><b>Definition:</b> hold_ptr.hpp:63</div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
|
|
<li class="footer">
|
|
© Copyright 2009-2012 Artyom Beilis, Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License</a>, Version 1.0.
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|