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