]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | <html> |
2 | <head> | |
3 | <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> | |
4 | <title>unconstrained_set_of Reference</title> | |
5 | <link rel="stylesheet" href="../../boostbook.css" type="text/css"> | |
6 | <meta name="generator" content="DocBook XSL Stylesheets V1.77.1"> | |
7 | <link rel="home" href="../../index.html" title="Chapter 1. Boost.Bimap"> | |
8 | <link rel="up" href="../reference.html" title="Reference"> | |
9 | <link rel="prev" href="vector_of_reference.html" title="vector_of Reference"> | |
10 | <link rel="next" href="../compiler_specifics.html" title="Compiler specifics"> | |
11 | </head> | |
12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> | |
13 | <table cellpadding="2" width="100%"><tr> | |
14 | <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td> | |
15 | <td align="center"><a href="../../../../../../index.html">Home</a></td> | |
16 | <td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td> | |
17 | <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> | |
18 | <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> | |
19 | <td align="center"><a href="../../../../../../more/index.htm">More</a></td> | |
20 | </tr></table> | |
21 | <hr> | |
22 | <div class="spirit-nav"> | |
23 | <a accesskey="p" href="vector_of_reference.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><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="../compiler_specifics.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> | |
24 | </div> | |
25 | <div class="section boost_bimap_reference_unconstrained_set_of_reference"> | |
26 | <div class="titlepage"><div><div><h3 class="title"> | |
27 | <a name="boost_bimap.reference.unconstrained_set_of_reference"></a><a class="link" href="unconstrained_set_of_reference.html" title="unconstrained_set_of Reference">unconstrained_set_of | |
28 | Reference</a> | |
29 | </h3></div></div></div> | |
30 | <div class="toc"><dl> | |
31 | <dt><span class="section"><a href="unconstrained_set_of_reference.html#boost_bimap.reference.unconstrained_set_of_reference.header__boost_bimap_unconstrained_set_of_hpp__synopsis">Header | |
32 | "boost/bimap/unconstrained_set_of.hpp" synopsis</a></span></dt> | |
33 | <dt><span class="section"><a href="unconstrained_set_of_reference.html#boost_bimap.reference.unconstrained_set_of_reference.unconstrained_set_of_views">unconstrained_set_of | |
34 | Views</a></span></dt> | |
35 | <dd><dl> | |
36 | <dt><span class="section"><a href="unconstrained_set_of_reference.html#boost_bimap.reference.unconstrained_set_of_reference.unconstrained_set_of_views.complexity_signature">Complexity | |
37 | signature</a></span></dt> | |
38 | <dt><span class="section"><a href="unconstrained_set_of_reference.html#boost_bimap.reference.unconstrained_set_of_reference.unconstrained_set_of_views.serialization">Serialization</a></span></dt> | |
39 | </dl></dd> | |
40 | </dl></div> | |
41 | <div class="section boost_bimap_reference_unconstrained_set_of_reference_header__boost_bimap_unconstrained_set_of_hpp__synopsis"> | |
42 | <div class="titlepage"><div><div><h4 class="title"> | |
43 | <a name="boost_bimap.reference.unconstrained_set_of_reference.header__boost_bimap_unconstrained_set_of_hpp__synopsis"></a><a class="link" href="unconstrained_set_of_reference.html#boost_bimap.reference.unconstrained_set_of_reference.header__boost_bimap_unconstrained_set_of_hpp__synopsis" title='Header "boost/bimap/unconstrained_set_of.hpp" synopsis'>Header | |
44 | "boost/bimap/unconstrained_set_of.hpp" synopsis</a> | |
45 | </h4></div></div></div> | |
46 | <pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> | |
47 | <span class="keyword">namespace</span> <span class="identifier">bimaps</span> <span class="special">{</span> | |
48 | ||
49 | ||
50 | <span class="keyword">template</span><span class="special"><</span> <span class="keyword">class</span> <span class="identifier">KeyType</span> <span class="special">></span> | |
51 | <span class="keyword">struct</span> <span class="identifier">unconstrained_set_of</span><span class="special">;</span> | |
52 | ||
53 | <span class="keyword">struct</span> <span class="identifier">unconstrained_set_of_relation</span><span class="special">;</span> | |
54 | ||
55 | ||
56 | <span class="special">}</span> <span class="comment">// namespace bimap</span> | |
57 | <span class="special">}</span> <span class="comment">// namespace boost</span> | |
58 | </pre> | |
59 | </div> | |
60 | <div class="section boost_bimap_reference_unconstrained_set_of_reference_unconstrained_set_of_views"> | |
61 | <div class="titlepage"><div><div><h4 class="title"> | |
62 | <a name="boost_bimap.reference.unconstrained_set_of_reference.unconstrained_set_of_views"></a><a class="link" href="unconstrained_set_of_reference.html#boost_bimap.reference.unconstrained_set_of_reference.unconstrained_set_of_views" title="unconstrained_set_of Views">unconstrained_set_of | |
63 | Views</a> | |
64 | </h4></div></div></div> | |
65 | <div class="toc"><dl> | |
66 | <dt><span class="section"><a href="unconstrained_set_of_reference.html#boost_bimap.reference.unconstrained_set_of_reference.unconstrained_set_of_views.complexity_signature">Complexity | |
67 | signature</a></span></dt> | |
68 | <dt><span class="section"><a href="unconstrained_set_of_reference.html#boost_bimap.reference.unconstrained_set_of_reference.unconstrained_set_of_views.serialization">Serialization</a></span></dt> | |
69 | </dl></div> | |
70 | <p> | |
71 | An unconstrained_set_of set view is a view with no constraints. The use | |
72 | of these kind of view boost the bimap performance but the view can not | |
73 | be accessed. An unconstrained view is an empty class. | |
74 | </p> | |
75 | <pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> | |
76 | <span class="keyword">namespace</span> <span class="identifier">bimaps</span> <span class="special">{</span> | |
77 | <span class="keyword">namespace</span> <span class="identifier">views</span> <span class="special">{</span> | |
78 | ||
79 | <span class="keyword">template</span><span class="special"><</span> <span class="emphasis"><em>-implementation defined parameter list-</em></span> <span class="special">></span> | |
80 | <span class="keyword">class</span> <span class="emphasis"><em>-implementation defined view name-</em></span> | |
81 | <span class="special">{</span> | |
82 | <span class="comment">// Empty view</span> | |
83 | <span class="special">};</span> | |
84 | ||
85 | <span class="special">}</span> <span class="comment">// namespace views</span> | |
86 | <span class="special">}</span> <span class="comment">// namespace bimap</span> | |
87 | <span class="special">}</span> <span class="comment">// namespace boost</span> | |
88 | </pre> | |
89 | <p> | |
90 | In the case of a <code class="computeroutput"><span class="identifier">bimap</span><span class="special"><</span> <span class="identifier">unconstrained_set_of</span><span class="special"><</span><span class="identifier">Left</span><span class="special">>,</span> <span class="special">...</span> <span class="special">></span></code> | |
91 | </p> | |
92 | <p> | |
93 | In the set view: | |
94 | </p> | |
95 | <pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">signature</span><span class="special">-</span><span class="identifier">compatible</span> <span class="identifier">with</span> <span class="identifier">relation</span><span class="special"><</span> <span class="identifier">Left</span><span class="special">,</span> <span class="special">...</span> <span class="special">></span> <span class="identifier">key_type</span><span class="special">;</span> | |
96 | <span class="keyword">typedef</span> <span class="identifier">signature</span><span class="special">-</span><span class="identifier">compatible</span> <span class="identifier">with</span> <span class="identifier">relation</span><span class="special"><</span> <span class="identifier">Left</span><span class="special">,</span> <span class="special">...</span> <span class="special">></span> <span class="identifier">value_type</span><span class="special">;</span> | |
97 | </pre> | |
98 | <p> | |
99 | In the left map view: | |
100 | </p> | |
101 | <pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">Left</span> <span class="identifier">key_type</span><span class="special">;</span> | |
102 | <span class="keyword">typedef</span> <span class="special">...</span> <span class="identifier">mapped_type</span><span class="special">;</span> | |
103 | ||
104 | <span class="keyword">typedef</span> <span class="identifier">signature</span><span class="special">-</span><span class="identifier">compatible</span> <span class="identifier">with</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">Left</span><span class="special">,</span> <span class="special">...</span> <span class="special">></span> <span class="identifier">value_type</span><span class="special">;</span> | |
105 | </pre> | |
106 | <p> | |
107 | In the right map view: | |
108 | </p> | |
109 | <pre class="programlisting"><span class="keyword">typedef</span> <span class="special">...</span> <span class="identifier">key_type</span><span class="special">;</span> | |
110 | <span class="keyword">typedef</span> <span class="identifier">Left</span> <span class="identifier">mapped_type</span><span class="special">;</span> | |
111 | ||
112 | <span class="keyword">typedef</span> <span class="identifier">signature</span><span class="special">-</span><span class="identifier">compatible</span> <span class="identifier">with</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="special">...</span> <span class="special">,</span> <span class="identifier">Left</span> <span class="special">></span> <span class="identifier">value_type</span><span class="special">;</span> | |
113 | </pre> | |
114 | <div class="section boost_bimap_reference_unconstrained_set_of_reference_unconstrained_set_of_views_complexity_signature"> | |
115 | <div class="titlepage"><div><div><h5 class="title"> | |
116 | <a name="boost_bimap.reference.unconstrained_set_of_reference.unconstrained_set_of_views.complexity_signature"></a><a name="unconstrained_set_of_complexity_signature"></a><a class="link" href="unconstrained_set_of_reference.html#boost_bimap.reference.unconstrained_set_of_reference.unconstrained_set_of_views.complexity_signature" title="Complexity signature">Complexity | |
117 | signature</a> | |
118 | </h5></div></div></div> | |
119 | <p> | |
120 | We adopt the scheme outlined in the <a class="link" href="bimap_reference.html#complexity_signature_explanation">complexity | |
121 | signature section</a>. An unconstrained view can not be accessed by | |
122 | the user, but the formulas to find the order of an operation for a bimap | |
123 | hold with the following definitions. The complexity signature of a <code class="computeroutput"><span class="identifier">unconstrained_set_of</span></code> view is: | |
124 | </p> | |
125 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | |
126 | <li class="listitem"> | |
127 | copying: <code class="computeroutput"><span class="identifier">c</span><span class="special">(</span><span class="identifier">n</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span></code> | |
128 | </li> | |
129 | <li class="listitem"> | |
130 | insertion: <code class="computeroutput"><span class="identifier">i</span><span class="special">(</span><span class="identifier">n</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span></code> | |
131 | </li> | |
132 | <li class="listitem"> | |
133 | hinted insertion: <code class="computeroutput"><span class="identifier">h</span><span class="special">(</span><span class="identifier">n</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span></code> | |
134 | </li> | |
135 | <li class="listitem"> | |
136 | deletion: <code class="computeroutput"><span class="identifier">d</span><span class="special">(</span><span class="identifier">n</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span></code> | |
137 | </li> | |
138 | <li class="listitem"> | |
139 | replacement: <code class="computeroutput"><span class="identifier">r</span><span class="special">(</span><span class="identifier">n</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span></code> | |
140 | </li> | |
141 | <li class="listitem"> | |
142 | modifying: <code class="computeroutput"><span class="identifier">m</span><span class="special">(</span><span class="identifier">n</span><span class="special">)</span> <span class="special">=</span> <span class="number">0</span></code> | |
143 | </li> | |
144 | </ul></div> | |
145 | </div> | |
146 | <div class="section boost_bimap_reference_unconstrained_set_of_reference_unconstrained_set_of_views_serialization"> | |
147 | <div class="titlepage"><div><div><h5 class="title"> | |
148 | <a name="boost_bimap.reference.unconstrained_set_of_reference.unconstrained_set_of_views.serialization"></a><a class="link" href="unconstrained_set_of_reference.html#boost_bimap.reference.unconstrained_set_of_reference.unconstrained_set_of_views.serialization" title="Serialization">Serialization</a> | |
149 | </h5></div></div></div> | |
150 | <p> | |
151 | Views cannot be serialized on their own, but only as part of the <code class="computeroutput"><span class="identifier">bimap</span></code> into which they are embedded. | |
152 | In describing the additional preconditions and guarantees associated | |
153 | to <code class="computeroutput"><span class="identifier">list_of</span></code> views with | |
154 | respect to serialization of their embedding containers, we use the concepts | |
155 | defined in the <code class="computeroutput"><span class="identifier">bimap</span></code> | |
156 | serialization section. | |
157 | </p> | |
158 | <div class="sidebar"> | |
159 | <div class="titlepage"></div> | |
160 | <p> | |
161 | <span class="bold"><strong>Operation:</strong></span> saving of a <code class="computeroutput"><span class="identifier">bimap</span></code> b to an output archive (XML archive) | |
162 | ar. | |
163 | </p> | |
164 | </div> | |
165 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> | |
166 | <span class="bold"><strong>Requires:</strong></span> No additional requirements | |
167 | to those imposed by the container. | |
168 | </li></ul></div> | |
169 | <div class="sidebar"> | |
170 | <div class="titlepage"></div> | |
171 | <p> | |
172 | <span class="bold"><strong>Operation:</strong></span> loading of a <code class="computeroutput"><span class="identifier">bimap</span></code> b' from an input archive (XML | |
173 | archive) ar. | |
174 | </p> | |
175 | </div> | |
176 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> | |
177 | <span class="bold"><strong>Requires:</strong></span> No additional requirements | |
178 | to those imposed by the container. | |
179 | </li></ul></div> | |
180 | </div> | |
181 | </div> | |
182 | </div> | |
183 | <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> | |
184 | <td align="left"></td> | |
185 | <td align="right"><div class="copyright-footer">Copyright © 2006-2012 Matias Capeletto<p> | |
186 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
187 | 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>) | |
188 | </p> | |
189 | </div></td> | |
190 | </tr></table> | |
191 | <hr> | |
192 | <div class="spirit-nav"> | |
193 | <a accesskey="p" href="vector_of_reference.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><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="../compiler_specifics.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> | |
194 | </div> | |
195 | </body> | |
196 | </html> |