]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/ptr_container/doc/ptr_multimap_adapter.html
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / ptr_container / doc / ptr_multimap_adapter.html
1 <?xml version="1.0" encoding="utf-8" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="generator" content="Docutils 0.3.10: http://docutils.sourceforge.net/" />
7 <title>Boost Pointer Container Library</title>
8 <style type="text/css">
9
10 /*
11 :Author: David Goodger
12 :Contact: goodger@users.sourceforge.net
13 :Date: $Date$
14 :Revision: $Revision$
15 :Copyright: This stylesheet has been placed in the public domain.
16
17 Default cascading style sheet for the HTML output of Docutils.
18
19 See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
20 customize this style sheet.
21 */
22
23 /* "! important" is used here to override other ``margin-top`` and
24 ``margin-bottom`` styles that are later in the stylesheet or
25 more specific. See http://www.w3.org/TR/CSS1#the-cascade */
26 .first {
27 margin-top: 0 ! important }
28
29 .last, .with-subtitle {
30 margin-bottom: 0 ! important }
31
32 .hidden {
33 display: none }
34
35 a.toc-backref {
36 text-decoration: none ;
37 color: black }
38
39 blockquote.epigraph {
40 margin: 2em 5em ; }
41
42 dl.docutils dd {
43 margin-bottom: 0.5em }
44
45 /* Uncomment (and remove this text!) to get bold-faced definition list terms
46 dl.docutils dt {
47 font-weight: bold }
48 */
49
50 div.abstract {
51 margin: 2em 5em }
52
53 div.abstract p.topic-title {
54 font-weight: bold ;
55 text-align: center }
56
57 div.admonition, div.attention, div.caution, div.danger, div.error,
58 div.hint, div.important, div.note, div.tip, div.warning {
59 margin: 2em ;
60 border: medium outset ;
61 padding: 1em }
62
63 div.admonition p.admonition-title, div.hint p.admonition-title,
64 div.important p.admonition-title, div.note p.admonition-title,
65 div.tip p.admonition-title {
66 font-weight: bold ;
67 font-family: sans-serif }
68
69 div.attention p.admonition-title, div.caution p.admonition-title,
70 div.danger p.admonition-title, div.error p.admonition-title,
71 div.warning p.admonition-title {
72 color: red ;
73 font-weight: bold ;
74 font-family: sans-serif }
75
76 /* Uncomment (and remove this text!) to get reduced vertical space in
77 compound paragraphs.
78 div.compound .compound-first, div.compound .compound-middle {
79 margin-bottom: 0.5em }
80
81 div.compound .compound-last, div.compound .compound-middle {
82 margin-top: 0.5em }
83 */
84
85 div.dedication {
86 margin: 2em 5em ;
87 text-align: center ;
88 font-style: italic }
89
90 div.dedication p.topic-title {
91 font-weight: bold ;
92 font-style: normal }
93
94 div.figure {
95 margin-left: 2em }
96
97 div.footer, div.header {
98 clear: both;
99 font-size: smaller }
100
101 div.line-block {
102 display: block ;
103 margin-top: 1em ;
104 margin-bottom: 1em }
105
106 div.line-block div.line-block {
107 margin-top: 0 ;
108 margin-bottom: 0 ;
109 margin-left: 1.5em }
110
111 div.sidebar {
112 margin-left: 1em ;
113 border: medium outset ;
114 padding: 1em ;
115 background-color: #ffffee ;
116 width: 40% ;
117 float: right ;
118 clear: right }
119
120 div.sidebar p.rubric {
121 font-family: sans-serif ;
122 font-size: medium }
123
124 div.system-messages {
125 margin: 5em }
126
127 div.system-messages h1 {
128 color: red }
129
130 div.system-message {
131 border: medium outset ;
132 padding: 1em }
133
134 div.system-message p.system-message-title {
135 color: red ;
136 font-weight: bold }
137
138 div.topic {
139 margin: 2em }
140
141 h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
142 h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
143 margin-top: 0.4em }
144
145 h1.title {
146 text-align: center }
147
148 h2.subtitle {
149 text-align: center }
150
151 hr.docutils {
152 width: 75% }
153
154 img.align-left {
155 clear: left }
156
157 img.align-right {
158 clear: right }
159
160 img.borderless {
161 border: 0 }
162
163 ol.simple, ul.simple {
164 margin-bottom: 1em }
165
166 ol.arabic {
167 list-style: decimal }
168
169 ol.loweralpha {
170 list-style: lower-alpha }
171
172 ol.upperalpha {
173 list-style: upper-alpha }
174
175 ol.lowerroman {
176 list-style: lower-roman }
177
178 ol.upperroman {
179 list-style: upper-roman }
180
181 p.attribution {
182 text-align: right ;
183 margin-left: 50% }
184
185 p.caption {
186 font-style: italic }
187
188 p.credits {
189 font-style: italic ;
190 font-size: smaller }
191
192 p.label {
193 white-space: nowrap }
194
195 p.rubric {
196 font-weight: bold ;
197 font-size: larger ;
198 color: maroon ;
199 text-align: center }
200
201 p.sidebar-title {
202 font-family: sans-serif ;
203 font-weight: bold ;
204 font-size: larger }
205
206 p.sidebar-subtitle {
207 font-family: sans-serif ;
208 font-weight: bold }
209
210 p.topic-title {
211 font-weight: bold }
212
213 pre.address {
214 margin-bottom: 0 ;
215 margin-top: 0 ;
216 font-family: serif ;
217 font-size: 100% }
218
219 pre.line-block {
220 font-family: serif ;
221 font-size: 100% }
222
223 pre.literal-block, pre.doctest-block {
224 margin-left: 2em ;
225 margin-right: 2em ;
226 background-color: #eeeeee }
227
228 span.classifier {
229 font-family: sans-serif ;
230 font-style: oblique }
231
232 span.classifier-delimiter {
233 font-family: sans-serif ;
234 font-weight: bold }
235
236 span.interpreted {
237 font-family: sans-serif }
238
239 span.option {
240 white-space: nowrap }
241
242 span.pre {
243 white-space: pre }
244
245 span.problematic {
246 color: red }
247
248 span.section-subtitle {
249 /* font-size relative to parent (h1..h6 element) */
250 font-size: 80% }
251
252 table.citation {
253 border-left: solid thin gray }
254
255 table.docinfo {
256 margin: 2em 4em }
257
258 table.docutils {
259 margin-top: 0.5em ;
260 margin-bottom: 0.5em }
261
262 table.footnote {
263 border-left: solid thin black }
264
265 table.docutils td, table.docutils th,
266 table.docinfo td, table.docinfo th {
267 padding-left: 0.5em ;
268 padding-right: 0.5em ;
269 vertical-align: top }
270
271 table.docutils th.field-name, table.docinfo th.docinfo-name {
272 font-weight: bold ;
273 text-align: left ;
274 white-space: nowrap ;
275 padding-left: 0 }
276
277 h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
278 h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
279 font-size: 100% }
280
281 tt.docutils {
282 background-color: #eeeeee }
283
284 ul.auto-toc {
285 list-style-type: none }
286
287 </style>
288 </head>
289 <body>
290 <div class="document" id="boost-pointer-container-library">
291 <h1 class="title"><img alt="Boost" src="boost.png" /> Pointer Container Library</h1>
292 <div class="section">
293 <h1><a id="class-ptr-multimap-adapter" name="class-ptr-multimap-adapter">Class <tt class="docutils literal"><span class="pre">ptr_multimap_adapter</span></tt></a></h1>
294 <p>This class is used to build custom pointer containers with
295 an underlying multimap-like container. The interface of the class is an extension
296 of the interface from <tt class="docutils literal"><span class="pre">associative_ptr_container</span></tt>.</p>
297 <p><strong>Hierarchy:</strong></p>
298 <ul class="simple">
299 <li><a class="reference" href="reversible_ptr_container.html">reversible_ptr_container</a><ul>
300 <li><a class="reference" href="associative_ptr_container.html">associative_ptr_container</a><ul>
301 <li><a class="reference" href="ptr_set_adapter.html">ptr_set_adapter</a></li>
302 <li><a class="reference" href="ptr_multiset_adapter.html">ptr_multiset_adapter</a></li>
303 <li><a class="reference" href="ptr_map_adapter.html">ptr_map_adapter</a></li>
304 <li><tt class="docutils literal"><span class="pre">ptr_multi_map_adapter</span></tt><ul>
305 <li><a class="reference" href="ptr_set.html">ptr_set</a></li>
306 <li><a class="reference" href="ptr_multiset.html">ptr_multi_set</a></li>
307 <li><a class="reference" href="ptr_map.html">ptr_map</a></li>
308 <li><a class="reference" href="ptr_multimap.html">ptr_multimap</a></li>
309 </ul>
310 </li>
311 </ul>
312 </li>
313 </ul>
314 </li>
315 </ul>
316 <p><strong>Navigate:</strong></p>
317 <ul class="simple">
318 <li><a class="reference" href="ptr_container.html">home</a></li>
319 <li><a class="reference" href="reference.html">reference</a></li>
320 </ul>
321 <p><strong>Synopsis:</strong></p>
322 <pre class="literal-block">
323 namespace boost
324 {
325 template
326 &lt;
327 T,
328 class VoidPtrMultiMap,
329 class CloneAllocator = heap_clone_allocator
330 &gt;
331 class ptr_multimap_adapter
332 {
333 public: // <a class="reference" href="#typedefs">typedefs</a>
334 typedef VoidPtrMap::key_type key_type;
335 typedef T* mapped_type;
336 typedef T&amp; mapped_reference;
337 typedef const T&amp; const_mapped_reference;
338 typedef ... value_type;
339 typedef ... reference;
340 typedef ... const_reference;
341 typedef ... pointer;
342 typedef ... const_pointer;
343
344 public: // <a class="reference" href="#modifiers">modifiers</a>
345 iterator insert( key_type&amp; k, T* x );
346 template&lt; class U &gt;
347 iterator insert( const key_type&amp;, std::auto_ptr&lt;U&gt; x );
348
349 public: // <a class="reference" href="#pointer-container-requirements">pointer container requirements</a>
350 void transfer( iterator object, ptr_multimap_adapter&amp; from );
351 size_type transfer( iterator first, iterator last, ptr_multimap_adapter&amp; from );
352 template&lt; class Range &gt;
353 size_type transfer( const Range&amp; r, ptr_multimap_adapter&amp; from );
354 void transfer( ptr_multimap_adapter&amp; from );
355
356 }; // class 'ptr_multimap_adapter'
357
358 } // namespace 'boost'
359 </pre>
360 </div>
361 <div class="section">
362 <h1><a id="semantics" name="semantics">Semantics</a></h1>
363 <p>. <span class="target" id="typedefs">typedefs</span>:</p>
364 <div class="section">
365 <h2><a id="semantics-typedefs" name="semantics-typedefs">Semantics: typedefs</a></h2>
366 <p>The following types are implementation defined:</p>
367 <pre class="literal-block">
368 typedef ... value_type;
369 typedef ... reference;
370 typedef ... const_reference;
371 typedef ... pointer;
372 typedef ... const_pointer;
373 </pre>
374 <p>However, the structure of the type mimics <tt class="docutils literal"><span class="pre">std::pair</span></tt> s.t. one
375 can use <tt class="docutils literal"><span class="pre">first</span></tt> and <tt class="docutils literal"><span class="pre">second</span></tt> members. The reference-types
376 are not real references and the pointer-types are not real pointers.
377 However, one may still write</p>
378 <pre class="literal-block">
379 map_type::value_type a_value = *m.begin();
380 a_value.second-&gt;foo();
381 map_type::reference a_reference = *m.begin();
382 a_reference.second-&gt;foo();
383 map_type::const_reference a_creference = *const_begin(m);
384 map_type::pointer a_pointer = &amp;*m.begin();
385 a_pointer-&gt;second-&gt;foo();
386 map_type::const_pointer a_cpointer = &amp;*const_begin(m);
387 </pre>
388 <p>The difference compared to <tt class="docutils literal"><span class="pre">std::map&lt;Key,T*&gt;</span></tt> is that constness
389 is propagated to the pointer (that is, to <tt class="docutils literal"><span class="pre">second</span></tt>) in <tt class="docutils literal"><span class="pre">const_itertor</span></tt>.</p>
390 </div>
391 <div class="section">
392 <h2><a id="semantics-modifiers" name="semantics-modifiers"><span id="modifiers"></span>Semantics: modifiers</a></h2>
393 <ul>
394 <li><p class="first"><tt class="docutils literal"><span class="pre">iterator</span> <span class="pre">insert(</span> <span class="pre">key_type&amp;</span> <span class="pre">k,</span> <span class="pre">T*</span> <span class="pre">x</span> <span class="pre">);</span></tt></p>
395 <blockquote>
396 <ul class="simple">
397 <li>Requirements: <tt class="docutils literal"><span class="pre">x</span> <span class="pre">!=</span> <span class="pre">0</span></tt></li>
398 <li>Effects: Takes ownership of <tt class="docutils literal"><span class="pre">x</span></tt> and returns an iterator pointing to it.</li>
399 <li>Throws: bad_pointer if <tt class="docutils literal"><span class="pre">x</span> <span class="pre">==</span> <span class="pre">0</span></tt></li>
400 <li>Exception safety: Strong guarantee</li>
401 </ul>
402 </blockquote>
403 </li>
404 <li><p class="first"><tt class="docutils literal"><span class="pre">template&lt;</span> <span class="pre">class</span> <span class="pre">U</span> <span class="pre">&gt;</span> <span class="pre">iterator</span> <span class="pre">insert(</span> <span class="pre">const</span> <span class="pre">key_type&amp;</span> <span class="pre">k,</span> <span class="pre">std::auto_ptr&lt;U&gt;</span> <span class="pre">x</span> <span class="pre">);</span></tt></p>
405 <blockquote>
406 <ul class="simple">
407 <li>Equivalent to (but without the <tt class="docutils literal"><span class="pre">const_cast</span></tt>): <tt class="docutils literal"><span class="pre">return</span> <span class="pre">insert(</span> <span class="pre">const_cast&lt;key_type&amp;&gt;(k),</span> <span class="pre">x.release()</span> <span class="pre">);</span></tt></li>
408 </ul>
409 </blockquote>
410 </li>
411 </ul>
412 <!-- - ``iterator insert( key_type& k, const_reference x );``
413
414 - Effects: ``return insert( allocate_clone( x ) );``
415
416 - Exception safety: Strong guarantee -->
417 <span class="target" id="lookup"></span><!-- Semantics: lookup
418 ^^^^^^^^^^^^^^^^^
419
420 - ``reference operator[]( const Key& key );``
421 - ``const_reference operator[]( const Key& key ) const;``
422
423 - Requirements: the key exists
424
425 - Effects: returns the object with key ``key``
426
427 - Throws: ``bad_ptr_container_operation`` if the key does not exist -->
428 </div>
429 <div class="section">
430 <h2><a id="semantics-pointer-container-requirements" name="semantics-pointer-container-requirements"><span id="pointer-container-requirements"></span>Semantics: pointer container requirements</a></h2>
431 <ul>
432 <li><p class="first"><tt class="docutils literal"><span class="pre">void</span> <span class="pre">transfer(</span> <span class="pre">iterator</span> <span class="pre">object,</span> <span class="pre">ptr_multimap_adapter&amp;</span> <span class="pre">from</span> <span class="pre">);</span></tt></p>
433 <blockquote>
434 <ul class="simple">
435 <li>Requirements: <tt class="docutils literal"><span class="pre">not</span> <span class="pre">from.empty()</span></tt></li>
436 <li>Effects: Inserts the object defined by <tt class="docutils literal"><span class="pre">object</span></tt> into the container and remove it from <tt class="docutils literal"><span class="pre">from</span></tt>.</li>
437 <li>Postconditions: <tt class="docutils literal"><span class="pre">size()</span></tt> is one more, <tt class="docutils literal"><span class="pre">from.size()</span></tt> is one less.</li>
438 <li>Exception safety: Strong guarantee</li>
439 </ul>
440 </blockquote>
441 </li>
442 <li><p class="first"><tt class="docutils literal"><span class="pre">void</span> <span class="pre">transfer(</span> <span class="pre">iterator</span> <span class="pre">first,</span> <span class="pre">iterator</span> <span class="pre">last,</span> <span class="pre">ptr_multimap_adapter&amp;</span> <span class="pre">from</span> <span class="pre">);</span></tt></p>
443 <blockquote>
444 <ul class="simple">
445 <li>Requirements: <tt class="docutils literal"><span class="pre">not</span> <span class="pre">from.empty()</span></tt></li>
446 <li>Effects: Inserts the objects defined by the range <tt class="docutils literal"><span class="pre">[first,last)</span></tt> into the container and remove it from <tt class="docutils literal"><span class="pre">from</span></tt>.</li>
447 <li>Postconditions: Let <tt class="docutils literal"><span class="pre">N</span> <span class="pre">==</span> <span class="pre">std::distance(first,last);</span></tt> then <tt class="docutils literal"><span class="pre">size()</span></tt> is <tt class="docutils literal"><span class="pre">N</span></tt> more, <tt class="docutils literal"><span class="pre">from.size()</span></tt> is <tt class="docutils literal"><span class="pre">N</span></tt> less.</li>
448 <li>Exception safety: Basic guarantee</li>
449 </ul>
450 </blockquote>
451 </li>
452 <li><p class="first"><tt class="docutils literal"><span class="pre">template&lt;</span> <span class="pre">class</span> <span class="pre">Range</span> <span class="pre">&gt;</span> <span class="pre">void</span> <span class="pre">transfer(</span> <span class="pre">const</span> <span class="pre">Range&amp;</span> <span class="pre">r,</span> <span class="pre">ptr_multimap_adapter&amp;</span> <span class="pre">from</span> <span class="pre">);</span></tt></p>
453 <blockquote>
454 <ul class="simple">
455 <li>Effects: <tt class="docutils literal"><span class="pre">transfer(</span> <span class="pre">boost::begin(r),</span> <span class="pre">boost::end(r),</span> <span class="pre">from</span> <span class="pre">);</span></tt></li>
456 </ul>
457 </blockquote>
458 </li>
459 <li><p class="first"><tt class="docutils literal"><span class="pre">void</span> <span class="pre">transfer(</span> <span class="pre">ptr_multimap_adapter&amp;</span> <span class="pre">from</span> <span class="pre">);</span></tt></p>
460 <blockquote>
461 <ul class="simple">
462 <li>Effects: <tt class="docutils literal"><span class="pre">transfer(</span> <span class="pre">from.begin(),</span> <span class="pre">from.end(),</span> <span class="pre">from</span> <span class="pre">);</span></tt>.</li>
463 <li>Postconditions: <tt class="docutils literal"><span class="pre">from.empty();</span></tt></li>
464 <li>Exception safety: Basic guarantee</li>
465 </ul>
466 </blockquote>
467 </li>
468 </ul>
469 <hr><table class="docutils field-list" frame="void" rules="none">
470 <col class="field-name" />
471 <col class="field-body" />
472 <tbody valign="top">
473 <tr class="field"><th class="field-name">Copyright:</th><td class="field-body">Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see <a class="reference" href="http://www.boost.org/LICENSE_1_0.txt">LICENSE_1_0.txt</a>).</td>
474 </tr>
475 </tbody>
476 </table>
477 </div>
478 </div>
479 </div>
480 </body>
481 </html>