static_property_map.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <HTML>
  2. <!--
  3. Copyright 2006, 2013 The Trustees of Indiana University
  4. Use, modification and distribution is subject to the Boost Software
  5. License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. http://www.boost.org/LICENSE_1_0.txt)
  7. -->
  8. <Head>
  9. <Title>Static Property Map</Title>
  10. <BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
  11. ALINK="#ff0000">
  12. <IMG SRC="../../../boost.png"
  13. ALT="C++ Boost" width="277" height="86">
  14. <BR Clear>
  15. <H2><A NAME="sec:static-property-map"></A>
  16. </h2>
  17. <PRE>
  18. template &lt;typename ValueType, typename KeyType = void&gt;
  19. class static_property_map
  20. </PRE>
  21. This property map wraps a copy of some particular object, and
  22. returns a copy of that object whenever a key object is input.
  23. <H3>Where Defined</H3>
  24. <P>
  25. <a href="../../../boost/property_map/property_map.hpp"><TT>boost/property_map/property_map.hpp</TT></a>
  26. <h3>Model of</h3>
  27. <a href="./ReadablePropertyMap.html">Readable Property Map</a>
  28. <h3>Associated Types</h3>
  29. <table border>
  30. <tr>
  31. <th>Type</th><th>Description</th>
  32. </tr>
  33. <tr>
  34. <td><tt>
  35. boost::property_traits&lt;static_property_map&gt;::value_type
  36. </tt></td>
  37. <td>
  38. This type is the <tt>ValueType</tt> with which the template was instantiated.
  39. </td>
  40. </tr>
  41. <tr>
  42. <td><tt>
  43. boost::property_traits&lt;static_property_map&gt;::key_type
  44. </tt></td>
  45. <td>
  46. This type is the <tt>KeyType</tt> with which the template was instantiated.
  47. </td>
  48. </tr>
  49. <tr>
  50. <td><tt>
  51. boost::property_traits&lt;static_property_map&gt;::category
  52. </tt></td>
  53. <td>
  54. This type is <tt>boost::readable_property_map_tag</tt>.
  55. </td>
  56. </tr>
  57. </table>
  58. <h3>Member Functions</h3>
  59. <table border>
  60. <tr>
  61. <th>Member</th><th>Description</th>
  62. </tr>
  63. <tr>
  64. <td><tt>
  65. static_property_map(ValueType v)
  66. </tt></td>
  67. <td>
  68. The constructor for static_property_map is provided the value that
  69. the property map will return when queried.
  70. </td>
  71. </tr>
  72. <tr>
  73. <td><tt>
  74. static_property_map(const static_property_map&amp; x)
  75. </tt></td>
  76. <td>
  77. Copy constructor.
  78. </td>
  79. </tr>
  80. <tr>
  81. <td><pre>
  82. template &lt;typename T&gt;
  83. ValueType&amp; operator[](T) const
  84. </pre></td>
  85. <td>
  86. Returns the contained value by copy.
  87. </td>
  88. </tr>
  89. </table>
  90. <h3>Non-Member Functions</h3>
  91. <table border>
  92. <tr><td><pre>
  93. template &lt;typename KeyType, typename ValueType&gt;
  94. static_property_map&lt;KeyType, ValueType&gt;
  95. make_static_property_map(const ValueType&amp; value);
  96. </pre></td>
  97. <td>Returns a <tt>static_property_map</tt> with the given key type initialized to the given value.</td>
  98. </tr>
  99. </table>
  100. </BODY>
  101. </HTML>