• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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=UTF-8">
5<title>Class template private_node_allocator</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="../../interprocess/indexes_reference.html#header.boost.interprocess.allocators.private_node_allocator_hpp" title="Header &lt;boost/interprocess/allocators/private_node_allocator.hpp&gt;">
10<link rel="prev" href="operator_idm45304012257184.html" title="Function template operator!=">
11<link rel="next" href="private_node_allocator/rebind.html" title="Struct template rebind">
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="operator_idm45304012257184.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../interprocess/indexes_reference.html#header.boost.interprocess.allocators.private_node_allocator_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="private_node_allocator/rebind.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
25</div>
26<div class="refentry">
27<a name="boost.interprocess.private_node_allocator"></a><div class="titlepage"></div>
28<div class="refnamediv">
29<h2><span class="refentrytitle">Class template private_node_allocator</span></h2>
30<p>boost::interprocess::private_node_allocator</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="../../interprocess/indexes_reference.html#header.boost.interprocess.allocators.private_node_allocator_hpp" title="Header &lt;boost/interprocess/allocators/private_node_allocator.hpp&gt;">boost/interprocess/allocators/private_node_allocator.hpp</a>&gt;
34
35</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> SegmentManager<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> NodesPerBlock<span class="special">&gt;</span>
36<span class="keyword">class</span> <a class="link" href="private_node_allocator.html" title="Class template private_node_allocator">private_node_allocator</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">implementation_defined</span><span class="special">::</span><span class="identifier">segment_manager</span> <a name="boost.interprocess.private_node_allocator.segment_manager"></a><span class="identifier">segment_manager</span><span class="special">;</span>
40  <span class="keyword">typedef</span> <span class="identifier">segment_manager</span><span class="special">::</span><span class="identifier">void_pointer</span>           <a name="boost.interprocess.private_node_allocator.void_pointer"></a><span class="identifier">void_pointer</span><span class="special">;</span>
41  <span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">pointer</span>         <a name="boost.interprocess.private_node_allocator.pointer"></a><span class="identifier">pointer</span><span class="special">;</span>
42  <span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">const_pointer</span>   <a name="boost.interprocess.private_node_allocator.const_pointer"></a><span class="identifier">const_pointer</span><span class="special">;</span>
43  <span class="keyword">typedef</span> <span class="identifier">T</span>                                       <a name="boost.interprocess.private_node_allocator.value_type"></a><span class="identifier">value_type</span><span class="special">;</span>
44  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span>                             <a name="boost.interprocess.private_node_allocator.reference"></a><span class="identifier">reference</span><span class="special">;</span>
45  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span>                             <a name="boost.interprocess.private_node_allocator.const_reference"></a><span class="identifier">const_reference</span><span class="special">;</span>
46  <span class="keyword">typedef</span> <span class="identifier">segment_manager</span><span class="special">::</span><span class="identifier">size_type</span>              <a name="boost.interprocess.private_node_allocator.size_type"></a><span class="identifier">size_type</span><span class="special">;</span>
47  <span class="keyword">typedef</span> <span class="identifier">segment_manage</span><span class="special">::</span><span class="identifier">difference_type</span>         <a name="boost.interprocess.private_node_allocator.difference_type"></a><span class="identifier">difference_type</span><span class="special">;</span>
48
49  <span class="comment">// member classes/structs/unions</span>
50  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">&gt;</span>
51  <span class="keyword">struct</span> <a class="link" href="private_node_allocator/rebind.html" title="Struct template rebind">rebind</a> <span class="special">{</span>
52    <span class="comment">// types</span>
53    <span class="keyword">typedef</span> <a class="link" href="private_node_allocator.html" title="Class template private_node_allocator">private_node_allocator</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">SegmentManager</span><span class="special">,</span> <span class="identifier">NodesPerBlock</span> <span class="special">&gt;</span> <a class="link" href="private_node_allocator/rebind.html#boost.interprocess.private_node_allocator.rebind.other"><span class="identifier">other</span></a><span class="special">;</span>
54  <span class="special">}</span><span class="special">;</span>
55
56  <span class="comment">// <a class="link" href="private_node_allocator.html#boost.interprocess.private_node_allocatorconstruct-copy-destruct">construct/copy/destruct</a></span>
57  <a class="link" href="private_node_allocator.html#idm45304012174016-bb"><span class="identifier">private_node_allocator</span></a><span class="special">(</span><span class="identifier">segment_manager</span> <span class="special">*</span><span class="special">)</span><span class="special">;</span>
58  <a class="link" href="private_node_allocator.html#idm45304012171744-bb"><span class="identifier">private_node_allocator</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="private_node_allocator.html" title="Class template private_node_allocator">private_node_allocator</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
59  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">&gt;</span>
60    <a class="link" href="private_node_allocator.html#idm45304012169072-bb"><span class="identifier">private_node_allocator</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="private_node_allocator.html" title="Class template private_node_allocator">private_node_allocator</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">SegmentManager</span><span class="special">,</span> <span class="identifier">NodesPerBlock</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
61  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">,</span> <span class="keyword">typename</span> SegmentManager2<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> N2<span class="special">&gt;</span>
62    <a class="link" href="private_node_allocator.html" title="Class template private_node_allocator">private_node_allocator</a> <span class="special">&amp;</span>
63    <a class="link" href="private_node_allocator.html#idm45304012229824-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="private_node_allocator.html" title="Class template private_node_allocator">private_node_allocator</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">SegmentManager2</span><span class="special">,</span> <span class="identifier">N2</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
64  <a class="link" href="private_node_allocator.html" title="Class template private_node_allocator">private_node_allocator</a> <span class="special">&amp;</span> <a class="link" href="private_node_allocator.html#idm45304012224368-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="private_node_allocator.html" title="Class template private_node_allocator">private_node_allocator</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
65  <a class="link" href="private_node_allocator.html#idm45304012164752-bb"><span class="special">~</span><span class="identifier">private_node_allocator</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
66
67  <span class="comment">// <a class="link" href="private_node_allocator.html#idm45304012221184-bb">public member functions</a></span>
68  <span class="identifier">node_pool_t</span> <span class="special">*</span> <a class="link" href="private_node_allocator.html#idm45304012220624-bb"><span class="identifier">get_node_pool</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
69  <span class="identifier">segment_manager</span> <span class="special">*</span> <a class="link" href="private_node_allocator.html#idm45304012219056-bb"><span class="identifier">get_segment_manager</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
70  <span class="identifier">size_type</span> <a class="link" href="private_node_allocator.html#idm45304012217488-bb"><span class="identifier">max_size</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
71  <span class="identifier">pointer</span> <a class="link" href="private_node_allocator.html#idm45304012215904-bb"><span class="identifier">allocate</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">cvoid_pointer</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
72  <span class="keyword">void</span> <a class="link" href="private_node_allocator.html#idm45304012212176-bb"><span class="identifier">deallocate</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">)</span><span class="special">;</span>
73  <span class="keyword">void</span> <a class="link" href="private_node_allocator.html#idm45304012209504-bb"><span class="identifier">deallocate_free_blocks</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
74  <span class="identifier">pointer</span> <a class="link" href="private_node_allocator.html#idm45304012208208-bb"><span class="identifier">address</span></a><span class="special">(</span><span class="identifier">reference</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
75  <span class="identifier">const_pointer</span> <a class="link" href="private_node_allocator.html#idm45304012205952-bb"><span class="identifier">address</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
76  <span class="keyword">void</span> <a class="link" href="private_node_allocator.html#idm45304012203696-bb"><span class="identifier">construct</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">const_reference</span><span class="special">)</span><span class="special">;</span>
77  <span class="keyword">void</span> <a class="link" href="private_node_allocator.html#idm45304012201008-bb"><span class="identifier">destroy</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
78  <span class="identifier">size_type</span> <a class="link" href="private_node_allocator.html#idm45304012199024-bb"><span class="identifier">size</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
79  <span class="identifier">pointer</span> <a class="link" href="private_node_allocator.html#idm45304012196624-bb"><span class="identifier">allocation_command</span></a><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">interprocess</span><span class="special">::</span><span class="identifier">allocation_type</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">,</span>
80                             <span class="identifier">size_type</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
81  <span class="keyword">void</span> <a class="link" href="private_node_allocator.html#idm45304012192992-bb"><span class="identifier">allocate_many</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
82  <span class="keyword">void</span> <a class="link" href="private_node_allocator.html#idm45304012189360-bb"><span class="identifier">allocate_many</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">size_type</span> <span class="special">*</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
83  <span class="keyword">void</span> <a class="link" href="private_node_allocator.html#idm45304012185920-bb"><span class="identifier">deallocate_many</span></a><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
84  <span class="identifier">pointer</span> <a class="link" href="private_node_allocator.html#idm45304012183664-bb"><span class="identifier">allocate_one</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
85  <span class="keyword">void</span> <a class="link" href="private_node_allocator.html#idm45304012181536-bb"><span class="identifier">allocate_individual</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
86  <span class="keyword">void</span> <a class="link" href="private_node_allocator.html#idm45304012178576-bb"><span class="identifier">deallocate_one</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
87  <span class="keyword">void</span> <a class="link" href="private_node_allocator.html#idm45304012176448-bb"><span class="identifier">deallocate_individual</span></a><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
88
89  <span class="comment">// <a class="link" href="private_node_allocator.html#idm45304012163968-bb">friend functions</a></span>
90  <span class="keyword">friend</span> <span class="keyword">void</span> <a class="link" href="private_node_allocator.html#idm45304012163408-bb"><span class="identifier">swap</span></a><span class="special">(</span><span class="identifier">self_t</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">self_t</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
91<span class="special">}</span><span class="special">;</span></pre></div>
92<div class="refsect1">
93<a name="id-1.3.19.17.3.8.4.4"></a><h2>Description</h2>
94<p>An STL node allocator that uses a segment manager as memory source. The internal pointer type will of the same type (raw, smart) as "typename SegmentManager::void_pointer" type. This allows placing the allocator in shared memory, memory mapped-files, etc... This allocator has its own node pool. NodesPerBlock is the number of nodes allocated at once when the allocator needs runs out of nodes </p>
95<div class="refsect2">
96<a name="id-1.3.19.17.3.8.4.4.3"></a><h3>
97<a name="boost.interprocess.private_node_allocatorconstruct-copy-destruct"></a><code class="computeroutput">private_node_allocator</code>
98        public
99       construct/copy/destruct</h3>
100<div class="orderedlist"><ol class="orderedlist" type="1">
101<li class="listitem">
102<pre class="literallayout"><a name="idm45304012174016-bb"></a><span class="identifier">private_node_allocator</span><span class="special">(</span><span class="identifier">segment_manager</span> <span class="special">*</span> segment_mngr<span class="special">)</span><span class="special">;</span></pre>
103<p>Constructor from a segment manager. If not present, constructs a node pool. Increments the reference count of the associated node pool. Can throw <code class="computeroutput"><a class="link" href="bad_alloc.html" title="Class bad_alloc">boost::interprocess::bad_alloc</a></code> </p>
104</li>
105<li class="listitem">
106<pre class="literallayout"><a name="idm45304012171744-bb"></a><span class="identifier">private_node_allocator</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="private_node_allocator.html" title="Class template private_node_allocator">private_node_allocator</a> <span class="special">&amp;</span> other<span class="special">)</span><span class="special">;</span></pre>
107<p>Copy constructor from other <code class="computeroutput"><a class="link" href="private_node_allocator.html" title="Class template private_node_allocator">private_node_allocator</a></code>. Increments the reference count of the associated node pool. Never throws </p>
108</li>
109<li class="listitem">
110<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">&gt;</span>
111  <a name="idm45304012169072-bb"></a><span class="identifier">private_node_allocator</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="private_node_allocator.html" title="Class template private_node_allocator">private_node_allocator</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">SegmentManager</span><span class="special">,</span> <span class="identifier">NodesPerBlock</span> <span class="special">&gt;</span> <span class="special">&amp;</span> other<span class="special">)</span><span class="special">;</span></pre>
112<p>Copy constructor from related <code class="computeroutput"><a class="link" href="private_node_allocator.html" title="Class template private_node_allocator">private_node_allocator</a></code>. If not present, constructs a node pool. Increments the reference count of the associated node pool. Can throw <code class="computeroutput"><a class="link" href="bad_alloc.html" title="Class bad_alloc">boost::interprocess::bad_alloc</a></code> </p>
113</li>
114<li class="listitem">
115<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">,</span> <span class="keyword">typename</span> SegmentManager2<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> N2<span class="special">&gt;</span>
116  <a class="link" href="private_node_allocator.html" title="Class template private_node_allocator">private_node_allocator</a> <span class="special">&amp;</span>
117  <a name="idm45304012229824-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="private_node_allocator.html" title="Class template private_node_allocator">private_node_allocator</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">SegmentManager2</span><span class="special">,</span> <span class="identifier">N2</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span></pre>
118<p>Not assignable from related <code class="computeroutput"><a class="link" href="private_node_allocator.html" title="Class template private_node_allocator">private_node_allocator</a></code> </p>
119</li>
120<li class="listitem">
121<pre class="literallayout"><a class="link" href="private_node_allocator.html" title="Class template private_node_allocator">private_node_allocator</a> <span class="special">&amp;</span> <a name="idm45304012224368-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="private_node_allocator.html" title="Class template private_node_allocator">private_node_allocator</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span></pre>
122<p>Not assignable from other <code class="computeroutput"><a class="link" href="private_node_allocator.html" title="Class template private_node_allocator">private_node_allocator</a></code> </p>
123</li>
124<li class="listitem">
125<pre class="literallayout"><a name="idm45304012164752-bb"></a><span class="special">~</span><span class="identifier">private_node_allocator</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
126<p>Destructor, removes node_pool_t from memory if its reference count reaches to zero. Never throws </p>
127</li>
128</ol></div>
129</div>
130<div class="refsect2">
131<a name="id-1.3.19.17.3.8.4.4.4"></a><h3>
132<a name="idm45304012221184-bb"></a><code class="computeroutput">private_node_allocator</code> public member functions</h3>
133<div class="orderedlist"><ol class="orderedlist" type="1">
134<li class="listitem">
135<pre class="literallayout"><span class="identifier">node_pool_t</span> <span class="special">*</span> <a name="idm45304012220624-bb"></a><span class="identifier">get_node_pool</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
136<p>Returns a pointer to the node pool. Never throws </p>
137</li>
138<li class="listitem">
139<pre class="literallayout"><span class="identifier">segment_manager</span> <span class="special">*</span> <a name="idm45304012219056-bb"></a><span class="identifier">get_segment_manager</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
140<p>Returns the segment manager. Never throws </p>
141</li>
142<li class="listitem">
143<pre class="literallayout"><span class="identifier">size_type</span> <a name="idm45304012217488-bb"></a><span class="identifier">max_size</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
144<p>Returns the number of elements that could be allocated. Never throws </p>
145</li>
146<li class="listitem">
147<pre class="literallayout"><span class="identifier">pointer</span> <a name="idm45304012215904-bb"></a><span class="identifier">allocate</span><span class="special">(</span><span class="identifier">size_type</span> count<span class="special">,</span> <span class="identifier">cvoid_pointer</span> hint <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span></pre>
148<p>Allocate memory for an array of count elements. Throws <code class="computeroutput"><a class="link" href="bad_alloc.html" title="Class bad_alloc">boost::interprocess::bad_alloc</a></code> if there is no enough memory </p>
149</li>
150<li class="listitem">
151<pre class="literallayout"><span class="keyword">void</span> <a name="idm45304012212176-bb"></a><span class="identifier">deallocate</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> ptr<span class="special">,</span> <span class="identifier">size_type</span> count<span class="special">)</span><span class="special">;</span></pre>
152<p>Deallocate allocated memory. Never throws </p>
153</li>
154<li class="listitem">
155<pre class="literallayout"><span class="keyword">void</span> <a name="idm45304012209504-bb"></a><span class="identifier">deallocate_free_blocks</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
156<p>Deallocates all free blocks of the pool </p>
157</li>
158<li class="listitem">
159<pre class="literallayout"><span class="identifier">pointer</span> <a name="idm45304012208208-bb"></a><span class="identifier">address</span><span class="special">(</span><span class="identifier">reference</span> value<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
160<p>Returns address of mutable object. Never throws </p>
161</li>
162<li class="listitem">
163<pre class="literallayout"><span class="identifier">const_pointer</span> <a name="idm45304012205952-bb"></a><span class="identifier">address</span><span class="special">(</span><span class="identifier">const_reference</span> value<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
164<p>Returns address of non mutable object. Never throws </p>
165</li>
166<li class="listitem">
167<pre class="literallayout"><span class="keyword">void</span> <a name="idm45304012203696-bb"></a><span class="identifier">construct</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> ptr<span class="special">,</span> <span class="identifier">const_reference</span> v<span class="special">)</span><span class="special">;</span></pre>
168<p>Copy construct an object. Throws if T's copy constructor throws </p>
169</li>
170<li class="listitem">
171<pre class="literallayout"><span class="keyword">void</span> <a name="idm45304012201008-bb"></a><span class="identifier">destroy</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> ptr<span class="special">)</span><span class="special">;</span></pre>
172<p>Destroys object. Throws if object's destructor throws </p>
173</li>
174<li class="listitem">
175<pre class="literallayout"><span class="identifier">size_type</span> <a name="idm45304012199024-bb"></a><span class="identifier">size</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> p<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
176<p>Returns maximum the number of objects the previously allocated memory pointed by p can hold. This size only works for memory allocated with allocate, allocation_command and allocate_many. </p>
177</li>
178<li class="listitem"><pre class="literallayout"><span class="identifier">pointer</span> <a name="idm45304012196624-bb"></a><span class="identifier">allocation_command</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">interprocess</span><span class="special">::</span><span class="identifier">allocation_type</span> command<span class="special">,</span>
179                           <span class="identifier">size_type</span> limit_size<span class="special">,</span>
180                           <span class="identifier">size_type</span> <span class="special">&amp;</span> prefer_in_recvd_out_size<span class="special">,</span>
181                           <span class="identifier">pointer</span> <span class="special">&amp;</span> reuse<span class="special">)</span><span class="special">;</span></pre></li>
182<li class="listitem">
183<pre class="literallayout"><span class="keyword">void</span> <a name="idm45304012192992-bb"></a><span class="identifier">allocate_many</span><span class="special">(</span><span class="identifier">size_type</span> elem_size<span class="special">,</span> <span class="identifier">size_type</span> num_elements<span class="special">,</span>
184                   <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
185<p>Allocates many elements of size elem_size in a contiguous block of memory. The minimum number to be allocated is min_elements, the preferred and maximum number is preferred_elements. The number of actually allocated elements is will be assigned to received_size. The elements must be deallocated with deallocate(...) </p>
186</li>
187<li class="listitem">
188<pre class="literallayout"><span class="keyword">void</span> <a name="idm45304012189360-bb"></a><span class="identifier">allocate_many</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">size_type</span> <span class="special">*</span> elem_sizes<span class="special">,</span> <span class="identifier">size_type</span> n_elements<span class="special">,</span>
189                   <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
190<p>Allocates n_elements elements, each one of size elem_sizes[i]in a contiguous block of memory. The elements must be deallocated </p>
191</li>
192<li class="listitem">
193<pre class="literallayout"><span class="keyword">void</span> <a name="idm45304012185920-bb"></a><span class="identifier">deallocate_many</span><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
194<p>Allocates many elements of size elem_size in a contiguous block of memory. The minimum number to be allocated is min_elements, the preferred and maximum number is preferred_elements. The number of actually allocated elements is will be assigned to received_size. The elements must be deallocated with deallocate(...) </p>
195</li>
196<li class="listitem">
197<pre class="literallayout"><span class="identifier">pointer</span> <a name="idm45304012183664-bb"></a><span class="identifier">allocate_one</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
198<p>Allocates just one object. Memory allocated with this function must be deallocated only with deallocate_one(). Throws <code class="computeroutput"><a class="link" href="bad_alloc.html" title="Class bad_alloc">boost::interprocess::bad_alloc</a></code> if there is no enough memory </p>
199</li>
200<li class="listitem">
201<pre class="literallayout"><span class="keyword">void</span> <a name="idm45304012181536-bb"></a><span class="identifier">allocate_individual</span><span class="special">(</span><span class="identifier">size_type</span> num_elements<span class="special">,</span>
202                         <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
203<p>Allocates many elements of size == 1 in a contiguous block of memory. The minimum number to be allocated is min_elements, the preferred and maximum number is preferred_elements. The number of actually allocated elements is will be assigned to received_size. Memory allocated with this function must be deallocated only with deallocate_one(). </p>
204</li>
205<li class="listitem">
206<pre class="literallayout"><span class="keyword">void</span> <a name="idm45304012178576-bb"></a><span class="identifier">deallocate_one</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> p<span class="special">)</span><span class="special">;</span></pre>
207<p>Deallocates memory previously allocated with allocate_one(). You should never use deallocate_one to deallocate memory allocated with other functions different from allocate_one(). Never throws </p>
208</li>
209<li class="listitem">
210<pre class="literallayout"><span class="keyword">void</span> <a name="idm45304012176448-bb"></a><span class="identifier">deallocate_individual</span><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
211<p>Allocates many elements of size == 1 in a contiguous block of memory. The minimum number to be allocated is min_elements, the preferred and maximum number is preferred_elements. The number of actually allocated elements is will be assigned to received_size. Memory allocated with this function must be deallocated only with deallocate_one(). </p>
212</li>
213</ol></div>
214</div>
215<div class="refsect2">
216<a name="id-1.3.19.17.3.8.4.4.5"></a><h3>
217<a name="idm45304012163968-bb"></a><code class="computeroutput">private_node_allocator</code> friend functions</h3>
218<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
219<pre class="literallayout"><span class="keyword">friend</span> <span class="keyword">void</span> <a name="idm45304012163408-bb"></a><span class="identifier">swap</span><span class="special">(</span><span class="identifier">self_t</span> <span class="special">&amp;</span> alloc1<span class="special">,</span> <span class="identifier">self_t</span> <span class="special">&amp;</span> alloc2<span class="special">)</span><span class="special">;</span></pre>
220<p>Swaps allocators. Does not throw. If each allocator is placed in a different memory segment, the result is undefined. </p>
221</li></ol></div>
222</div>
223</div>
224</div>
225<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
226<td align="left"></td>
227<td align="right"><div class="copyright-footer">Copyright © 2005-2015 Ion Gaztanaga<p>
228        Distributed under the Boost Software License, Version 1.0. (See accompanying
229        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>)
230      </p>
231</div></td>
232</tr></table>
233<hr>
234<div class="spirit-nav">
235<a accesskey="p" href="operator_idm45304012257184.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../interprocess/indexes_reference.html#header.boost.interprocess.allocators.private_node_allocator_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="private_node_allocator/rebind.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
236</div>
237</body>
238</html>
239