property_put.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <HTML>
  2. <!--
  3. Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
  4. Copyright (c) 2010 Matthias Walter (xammy@xammy.homelinux.net)
  5. Copyright (c) 2010 Trustees of Indiana University
  6. Distributed under the Boost Software License, Version 1.0.
  7. (See accompanying file LICENSE_1_0.txt or copy at
  8. http://www.boost.org/LICENSE_1_0.txt)
  9. -->
  10. <Head>
  11. <Title>Boost Graph Library: property_put</Title>
  12. <BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
  13. ALINK="#ff0000">
  14. <IMG SRC="../../../boost.png"
  15. ALT="C++ Boost" width="277" height="86">
  16. <BR Clear>
  17. <H1>
  18. <pre>
  19. property_put&lt;PropertyMap, EventTag&gt;
  20. </pre>
  21. </H1>
  22. This is an <a href="./EventVisitor.html">EventVisitor</a> that can be
  23. used to write a fixed value to a property map when a vertex or edge is
  24. visited at some event-point within an algorithm. For example, this
  25. visitor can be used as an alternative to a loop to initialize a
  26. property map, or it can be used to mark only back edges with a
  27. property.
  28. <p>
  29. <tt>property_put</tt> can be used with graph algorithms by
  30. wrapping it with the algorithm-specific adaptor, such as <a
  31. href="./bfs_visitor.html"><tt>bfs_visitor</tt></a> and <a
  32. href="./dfs_visitor.html"><tt>dfs_visitor</tt></a>. Also, this event
  33. visitor can be combined with other event visitors using
  34. <tt>std::pair</tt> to form an EventVisitorList.
  35. <h3>Example</h3>
  36. <pre>
  37. boost::depth_first_search
  38. (G, boost::visitor(
  39. boost::make_dfs_visitor(
  40. boost::put_property(is_back_edge, boost::on_back_edge()))));
  41. </pre>
  42. <h3>Model of</h3>
  43. <a href="./EventVisitor.html">EventVisitor</a>
  44. <H3>Where Defined</H3>
  45. <P>
  46. <a href="../../../boost/graph/visitors.hpp">
  47. <TT>boost/graph/visitors.hpp</TT></a>
  48. <H3>Template Parameters</H3>
  49. <P>
  50. <TABLE border>
  51. <TR>
  52. <th>Parameter</th><th>Description</th><th>Default</th>
  53. </tr>
  54. <TR><TD><TT>PropertyMap</TT></TD>
  55. <TD>
  56. A <a
  57. href="../../property_map/doc/WritablePropertyMap.html">WritablePropertyMap</a>,
  58. where the <tt>key_type</tt> is the vertex descriptor type or edge
  59. descriptor of the graph (depending on the kind of event tag).
  60. </TD>
  61. <TD>&nbsp;</TD>
  62. </TR>
  63. <TR><TD><TT>EventTag</TT></TD>
  64. <TD>
  65. The tag to specify when the <tt>property_put</tt> should be
  66. applied during the graph algorithm.
  67. </TD>
  68. <TD>&nbsp;</TD>
  69. </TR>
  70. </table>
  71. <H2>Associated Types</H2>
  72. <table border>
  73. <tr>
  74. <th>Type</th><th>Description</th>
  75. </tr>
  76. <tr>
  77. <td><tt>property_put::event_filter</tt></td>
  78. <td>
  79. This will be the same type as the template parameter <tt>EventTag</tt>.
  80. </td>
  81. </tr>
  82. </table>
  83. <h3>Member Functions</h3>
  84. <p>
  85. <table border>
  86. <tr>
  87. <th>Member</th><th>Description</th>
  88. </tr>
  89. <tr>
  90. <td><tt>
  91. property_put(PropertyMap pa, property_traits<PropertyMap>::value_type val);
  92. </tt></td>
  93. <td>
  94. Construct a property put object with the property map
  95. <tt>pa</tt> and constant value <tt>val</tt>.
  96. </td>
  97. </tr>
  98. <tr>
  99. <td><tt>
  100. template &lt;class X, class Graph&gt;<br>
  101. void operator()(X x, const Graph& g);
  102. </tt></td>
  103. <td>
  104. This puts the value <tt>val</tt> into the property map for the vertex
  105. or edge <tt>x</tt>.<br>
  106. </td>
  107. </tr>
  108. </table>
  109. <h3>Non-Member Functions</h3>
  110. <table border>
  111. <tr>
  112. <th>Function</th><th>Description</th>
  113. </tr>
  114. <tr><td><tt>
  115. template &lt;class PropertyMap, class EventTag&gt;<br>
  116. property_put&lt;PropertyMap, EventTag&gt;<br>
  117. put_property(PropertyMap pa,
  118. typename property_traits<PropertyMap>::value_type val,
  119. EventTag);
  120. </tt></td><td>
  121. A convenient way to create a <tt>property_put</tt>.
  122. </td></tr>
  123. </table>
  124. <h3>See Also</h3>
  125. <a href="./visitor_concepts.html">Visitor concepts</a>
  126. <p>
  127. The following are other event visitors: <a
  128. <a href="./distance_recorder.html"><tt>distance_recorder</tt></a>,
  129. <a href="./predecessor_recorder.html"><tt>predecessor_recorder</tt></a>,
  130. and <a href="./time_stamper.html"><tt>time_stamper</tt></a>.
  131. <br>
  132. <HR>
  133. <TABLE>
  134. <TR valign=top>
  135. <TD nowrap>Copyright &copy; 2000-2001</TD><TD>
  136. <A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
  137. Indiana University (<A
  138. HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
  139. <A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@cs.indiana.edu</A>)<br>
  140. <A HREF="https://homes.cs.washington.edu/~al75">Andrew Lumsdaine</A>,
  141. Indiana University (<A
  142. HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
  143. </TD></TR>
  144. <tr><td>Copyright &copy; 2010</td><td>Matthias Walter (<a href="mailto:xammy@xammy.homelinux.net">xammy@xammy.homelinux.net</a>)</td></tr>
  145. <tr><td></td><td>Trustees of Indiana University</td></tr>
  146. </TABLE>
  147. </BODY>
  148. </HTML>
  149. <!-- LocalWords: PropertyMap OutputIterator EventTag EventVisitor bfs dfs EventVisitorList
  150. -->
  151. <!-- LocalWords: cpp num dtime ftime int WritablePropertyMap map adaptor
  152. -->
  153. <!-- LocalWords: const Siek Univ Quan Lumsdaine typename
  154. -->