]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/flyweight/doc/future_work.html
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / flyweight / doc / future_work.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0.1 Transitional//EN">
2
3 <html>
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6 <title>Boost.Flyweight Documentation - Future work</title>
7 <link rel="stylesheet" href="style.css" type="text/css">
8 <link rel="start" href="examples.html">
9 <link rel="prev" href="tests.html">
10 <link rel="up" href="index.html">
11 <link rel="next" href="release_notes.html">
12 </head>
13
14 <body>
15 <h1><img src="../../../boost.png" alt="Boost logo" align=
16 "middle" width="277" height="86">Boost.Flyweight Future work</h1>
17
18 <div class="prev_link"><a href="tests.html"><img src="prev.gif" alt="examples" border="0"><br>
19 Tests
20 </a></div>
21 <div class="up_link"><a href="index.html"><img src="up.gif" alt="index" border="0"><br>
22 Index
23 </a></div>
24 <div class="next_link"><a href="release_notes.html"><img src="next.gif" alt="release notes" border="0"><br>
25 Release notes
26 </a></div><br clear="all" style="clear: all;">
27 <br clear="all" style="clear: all;">
28
29 <hr>
30
31 <p>
32 New functionalities can be included into future releases of Boost.Flyweight
33 to meet the demands of users and to leverage upcoming C++0x features
34 and new Boost libraries. The following is a list of candidate additions.
35 </p>
36
37 <h2>Contents</h2>
38
39 <ul>
40 <li><a href="#instrospection">Introspection API</a></li>
41 <li><a href="#perfect_fwd">Perfect forwarding</a></li>
42 <li><a href="#rw_lock">Read/write locking policy</a></li>
43 <li><a href="#new_boost_libs">Integration with new Boost libraries</a></li>
44 </ul>
45
46 <h2><a name="instrospection">Introspection API</a></h2>
47
48 <p>
49 Currently there is no way to access the internal components of a
50 <code>flyweight</code> instantiation (factory, holder, etc.) or even
51 to know the types of these components. With such an API it would be
52 possible to instrument and monitor the usage of Boost.Flyweight like in
53 the following example:
54 </p>
55
56 <blockquote><pre>
57 <span class=keyword>typedef</span> <span class=identifier>flyweight</span><span class=special>&lt;</span><span class=identifier>std</span><span class=special>::</span><span class=identifier>string</span><span class=special>&gt;</span> <span class=identifier>fw_type</span><span class=special>;</span>
58 <span class=special>...</span>
59 <span class=identifier>std</span><span class=special>::</span><span class=identifier>cout</span><span class=special>&lt;&lt;</span><span class=string>&quot;factory used: &quot;</span><span class=special>&lt;&lt;</span><span class=keyword>typeid</span><span class=special>(</span><span class=identifier>fw_type</span><span class=special>::</span><span class=identifier>factory_type</span><span class=special>).</span><span class=identifier>name</span><span class=special>()&lt;&lt;</span><span class=identifier>std</span><span class=special>::</span><span class=identifier>endl</span><span class=special>;</span>
60 <span class=identifier>std</span><span class=special>::</span><span class=identifier>cout</span><span class=special>&lt;&lt;</span><span class=string>&quot;values stored: &quot;</span><span class=special>&lt;&lt;</span><span class=identifier>fw_type</span><span class=special>::</span><span class=identifier>factory</span><span class=special>().</span><span class=identifier>size</span><span class=special>()&lt;&lt;</span><span class=identifier>std</span><span class=special>::</span><span class=identifier>endl</span><span class=special>;</span>
61 </pre></blockquote>
62
63 <h2><a name="perfect_fwd">Perfect forwarding</a></h2>
64
65 <p>
66 When constructing a <code>flyweight&lt;T&gt; object</code>, some spurious copies
67 of objects of type <code>T</code> are incurred in the process of moving the value
68 into the internal factory. So-called <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2027.html#Perfect_Forwarding"><i>perfect
69 forwarding</i></a>, i.e. performing the move without generating temporary
70 copies, will be solved in an optimum manner by a new
71 type of <i>rvalue references</i> to be included in the next revision of the
72 C++ standard. Boost.Flyweight will take advantage of this feature as
73 compilers begin to provide it.
74 </p>
75
76 <h2><a name="rw_lock">Read/write locking policy</a></h2>
77
78 <p>
79 The nature of the flyweight pattern implies that most accesses
80 to the internal flyweight factory do not cause new insertions and can
81 thus be considered read-only. This hints at the convenience of using
82 a locking policy based on read/write locks such as those provided by
83 <a href="../../../doc/html/thread/synchronization.html#thread.synchronization.mutex_concepts.shared_lockable">Boost.Thread</a>.
84 Implementing a locking policy will also require extending the
85 <a href="reference/factories.html#factory"><code>Factory</code></a> concept
86 to allow for pure lookup operations. Tim Blechmann has provided a
87 preliminary <a href="http://lists.boost.org/Archives/boost/2008/07/139414.php">implementation</a>
88 of this idea. Before committing to this library extension it is
89 necessary to do a profiling study to determine whether read/write
90 locking actually improves performance.
91 </p>
92
93 <h2><a name="new_boost_libs">Integration with new Boost libraries</a></h2>
94
95 <p>
96 Recently accepted Boost libraries like
97 <a href="http://lists.boost.org/boost-announce/2007/12/0149.php">Boost.Functional/Forward</a>
98 and <a href="http://lists.boost.org/boost-announce/2007/12/0157.php">Boost.Functional/Factory</a>
99 might be used in the future to replace some internal machinery of
100 Boost.Flyweight.
101 </p>
102
103 <hr>
104
105 <div class="prev_link"><a href="tests.html"><img src="prev.gif" alt="examples" border="0"><br>
106 Tests
107 </a></div>
108 <div class="up_link"><a href="index.html"><img src="up.gif" alt="index" border="0"><br>
109 Index
110 </a></div>
111 <div class="next_link"><a href="release_notes.html"><img src="next.gif" alt="release notes" border="0"><br>
112 Release notes
113 </a></div><br clear="all" style="clear: all;">
114 <br clear="all" style="clear: all;">
115
116 <br>
117
118 <p>Revised September 1st 2008</p>
119
120 <p>&copy; Copyright 2006-2008 Joaqu&iacute;n M L&oacute;pez Mu&ntilde;oz.
121 Distributed under the Boost Software
122 License, Version 1.0. (See accompanying file <a href="../../../LICENSE_1_0.txt">
123 LICENSE_1_0.txt</a> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">
124 http://www.boost.org/LICENSE_1_0.txt</a>)
125 </p>
126
127 </body>
128 </html>