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
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Class template enable_shared_from_this</title>
<link rel="stylesheet" href="../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../boost_interprocess_reference.html#header.boost.interprocess.smart_ptr.enable_shared_from_this_hpp" title="Header <boost/interprocess/smart_ptr/enable_shared_from_this.hpp>">
<link rel="prev" href="deleter.html" title="Class template deleter">
<link rel="next" href="intrusive_ptr.html" title="Class template intrusive_ptr">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="deleter.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_interprocess_reference.html#header.boost.interprocess.smart_ptr.enable_shared_from_this_hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="intrusive_ptr.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="refentry" title="Class template enable_shared_from_this">
<a name="boost.interprocess.enable_shared_from_this"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template enable_shared_from_this</span></h2>
<p>boost::interprocess::enable_shared_from_this</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="emphasis"><em>// In header: <<a class="link" href="../../boost_interprocess_reference.html#header.boost.interprocess.smart_ptr.enable_shared_from_this_hpp" title="Header <boost/interprocess/smart_ptr/enable_shared_from_this.hpp>">boost/interprocess/smart_ptr/enable_shared_from_this.hpp</a>>
</em></span><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A, <span class="bold"><strong>typename</strong></span> D>
<span class="bold"><strong>class</strong></span> <a class="link" href="enable_shared_from_this.html" title="Class template enable_shared_from_this">enable_shared_from_this</a> {
<span class="bold"><strong>public</strong></span>:
<span class="emphasis"><em>// <a class="link" href="enable_shared_from_this.html#id816134-bb">public member functions</a></em></span>
<span class="type"><a class="link" href="shared_ptr.html" title="Class template shared_ptr">shared_ptr</a>< T, A, D ></span> <a class="link" href="enable_shared_from_this.html#id816138-bb">shared_from_this</a>() ;
<span class="type"><a class="link" href="shared_ptr.html" title="Class template shared_ptr">shared_ptr</a>< T <span class="bold"><strong>const</strong></span>, A, D ></span> <a class="link" href="enable_shared_from_this.html#id816148-bb">shared_from_this</a>() <span class="bold"><strong>const</strong></span>;
};</pre></div>
<div class="refsect1" title="Description">
<a name="id1040405"></a><h2>Description</h2>
<p>This class is used as a base class that allows a shared_ptr to the current object to be obtained from within a member function. enable_shared_from_this defines two member functions called shared_from_this that return a shared_ptr<T> and shared_ptr<T const>, depending on constness, to this. </p>
<div class="refsect2" title="enable_shared_from_this public member functions">
<a name="id1040423"></a><h3>
<a name="id816134-bb"></a><code class="computeroutput">enable_shared_from_this</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><span class="type"><a class="link" href="shared_ptr.html" title="Class template shared_ptr">shared_ptr</a>< T, A, D ></span> <a name="id816138-bb"></a>shared_from_this() ;</pre></li>
<li class="listitem"><pre class="literallayout"><span class="type"><a class="link" href="shared_ptr.html" title="Class template shared_ptr">shared_ptr</a>< T <span class="bold"><strong>const</strong></span>, A, D ></span> <a name="id816148-bb"></a>shared_from_this() <span class="bold"><strong>const</strong></span>;</pre></li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2005 - 2008 Ion Gaztanaga<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="deleter.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_interprocess_reference.html#header.boost.interprocess.smart_ptr.enable_shared_from_this_hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="intrusive_ptr.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
|