Imported Upstream version 1.72.0
[platform/upstream/boost.git] / doc / html / boost / intrusive / circular_slist_algorithms.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
5 <title>Class template circular_slist_algorithms</title>
6 <link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
7 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
8 <link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
9 <link rel="up" href="../../intrusive/reference.html#header.boost.intrusive.circular_slist_algorithms_hpp" title="Header &lt;boost/intrusive/circular_slist_algorithms.hpp&gt;">
10 <link rel="prev" href="circular_list_algorithms/stable_partition_info.html" title="Struct stable_partition_info">
11 <link rel="next" href="derivation_value_traits.html" title="Struct template derivation_value_traits">
12 </head>
13 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
14 <table cellpadding="2" width="100%"><tr>
15 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
16 <td align="center"><a href="../../../../index.html">Home</a></td>
17 <td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
18 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
19 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
20 <td align="center"><a href="../../../../more/index.htm">More</a></td>
21 </tr></table>
22 <hr>
23 <div class="spirit-nav">
24 <a accesskey="p" href="circular_list_algorithms/stable_partition_info.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../intrusive/reference.html#header.boost.intrusive.circular_slist_algorithms_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="derivation_value_traits.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
25 </div>
26 <div class="refentry">
27 <a name="boost.intrusive.circular_slist_algorithms"></a><div class="titlepage"></div>
28 <div class="refnamediv">
29 <h2><span class="refentrytitle">Class template circular_slist_algorithms</span></h2>
30 <p>boost::intrusive::circular_slist_algorithms</p>
31 </div>
32 <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
33 <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.circular_slist_algorithms_hpp" title="Header &lt;boost/intrusive/circular_slist_algorithms.hpp&gt;">boost/intrusive/circular_slist_algorithms.hpp</a>&gt;
34
35 </span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> NodeTraits<span class="special">&gt;</span> 
36 <span class="keyword">class</span> <a class="link" href="circular_slist_algorithms.html" title="Class template circular_slist_algorithms">circular_slist_algorithms</a> <span class="special">{</span>
37 <span class="keyword">public</span><span class="special">:</span>
38   <span class="comment">// types</span>
39   <span class="keyword">typedef</span> <span class="identifier">NodeTraits</span><span class="special">::</span><span class="identifier">node</span>           <a name="boost.intrusive.circular_slist_algorithms.node"></a><span class="identifier">node</span><span class="special">;</span>          
40   <span class="keyword">typedef</span> <span class="identifier">NodeTraits</span><span class="special">::</span><span class="identifier">node_ptr</span>       <a name="boost.intrusive.circular_slist_algorithms.node_ptr"></a><span class="identifier">node_ptr</span><span class="special">;</span>      
41   <span class="keyword">typedef</span> <span class="identifier">NodeTraits</span><span class="special">::</span><span class="identifier">const_node_ptr</span> <a name="boost.intrusive.circular_slist_algorithms.const_node_ptr"></a><span class="identifier">const_node_ptr</span><span class="special">;</span>
42   <span class="keyword">typedef</span> <span class="identifier">NodeTraits</span>                 <a name="boost.intrusive.circular_slist_algorithms.node_traits"></a><span class="identifier">node_traits</span><span class="special">;</span>   
43
44   <span class="comment">// <a class="link" href="circular_slist_algorithms.html#idm45581299318720-bb">public static functions</a></span>
45   <span class="keyword">static</span> <span class="keyword">void</span> <a class="link" href="circular_slist_algorithms.html#idm45581299318160-bb"><span class="identifier">init</span></a><span class="special">(</span><span class="identifier">node_ptr</span><span class="special">)</span><span class="special">;</span>
46   <span class="keyword">static</span> <span class="keyword">bool</span> <a class="link" href="circular_slist_algorithms.html#idm45581299313296-bb"><span class="identifier">unique</span></a><span class="special">(</span><span class="identifier">const_node_ptr</span><span class="special">)</span><span class="special">;</span>
47   <span class="keyword">static</span> <span class="keyword">bool</span> <a class="link" href="circular_slist_algorithms.html#idm45581299307472-bb"><span class="identifier">inited</span></a><span class="special">(</span><span class="identifier">const_node_ptr</span><span class="special">)</span><span class="special">;</span>
48   <span class="keyword">static</span> <span class="keyword">void</span> <a class="link" href="circular_slist_algorithms.html#idm45581299302912-bb"><span class="identifier">unlink_after</span></a><span class="special">(</span><span class="identifier">node_ptr</span><span class="special">)</span><span class="special">;</span>
49   <span class="keyword">static</span> <span class="keyword">void</span> <a class="link" href="circular_slist_algorithms.html#idm45581299297488-bb"><span class="identifier">unlink_after</span></a><span class="special">(</span><span class="identifier">node_ptr</span><span class="special">,</span> <span class="identifier">node_ptr</span><span class="special">)</span><span class="special">;</span>
50   <span class="keyword">static</span> <span class="keyword">void</span> <a class="link" href="circular_slist_algorithms.html#idm45581299291360-bb"><span class="identifier">link_after</span></a><span class="special">(</span><span class="identifier">node_ptr</span><span class="special">,</span> <span class="identifier">node_ptr</span><span class="special">)</span><span class="special">;</span>
51   <span class="keyword">static</span> <span class="keyword">void</span> <a class="link" href="circular_slist_algorithms.html#idm45581299285280-bb"><span class="identifier">transfer_after</span></a><span class="special">(</span><span class="identifier">node_ptr</span><span class="special">,</span> <span class="identifier">node_ptr</span><span class="special">,</span> <span class="identifier">node_ptr</span><span class="special">)</span><span class="special">;</span>
52   <span class="keyword">static</span> <span class="keyword">void</span> <a class="link" href="circular_slist_algorithms.html#idm45581299278384-bb"><span class="identifier">init_header</span></a><span class="special">(</span><span class="identifier">node_ptr</span><span class="special">)</span><span class="special">;</span>
53   <span class="keyword">static</span> <span class="identifier">node_ptr</span> <a class="link" href="circular_slist_algorithms.html#idm45581299273360-bb"><span class="identifier">get_previous_node</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">node_ptr</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">node_ptr</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
54   <span class="keyword">static</span> <span class="identifier">node_ptr</span> <a class="link" href="circular_slist_algorithms.html#idm45581299267072-bb"><span class="identifier">get_previous_node</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">node_ptr</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
55   <span class="keyword">static</span> <span class="identifier">node_ptr</span> <a class="link" href="circular_slist_algorithms.html#idm45581299261600-bb"><span class="identifier">get_previous_previous_node</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">node_ptr</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
56   <span class="keyword">static</span> <span class="identifier">node_ptr</span> <a class="link" href="circular_slist_algorithms.html#idm45581299256096-bb"><span class="identifier">get_previous_previous_node</span></a><span class="special">(</span><span class="identifier">node_ptr</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">node_ptr</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
57   <span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="circular_slist_algorithms.html#idm45581299249808-bb"><span class="identifier">count</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">const_node_ptr</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
58   <span class="keyword">static</span> <span class="keyword">void</span> <a class="link" href="circular_slist_algorithms.html#idm45581299244352-bb"><span class="identifier">unlink</span></a><span class="special">(</span><span class="identifier">node_ptr</span><span class="special">)</span><span class="special">;</span>
59   <span class="keyword">static</span> <span class="keyword">void</span> <a class="link" href="circular_slist_algorithms.html#idm45581299238896-bb"><span class="identifier">link_before</span></a><span class="special">(</span><span class="identifier">node_ptr</span><span class="special">,</span> <span class="identifier">node_ptr</span><span class="special">)</span><span class="special">;</span>
60   <span class="keyword">static</span> <span class="keyword">void</span> <a class="link" href="circular_slist_algorithms.html#idm45581299232768-bb"><span class="identifier">swap_nodes</span></a><span class="special">(</span><span class="identifier">node_ptr</span><span class="special">,</span> <span class="identifier">node_ptr</span><span class="special">)</span><span class="special">;</span>
61   <span class="keyword">static</span> <span class="keyword">void</span> <a class="link" href="circular_slist_algorithms.html#idm45581299226464-bb"><span class="identifier">reverse</span></a><span class="special">(</span><span class="identifier">node_ptr</span><span class="special">)</span><span class="special">;</span>
62   <span class="keyword">static</span> <span class="identifier">node_ptr</span> <a class="link" href="circular_slist_algorithms.html#idm45581299221920-bb"><span class="identifier">move_backwards</span></a><span class="special">(</span><span class="identifier">node_ptr</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">)</span><span class="special">;</span>
63   <span class="keyword">static</span> <span class="identifier">node_ptr</span> <a class="link" href="circular_slist_algorithms.html#idm45581299215712-bb"><span class="identifier">move_forward</span></a><span class="special">(</span><span class="identifier">node_ptr</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">)</span><span class="special">;</span>
64 <span class="special">}</span><span class="special">;</span></pre></div>
65 <div class="refsect1">
66 <a name="id-1.3.20.42.12.3.4"></a><h2>Description</h2>
67 <p><a class="link" href="circular_slist_algorithms.html" title="Class template circular_slist_algorithms">circular_slist_algorithms</a> provides basic algorithms to manipulate nodes forming a circular singly linked list. An empty circular list is formed by a node whose pointer to the next node points to itself.</p>
68 <p><a class="link" href="circular_slist_algorithms.html" title="Class template circular_slist_algorithms">circular_slist_algorithms</a> is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:</p>
69 <p><span class="bold"><strong>Typedefs</strong></span>:</p>
70 <p><code class="computeroutput">node</code>: The type of the node that forms the circular list</p>
71 <p><code class="computeroutput">node_ptr</code>: A pointer to a node</p>
72 <p><code class="computeroutput">const_node_ptr</code>: A pointer to a const node</p>
73 <p><span class="bold"><strong>Static functions</strong></span>:</p>
74 <p><code class="computeroutput">static node_ptr get_next(const_node_ptr n);</code></p>
75 <p><code class="computeroutput">static void set_next(node_ptr n, node_ptr next);</code> </p>
76 <div class="refsect2">
77 <a name="id-1.3.20.42.12.3.4.11"></a><h3>
78 <a name="idm45581299318720-bb"></a><code class="computeroutput">circular_slist_algorithms</code> public static functions</h3>
79 <div class="orderedlist"><ol class="orderedlist" type="1">
80 <li class="listitem">
81 <pre class="literallayout"><span class="keyword">static</span> <span class="keyword">void</span> <a name="idm45581299318160-bb"></a><span class="identifier">init</span><span class="special">(</span><span class="identifier">node_ptr</span> this_node<span class="special">)</span><span class="special">;</span></pre>
82 <p><span class="bold"><strong>Effects</strong></span>: Constructs an non-used list element, putting the next pointer to null: <code class="computeroutput">NodeTraits::get_next(this_node) == node_ptr()</code></p>
83 <p><span class="bold"><strong>Complexity</strong></span>: Constant</p>
84 <p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
85 </li>
86 <li class="listitem">
87 <pre class="literallayout"><span class="keyword">static</span> <span class="keyword">bool</span> <a name="idm45581299313296-bb"></a><span class="identifier">unique</span><span class="special">(</span><span class="identifier">const_node_ptr</span> this_node<span class="special">)</span><span class="special">;</span></pre>
88 <p><span class="bold"><strong>Requires</strong></span>: this_node must be in a circular list or be an empty circular list.</p>
89 <p><span class="bold"><strong>Effects</strong></span>: Returns true is "this_node" is the only node of a circular list: or it's a not inserted node: <code class="computeroutput">return node_ptr() == NodeTraits::get_next(this_node) || NodeTraits::get_next(this_node) == this_node</code></p>
90 <p><span class="bold"><strong>Complexity</strong></span>: Constant</p>
91 <p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
92 </li>
93 <li class="listitem">
94 <pre class="literallayout"><span class="keyword">static</span> <span class="keyword">bool</span> <a name="idm45581299307472-bb"></a><span class="identifier">inited</span><span class="special">(</span><span class="identifier">const_node_ptr</span> this_node<span class="special">)</span><span class="special">;</span></pre>
95 <p><span class="bold"><strong>Effects</strong></span>: Returns true is "this_node" has the same state as if it was inited using "init(node_ptr)"</p>
96 <p><span class="bold"><strong>Complexity</strong></span>: Constant</p>
97 <p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
98 </li>
99 <li class="listitem">
100 <pre class="literallayout"><span class="keyword">static</span> <span class="keyword">void</span> <a name="idm45581299302912-bb"></a><span class="identifier">unlink_after</span><span class="special">(</span><span class="identifier">node_ptr</span> prev_node<span class="special">)</span><span class="special">;</span></pre>
101 <p><span class="bold"><strong>Requires</strong></span>: prev_node must be in a circular list or be an empty circular list.</p>
102 <p><span class="bold"><strong>Effects</strong></span>: Unlinks the next node of prev_node from the circular list.</p>
103 <p><span class="bold"><strong>Complexity</strong></span>: Constant</p>
104 <p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
105 </li>
106 <li class="listitem">
107 <pre class="literallayout"><span class="keyword">static</span> <span class="keyword">void</span> <a name="idm45581299297488-bb"></a><span class="identifier">unlink_after</span><span class="special">(</span><span class="identifier">node_ptr</span> prev_node<span class="special">,</span> <span class="identifier">node_ptr</span> last_node<span class="special">)</span><span class="special">;</span></pre>
108 <p><span class="bold"><strong>Requires</strong></span>: prev_node and last_node must be in a circular list or be an empty circular list.</p>
109 <p><span class="bold"><strong>Effects</strong></span>: Unlinks the range (prev_node, last_node) from the circular list.</p>
110 <p><span class="bold"><strong>Complexity</strong></span>: Constant</p>
111 <p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
112 </li>
113 <li class="listitem">
114 <pre class="literallayout"><span class="keyword">static</span> <span class="keyword">void</span> <a name="idm45581299291360-bb"></a><span class="identifier">link_after</span><span class="special">(</span><span class="identifier">node_ptr</span> prev_node<span class="special">,</span> <span class="identifier">node_ptr</span> this_node<span class="special">)</span><span class="special">;</span></pre>
115 <p><span class="bold"><strong>Requires</strong></span>: prev_node must be a node of a circular list.</p>
116 <p><span class="bold"><strong>Effects</strong></span>: Links this_node after prev_node in the circular list.</p>
117 <p><span class="bold"><strong>Complexity</strong></span>: Constant</p>
118 <p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
119 </li>
120 <li class="listitem">
121 <pre class="literallayout"><span class="keyword">static</span> <span class="keyword">void</span> <a name="idm45581299285280-bb"></a><span class="identifier">transfer_after</span><span class="special">(</span><span class="identifier">node_ptr</span> p<span class="special">,</span> <span class="identifier">node_ptr</span> b<span class="special">,</span> <span class="identifier">node_ptr</span> e<span class="special">)</span><span class="special">;</span></pre>
122 <p><span class="bold"><strong>Requires</strong></span>: b and e must be nodes of the same circular list or an empty range. and p must be a node of a different circular list.</p>
123 <p><span class="bold"><strong>Effects</strong></span>: Removes the nodes from (b, e] range from their circular list and inserts them after p in p's circular list.</p>
124 <p><span class="bold"><strong>Complexity</strong></span>: Constant</p>
125 <p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
126 </li>
127 <li class="listitem">
128 <pre class="literallayout"><span class="keyword">static</span> <span class="keyword">void</span> <a name="idm45581299278384-bb"></a><span class="identifier">init_header</span><span class="special">(</span><span class="identifier">node_ptr</span> this_node<span class="special">)</span><span class="special">;</span></pre>
129 <p><span class="bold"><strong>Effects</strong></span>: Constructs an empty list, making this_node the only node of the circular list: <code class="computeroutput">NodeTraits::get_next(this_node) == this_node</code>.</p>
130 <p><span class="bold"><strong>Complexity</strong></span>: Constant</p>
131 <p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
132 </li>
133 <li class="listitem">
134 <pre class="literallayout"><span class="keyword">static</span> <span class="identifier">node_ptr</span> 
135 <a name="idm45581299273360-bb"></a><span class="identifier">get_previous_node</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">node_ptr</span> <span class="special">&amp;</span> prev_init_node<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">node_ptr</span> <span class="special">&amp;</span> this_node<span class="special">)</span><span class="special">;</span></pre>
136 <p><span class="bold"><strong>Requires</strong></span>: this_node and prev_init_node must be in the same circular list.</p>
137 <p><span class="bold"><strong>Effects</strong></span>: Returns the previous node of this_node in the circular list starting. the search from prev_init_node. The first node checked for equality is NodeTraits::get_next(prev_init_node).</p>
138 <p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements between prev_init_node and this_node.</p>
139 <p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
140 </li>
141 <li class="listitem">
142 <pre class="literallayout"><span class="keyword">static</span> <span class="identifier">node_ptr</span> <a name="idm45581299267072-bb"></a><span class="identifier">get_previous_node</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">node_ptr</span> <span class="special">&amp;</span> this_node<span class="special">)</span><span class="special">;</span></pre>
143 <p><span class="bold"><strong>Requires</strong></span>: this_node must be in a circular list or be an empty circular list.</p>
144 <p><span class="bold"><strong>Effects</strong></span>: Returns the previous node of this_node in the circular list.</p>
145 <p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements in the circular list.</p>
146 <p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
147 </li>
148 <li class="listitem">
149 <pre class="literallayout"><span class="keyword">static</span> <span class="identifier">node_ptr</span> <a name="idm45581299261600-bb"></a><span class="identifier">get_previous_previous_node</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">node_ptr</span> <span class="special">&amp;</span> this_node<span class="special">)</span><span class="special">;</span></pre>
150 <p><span class="bold"><strong>Requires</strong></span>: this_node must be in a circular list or be an empty circular list.</p>
151 <p><span class="bold"><strong>Effects</strong></span>: Returns the previous node of the previous node of this_node in the circular list.</p>
152 <p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements in the circular list.</p>
153 <p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
154 </li>
155 <li class="listitem">
156 <pre class="literallayout"><span class="keyword">static</span> <span class="identifier">node_ptr</span> 
157 <a name="idm45581299256096-bb"></a><span class="identifier">get_previous_previous_node</span><span class="special">(</span><span class="identifier">node_ptr</span> p<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">node_ptr</span> <span class="special">&amp;</span> this_node<span class="special">)</span><span class="special">;</span></pre>
158 <p><span class="bold"><strong>Requires</strong></span>: this_node and p must be in the same circular list.</p>
159 <p><span class="bold"><strong>Effects</strong></span>: Returns the previous node of the previous node of this_node in the circular list starting. the search from p. The first node checked for equality is NodeTraits::get_next((NodeTraits::get_next(p)).</p>
160 <p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements in the circular list.</p>
161 <p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
162 </li>
163 <li class="listitem">
164 <pre class="literallayout"><span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idm45581299249808-bb"></a><span class="identifier">count</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">const_node_ptr</span> <span class="special">&amp;</span> this_node<span class="special">)</span><span class="special">;</span></pre>
165 <p><span class="bold"><strong>Requires</strong></span>: this_node must be in a circular list or be an empty circular list.</p>
166 <p><span class="bold"><strong>Effects</strong></span>: Returns the number of nodes in a circular list. If the circular list is empty, returns 1.</p>
167 <p><span class="bold"><strong>Complexity</strong></span>: Linear</p>
168 <p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
169 </li>
170 <li class="listitem">
171 <pre class="literallayout"><span class="keyword">static</span> <span class="keyword">void</span> <a name="idm45581299244352-bb"></a><span class="identifier">unlink</span><span class="special">(</span><span class="identifier">node_ptr</span> this_node<span class="special">)</span><span class="special">;</span></pre>
172 <p><span class="bold"><strong>Requires</strong></span>: this_node must be in a circular list, be an empty circular list or be inited.</p>
173 <p><span class="bold"><strong>Effects</strong></span>: Unlinks the node from the circular list.</p>
174 <p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements in the circular list</p>
175 <p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
176 </li>
177 <li class="listitem">
178 <pre class="literallayout"><span class="keyword">static</span> <span class="keyword">void</span> <a name="idm45581299238896-bb"></a><span class="identifier">link_before</span><span class="special">(</span><span class="identifier">node_ptr</span> nxt_node<span class="special">,</span> <span class="identifier">node_ptr</span> this_node<span class="special">)</span><span class="special">;</span></pre>
179 <p><span class="bold"><strong>Requires</strong></span>: nxt_node must be a node of a circular list.</p>
180 <p><span class="bold"><strong>Effects</strong></span>: Links this_node before nxt_node in the circular list.</p>
181 <p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements in the circular list.</p>
182 <p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
183 </li>
184 <li class="listitem">
185 <pre class="literallayout"><span class="keyword">static</span> <span class="keyword">void</span> <a name="idm45581299232768-bb"></a><span class="identifier">swap_nodes</span><span class="special">(</span><span class="identifier">node_ptr</span> this_node<span class="special">,</span> <span class="identifier">node_ptr</span> other_node<span class="special">)</span><span class="special">;</span></pre>
186 <p><span class="bold"><strong>Requires</strong></span>: this_node and other_node must be nodes inserted in circular lists or be empty circular lists.</p>
187 <p><span class="bold"><strong>Effects</strong></span>: Swaps the position of the nodes: this_node is inserted in other_nodes position in the second circular list and the other_node is inserted in this_node's position in the first circular list.</p>
188 <p><span class="bold"><strong>Complexity</strong></span>: Linear to number of elements of both lists</p>
189 <p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
190 </li>
191 <li class="listitem">
192 <pre class="literallayout"><span class="keyword">static</span> <span class="keyword">void</span> <a name="idm45581299226464-bb"></a><span class="identifier">reverse</span><span class="special">(</span><span class="identifier">node_ptr</span> p<span class="special">)</span><span class="special">;</span></pre>
193 <p><span class="bold"><strong>Effects</strong></span>: Reverses the order of elements in the list.</p>
194 <p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
195 <p><span class="bold"><strong>Complexity</strong></span>: This function is linear to the contained elements. </p>
196 </li>
197 <li class="listitem">
198 <pre class="literallayout"><span class="keyword">static</span> <span class="identifier">node_ptr</span> <a name="idm45581299221920-bb"></a><span class="identifier">move_backwards</span><span class="special">(</span><span class="identifier">node_ptr</span> p<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> n<span class="special">)</span><span class="special">;</span></pre>
199 <p><span class="bold"><strong>Effects</strong></span>: Moves the node p n positions towards the end of the list.</p>
200 <p><span class="bold"><strong>Returns</strong></span>: The previous node of p after the function if there has been any movement, Null if n leads to no movement.</p>
201 <p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
202 <p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements plus the number moved positions. </p>
203 </li>
204 <li class="listitem">
205 <pre class="literallayout"><span class="keyword">static</span> <span class="identifier">node_ptr</span> <a name="idm45581299215712-bb"></a><span class="identifier">move_forward</span><span class="special">(</span><span class="identifier">node_ptr</span> p<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> n<span class="special">)</span><span class="special">;</span></pre>
206 <p><span class="bold"><strong>Effects</strong></span>: Moves the node p n positions towards the beginning of the list.</p>
207 <p><span class="bold"><strong>Returns</strong></span>: The previous node of p after the function if there has been any movement, Null if n leads equals to no movement.</p>
208 <p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
209 <p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements plus the number moved positions. </p>
210 </li>
211 </ol></div>
212 </div>
213 </div>
214 </div>
215 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
216 <td align="left"></td>
217 <td align="right"><div class="copyright-footer">Copyright &#169; 2005 Olaf Krzikalla<br>Copyright &#169; 2006-2015 Ion Gaztanaga<p>
218         Distributed under the Boost Software License, Version 1.0. (See accompanying
219         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>)
220       </p>
221 </div></td>
222 </tr></table>
223 <hr>
224 <div class="spirit-nav">
225 <a accesskey="p" href="circular_list_algorithms/stable_partition_info.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../intrusive/reference.html#header.boost.intrusive.circular_slist_algorithms_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="derivation_value_traits.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
226 </div>
227 </body>
228 </html>