future_work.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0.1 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  5. <title>Boost.Flyweight Documentation - Future work</title>
  6. <link rel="stylesheet" href="style.css" type="text/css">
  7. <link rel="start" href="examples.html">
  8. <link rel="prev" href="tests.html">
  9. <link rel="up" href="index.html">
  10. <link rel="next" href="release_notes.html">
  11. </head>
  12. <body>
  13. <h1><img src="../../../boost.png" alt="Boost logo" align=
  14. "middle" width="277" height="86">Boost.Flyweight Future work</h1>
  15. <div class="prev_link"><a href="tests.html"><img src="prev.gif" alt="examples" border="0"><br>
  16. Tests
  17. </a></div>
  18. <div class="up_link"><a href="index.html"><img src="up.gif" alt="index" border="0"><br>
  19. Index
  20. </a></div>
  21. <div class="next_link"><a href="release_notes.html"><img src="next.gif" alt="release notes" border="0"><br>
  22. Release notes
  23. </a></div><br clear="all" style="clear: all;">
  24. <br clear="all" style="clear: all;">
  25. <hr>
  26. <p>
  27. New functionalities can be included into future releases of Boost.Flyweight
  28. to meet the demands of users and to leverage upcoming C++ features
  29. and new Boost libraries. The following is a list of candidate additions.
  30. </p>
  31. <h2>Contents</h2>
  32. <ul>
  33. <li><a href="#instrospection">Introspection API</a></li>
  34. <li><a href="#rw_lock">Read/write locking policy</a></li>
  35. <li><a href="#new_boost_libs">Integration with new Boost libraries</a></li>
  36. </ul>
  37. <h2><a name="instrospection">Introspection API</a></h2>
  38. <p>
  39. Currently there is no way to access the internal components of a
  40. <code>flyweight</code> instantiation (factory, holder, etc.) or even
  41. to know the types of these components. With such an API it would be
  42. possible to instrument and monitor the usage of Boost.Flyweight like in
  43. the following example:
  44. </p>
  45. <blockquote><pre>
  46. <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>
  47. <span class=special>...</span>
  48. <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>
  49. <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>
  50. </pre></blockquote>
  51. <h2><a name="rw_lock">Read/write locking policy</a></h2>
  52. <p>
  53. The nature of the flyweight pattern implies that most accesses
  54. to the internal flyweight factory do not cause new insertions and can
  55. thus be considered read-only. This hints at the convenience of using
  56. a locking policy based on read/write locks such as those provided by
  57. <a href="../../../doc/html/thread/synchronization.html#thread.synchronization.mutex_concepts.shared_lockable">Boost.Thread</a>.
  58. Implementing a locking policy will also require extending the
  59. <a href="reference/factories.html#factory"><code>Factory</code></a> concept
  60. to allow for pure lookup operations. Tim Blechmann has provided a
  61. preliminary <a href="http://lists.boost.org/Archives/boost/2008/07/139414.php">implementation</a>
  62. of this idea. Before committing to this library extension it is
  63. necessary to do a profiling study to determine whether read/write
  64. locking actually improves performance.
  65. </p>
  66. <h2><a name="new_boost_libs">Integration with new Boost libraries</a></h2>
  67. <p>
  68. Recently accepted Boost libraries like
  69. <a href="http://lists.boost.org/boost-announce/2007/12/0149.php">Boost.Functional/Forward</a>
  70. and <a href="http://lists.boost.org/boost-announce/2007/12/0157.php">Boost.Functional/Factory</a>
  71. might be used in the future to replace some internal machinery of
  72. Boost.Flyweight.
  73. </p>
  74. <hr>
  75. <div class="prev_link"><a href="tests.html"><img src="prev.gif" alt="examples" border="0"><br>
  76. Tests
  77. </a></div>
  78. <div class="up_link"><a href="index.html"><img src="up.gif" alt="index" border="0"><br>
  79. Index
  80. </a></div>
  81. <div class="next_link"><a href="release_notes.html"><img src="next.gif" alt="release notes" border="0"><br>
  82. Release notes
  83. </a></div><br clear="all" style="clear: all;">
  84. <br clear="all" style="clear: all;">
  85. <br>
  86. <p>Revised April 24th 2019</p>
  87. <p>&copy; Copyright 2006-2019 Joaqu&iacute;n M L&oacute;pez Mu&ntilde;oz.
  88. Distributed under the Boost Software
  89. License, Version 1.0. (See accompanying file <a href="../../../LICENSE_1_0.txt">
  90. LICENSE_1_0.txt</a> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">
  91. http://www.boost.org/LICENSE_1_0.txt</a>)
  92. </p>
  93. </body>
  94. </html>