Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/graph/doc/bfs_visitor.html @ 14

Last change on this file since 14 was 12, checked in by landauf, 18 years ago

added boost

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