<!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&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;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&#160;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>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">//  Copyright (c) 2010 Artyom Beilis (Tonkikh)</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<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>&#160;<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>&#160;<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>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#ifndef BOOST_LOCALE_HOLD_PTR_H</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<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>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="keyword">namespace </span>boost { </div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="keyword">namespace </span>locale {</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</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>&#160;    <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>&#160;        <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> &amp;other); <span class="comment">// non copyable </span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;        <a class="code" href="classboost_1_1locale_1_1hold__ptr.html">hold_ptr</a> <span class="keyword">const</span> &amp;operator=(<a class="code" href="classboost_1_1locale_1_1hold__ptr.html">hold_ptr</a> <span class="keyword">const</span> &amp;other); <span class="comment">// non assignable</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    <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>&#160;        <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>&#160;        <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>&#160;</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>&#160;        <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>&#160;        {</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;            <span class="keyword">delete</span> ptr_;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;        }</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</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>&#160;        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>&#160;        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>&#160;</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>&#160;        T <span class="keyword">const</span> &amp;<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>&#160;        T &amp;<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>&#160;        T <span class="keyword">const</span> *<a class="code" href="classboost_1_1locale_1_1hold__ptr.html#a7ae6b54ed5471dd9560904c7ff8a7971">operator-&gt;</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>&#160;        T *<a class="code" href="classboost_1_1locale_1_1hold__ptr.html#a474f2619452b63408e1e761f414328f4">operator-&gt;</a>() { <span class="keywordflow">return</span> ptr_; }</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</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>&#160;        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>&#160;</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>&#160;        <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>&#160;        {</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;            <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>&#160;            ptr_=p;</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        }</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>&#160;        <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> &amp;other)</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;            T *tmp=other.ptr_;</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;            other.ptr_=ptr_;</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;            ptr_=tmp;</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        }</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <span class="keyword">private</span>:</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        T *ptr_;</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    };</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;} <span class="comment">// locale</span></div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;} <span class="comment">// boost</span></div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;<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 &amp; 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-&gt;</a></div><div class="ttdeci">T const * operator-&gt;() 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 &amp;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-&gt;</a></div><div class="ttdeci">T * operator-&gt;()</div><div class="ttdef"><b>Definition:</b> hold_ptr.hpp:63</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->

    <li class="footer">
&copy; 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>
