bfs_visitor.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <HTML>
  2. <!--
  3. Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
  4. Distributed under the Boost Software License, Version 1.0.
  5. (See accompanying file LICENSE_1_0.txt or copy at
  6. http://www.boost.org/LICENSE_1_0.txt)
  7. -->
  8. <Head>
  9. <Title>Boost Graph Library: bfs_visitor</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. <H1>
  16. <pre>
  17. bfs_visitor&lt;EventVisitorList&gt;
  18. </pre>
  19. </H1>
  20. This class is an adapter that converts a list of <a
  21. href="./EventVisitor.html">EventVisitor</a>s (constructed using
  22. <tt>std::pair</tt>) into a <a href="./BFSVisitor.html">BFSVisitor</a>.
  23. <h3>Example</h3>
  24. This is an excerpt from <a
  25. href="../example/bfs.cpp"><tt>examples/bfs.cpp</tt></a> where three
  26. event-visitors are combined to make a BFS visitor. The functions
  27. <tt>boost::record_distances</tt>, <tt>boost::record_predecessors</tt>,
  28. and <tt>copy_graph</tt> are all functions that create an event
  29. visitor.
  30. <pre>
  31. // Construct graph G and obtain the source vertex s ...
  32. boost::breadth_first_search(G, s,
  33. boost::make_bfs_visitor(
  34. std::make_pair(boost::record_distances(d, boost::on_tree_edge()),
  35. std::make_pair(boost::record_predecessors(p.begin(),
  36. boost::on_tree_edge()),
  37. copy_graph(G_copy, boost::on_examine_edge())))) );
  38. </pre>
  39. <h3>Model of</h3>
  40. <a href="./BFSVisitor.html">BFSVisitor</a>
  41. <H3>Template Parameters</H3>
  42. <P>
  43. <TABLE border>
  44. <TR>
  45. <th>Parameter</th><th>Description</th><th>Default</th>
  46. </tr>
  47. <TR><TD><TT>EventVisitorList</TT></TD>
  48. <TD>
  49. A list of <a href="./EventVisitor.html">EventVisitor</a>'s created
  50. with <tt>std::pair</tt>.
  51. </TD>
  52. <TD><a href="./null_visitor.html"><tt>null_visitor</tt></a></TD>
  53. </TR>
  54. </table>
  55. <H3>Where Defined</H3>
  56. <P>
  57. <a href="../../../boost/graph/breadth_first_search.hpp">
  58. <TT>boost/graph/breadth_first_search.hpp</TT></a>
  59. <h3>Member Functions</h3>
  60. This class implements all of the member functions required by <a
  61. href="./BFSVisitor.html">BFSVisitor</a>. In each function the
  62. appropriate event is dispatched to the <a
  63. href="./EventVisitor.html">EventVisitor</a> in the EventVisitorList.
  64. <h3>Non-Member Functions</h3>
  65. <table border>
  66. <tr>
  67. <th>Function</th><th>Description</th>
  68. </tr>
  69. <tr><td><tt>
  70. template &lt;class EventVisitorList&gt;<br>
  71. bfs_visitor&lt;EventVisitorList&gt;<br>
  72. make_bfs_visitor(EventVisitorList ev_list);
  73. </tt></td><td>
  74. Returns the event visitor list adapted to be a BFS visitor.
  75. </td></tr>
  76. </table>
  77. <h3>See Also</h3>
  78. <a href="./visitor_concepts.html">Visitor concepts</a>
  79. <p>
  80. The following are event visitors: <a
  81. href="./predecessor_recorder.html"><tt>predecessor_recorder</tt></a>,
  82. <a href="./distance_recorder.html"><tt>distance_recorder</tt></a>,
  83. <a href="./time_stamper.html"><tt>time_stamper</tt></a>,
  84. and <a href="./property_writer.html"><tt>property_writer</tt></a>.
  85. <br>
  86. <HR>
  87. <TABLE>
  88. <TR valign=top>
  89. <TD nowrap>Copyright &copy; 2000-2001</TD><TD>
  90. <A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
  91. Indiana University (<A
  92. HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
  93. <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>
  94. <A HREF="https://homes.cs.washington.edu/~al75">Andrew Lumsdaine</A>,
  95. Indiana University (<A
  96. HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
  97. </TD></TR></TABLE>
  98. </BODY>
  99. </HTML>