summaryrefslogtreecommitdiff
path: root/doc/html/boost/intrusive/any_base_hook.html
blob: 909151499b767f29661cdb321f70fe7488f1df66 (plain)
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
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Class template any_base_hook</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../intrusive/reference.html#header.boost.intrusive.any_hook_hpp" title="Header &lt;boost/intrusive/any_hook.hpp&gt;">
<link rel="prev" href="../../intrusive/reference.html" title="Reference">
<link rel="next" href="any_member_hook.html" title="Class template any_member_hook">
</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="../../intrusive/reference.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../intrusive/reference.html#header.boost.intrusive.any_hook_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="any_member_hook.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.intrusive.any_base_hook"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template any_base_hook</span></h2>
<p>boost::intrusive::any_base_hook</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="comment">// In header: &lt;<a class="link" href="../../intrusive/reference.html#header.boost.intrusive.any_hook_hpp" title="Header &lt;boost/intrusive/any_hook.hpp&gt;">boost/intrusive/any_hook.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> Options<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="any_base_hook.html" title="Class template any_base_hook">any_base_hook</a> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">make_any_base_hook</span><span class="special">::</span><span class="identifier">type</span><span class="special">&lt;</span> <span class="identifier">O1</span><span class="special">,</span> <span class="identifier">O2</span><span class="special">,</span> <span class="identifier">O3</span> <span class="special">&gt;</span> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// <a class="link" href="any_base_hook.html#boost.intrusive.any_base_hookconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="any_base_hook.html#idp38041984-bb"><span class="identifier">any_base_hook</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="any_base_hook.html#idp38045248-bb"><span class="identifier">any_base_hook</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="any_base_hook.html" title="Class template any_base_hook">any_base_hook</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="any_base_hook.html" title="Class template any_base_hook">any_base_hook</a> <span class="special">&amp;</span> <a class="link" href="any_base_hook.html#idp19632592-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="any_base_hook.html" title="Class template any_base_hook">any_base_hook</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="any_base_hook.html#idp19637888-bb"><span class="special">~</span><span class="identifier">any_base_hook</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="any_base_hook.html#idp38035856-bb">public member functions</a></span>
  <span class="keyword">bool</span> <a class="link" href="any_base_hook.html#idp38036304-bb"><span class="identifier">is_linked</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idp260748368"></a><h2>Description</h2>
<p>Derive a class from this hook in order to store objects of that class in an intrusive container.</p>
<p>The hook admits the following options: <code class="computeroutput">tag&lt;&gt;</code>, <code class="computeroutput">void_pointer&lt;&gt;</code> and <code class="computeroutput">link_mode&lt;&gt;</code>.</p>
<p><code class="computeroutput">tag&lt;&gt;</code> defines a tag to identify the node. The same tag value can be used in different classes, but if a class is derived from more than one <code class="computeroutput"><a class="link" href="any_base_hook.html" title="Class template any_base_hook">any_base_hook</a></code>, then each <code class="computeroutput"><a class="link" href="any_base_hook.html" title="Class template any_base_hook">any_base_hook</a></code> needs its unique tag.</p>
<p><code class="computeroutput">link_mode&lt;&gt;</code> will specify the linking mode of the hook (<code class="computeroutput">normal_link</code>, <code class="computeroutput">safe_link</code>).</p>
<p><code class="computeroutput">void_pointer&lt;&gt;</code> is the pointer type that will be used internally in the hook and the container configured to use this hook. </p>
<div class="refsect2">
<a name="idp260758320"></a><h3>
<a name="boost.intrusive.any_base_hookconstruct-copy-destruct"></a><code class="computeroutput">any_base_hook</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="idp38041984-bb"></a><span class="identifier">any_base_hook</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: If <code class="computeroutput"><a class="link" href="link_mode.html" title="Struct template link_mode">link_mode</a></code> is or <code class="computeroutput">safe_link</code> initializes the node to an unlinked state.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idp38045248-bb"></a><span class="identifier">any_base_hook</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="any_base_hook.html" title="Class template any_base_hook">any_base_hook</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: If <code class="computeroutput"><a class="link" href="link_mode.html" title="Struct template link_mode">link_mode</a></code> is or <code class="computeroutput">safe_link</code> initializes the node to an unlinked state. The argument is ignored.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
<p><span class="bold"><strong>Rationale</strong></span>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <code class="computeroutput">swap</code> can be used to emulate move-semantics. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="any_base_hook.html" title="Class template any_base_hook">any_base_hook</a> <span class="special">&amp;</span> <a name="idp19632592-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="any_base_hook.html" title="Class template any_base_hook">any_base_hook</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Empty function. The argument is ignored.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
<p><span class="bold"><strong>Rationale</strong></span>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <code class="computeroutput">swap</code> can be used to emulate move-semantics. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idp19637888-bb"></a><span class="special">~</span><span class="identifier">any_base_hook</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: If <code class="computeroutput"><a class="link" href="link_mode.html" title="Struct template link_mode">link_mode</a></code> is <code class="computeroutput">normal_link</code>, the destructor does nothing (ie. no code is generated). If <code class="computeroutput"><a class="link" href="link_mode.html" title="Struct template link_mode">link_mode</a></code> is <code class="computeroutput">safe_link</code> and the object is stored in a container an assertion is raised.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idp260800288"></a><h3>
<a name="idp38035856-bb"></a><code class="computeroutput">any_base_hook</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="idp38036304-bb"></a><span class="identifier">is_linked</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Precondition</strong></span>: <code class="computeroutput"><a class="link" href="link_mode.html" title="Struct template link_mode">link_mode</a></code> must be <code class="computeroutput">safe_link</code>.</p>
<p><span class="bold"><strong>Returns</strong></span>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <code class="computeroutput">container::iterator_to</code> will return a valid iterator.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant </p>
</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 &#169; 2005 Olaf Krzikalla<br>Copyright &#169; 2006-2013 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="../../intrusive/reference.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../intrusive/reference.html#header.boost.intrusive.any_hook_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="any_member_hook.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>