KeyedUpdatableQueue.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <!DOCTYPE html>
  2. <!--
  3. Copyright Daniel Trebbien 2010.
  4. Distributed under the Boost Software License, Version 1.0.
  5. (See accompanying file LICENSE_1_0.txt or the copy at
  6. http://www.boost.org/LICENSE_1_0.txt)
  7. -->
  8. <html>
  9. <head>
  10. <title>KeyedUpdatableQueue</title>
  11. </head>
  12. <body>
  13. <img src="../../../boost.png" alt="C++ Boost">
  14. <h2><a name="concept:KeyedUpdatableQueue">KeyedUpdatableQueue</a></h2>
  15. <p>A <i>KeyedUpdatableQueue</i> is a refinement of the <a href="./UpdatableQueue.html">UpdatableQueue</a> concept.
  16. It requires that models order the contained values by their <i>keys</i>, to which
  17. values are mapped via a read/write key map.
  18. <h3>Notation</h3>
  19. <table>
  20. <tr> <td> <tt>Q</tt> </td> <td> is a type that models KeyedUpdatableQueue. </td></tr>
  21. <tr> <td> <tt>T</tt> </td> <td> is the value type of <tt>Q</tt>. </td></tr>
  22. </table>
  23. <h3>Members</h3>
  24. For a type to model the KeyedUpdatableQueue concept it must have the following members
  25. in addition to the members that are required of types that model <a href="./UpdatableQueue.html">UpdatableQueue</a>:
  26. <p>
  27. <table border="1">
  28. <tr> <td><b>Member</b></td> <td><b>Description</b></td> </tr>
  29. <tr> <td> <tt>key_type</tt> </td>
  30. <td> The type of keys that are associated with values </td>
  31. </tr>
  32. <tr> <td> <tt>key_map</tt> </td>
  33. <td> The key property map type. This type must model <a href="../../property_map/doc/ReadWritePropertyMap.html">Read/Write Property Map</a>. </td>
  34. </tr>
  35. <tr> <td> <tt>key_map keys() const</tt> </td>
  36. <td> Returns the key map </td>
  37. </tr>
  38. </table>
  39. <h3>Concept Checking Class</h3>
  40. <p><a href="../../../boost/graph/buffer_concepts.hpp"><tt>boost/graph/buffer_concepts.hpp</tt></a>
  41. <pre>
  42. template &lt;class Q&gt;
  43. struct KeyedUpdatableQueueConcept
  44. {
  45. typedef typename Q::key_type key_type;
  46. typedef typename Q::key_map key_map;
  47. void constraints() {
  48. BOOST_CONCEPT_ASSERT(( UpdatableQueue&lt;Q&gt; ));
  49. BOOST_CONCEPT_ASSERT(( ReadWritePropertyMap&lt; key_map, typename Buffer&lt;Q&gt;::value_type &gt; ));
  50. }
  51. void const_constraints(const Q&amp; cq) {
  52. km = cq.keys();
  53. k = get(km, g_ct);
  54. }
  55. static const typename Buffer&lt;Q&gt;::value_type g_ct;
  56. key_type k;
  57. key_map km;
  58. Q q;
  59. };
  60. </pre>
  61. <h3>Models</h3>
  62. <ul>
  63. <li><tt>boost::d_ary_heap_indirect</tt></a>
  64. </ul>
  65. <br>
  66. <hr>
  67. <table>
  68. <tr>
  69. <td>Copyright&nbsp;&copy;&nbsp;2010</td>
  70. <td>Daniel Trebbien (<a href="mailto:dtrebbien@gmail.com">dtrebbien@gmail.com</a>)
  71. </td>
  72. </tr>
  73. </table>
  74. </body>
  75. </html>