Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/graph/doc/EventVisitor.html @ 12

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

added boost

File size: 4.4 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: EventVisitor</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>EventVisitor Concept</H1>
23
24This concept defines the interface for single-event visitors. An
25EventVisitor has an apply member function (<tt>operator()</tt>) which
26is invoked within the graph algorithm at the event-point specified by
27the <tt>event_filter</tt> typedef within the
28EventVisitor. EventVisitor's can be combined into an <a
29href="./EventVisitorList.html">EventVistorList</a>.
30
31<p>
32The following is the list of event tags that can be invoked in BGL
33algorithms. Each tag corresponds to a member function of the visitor
34for an algorithm. For example, the <a
35href="./BFSVisitor.html">BFSVisitor</a> of <a
36href="./breadth_first_search.html"><tt>breadth_first_search()</tt></a>
37has a <tt>cycle_edge()</tt> member function. The corresponding tag is
38<tt>on_cycle_edge</tt>. The first argument is the event visitor's
39<tt>operator()</tt> must be either an edge or vertex descriptor
40depending on the event tag.
41
42<pre>
43namespace boost {
44  struct on_initialize_vertex { };
45  struct on_start_vertex { };
46  struct on_discover_vertex { };
47  struct on_examine_edge { };
48  struct on_tree_edge { };
49  struct on_cycle_edge { };
50  struct on_finish_vertex { };
51  struct on_forward_or_cross_edge { };
52  struct on_back_edge { };
53  struct on_edge_relaxed { };
54  struct on_edge_not_relaxed { };
55  struct on_edge_minimized { };
56  struct on_edge_not_minimized { };
57} // namespace boost
58</pre>
59
60
61<h3>Refinement of</h3>
62
63<a href="../../utility/CopyConstructible.html">Copy Constructible</a>
64(copying a visitor should be a lightweight operation).
65
66<h3>Notation</h3>
67
68<Table>
69<TR>
70<TD><tt>G</tt></TD>
71<TD>A type that is a model of <a href="./Graph.html">Graph</a>.</TD>
72</TR>
73
74<TR>
75<TD><tt>g</tt></TD>
76<TD>An object of type <tt>G</tt>.</TD>
77</TR>
78
79<TR>
80<TD><tt>V</tt></TD>
81<TD>A type that is a model of EventVisitor.</TD>
82</TR>
83
84<TR>
85<TD><tt>vis</tt></TD>
86<TD>An object of type <tt>V</tt>.</TD>
87</TR>
88
89<TR>
90<TD><tt>x</tt></TD>
91<TD>An object of type
92<tt>boost::graph_traits&lt;G&gt;::vertex_descriptor</tt>
93or <tt>boost::graph_traits&lt;G&gt;::edge_descriptor</tt>.</TD>
94</TR>
95
96</table>
97
98<h3>Associated Types</h3>
99
100<Table border>
101
102<TR>
103<TD>Event Filter </TD>
104<TD><TT>V::event_filter</TT></TD>
105<TD>
106A tag struct to specify on which event the visitor should be invoked.
107</TD>
108</TR>
109
110</table>
111
112<h3>Valid Expressions</h3>
113
114<Table border>
115
116<tr>
117<th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th>
118</tr>
119
120<tr>
121<td>Apply Visitor</td>
122<td><TT>vis(x, g)</TT></TD>
123<TD><TT>void</TT></TD>
124<TD>
125Invokes the visitor operation on object <tt>x</tt>, which is
126either a vertex or edge descriptor of the graph.
127</TD>
128</TR>
129
130
131</table>
132
133
134<h3>Models</h3>
135
136<ul>
137 <li><a
138 href="./predecessor_recorder.html"><tt>predecessor_recorder</tt></a>
139 <li><a href="./distance_recorder.html"><tt>distance_recorder</tt></a>
140 <li><a href="./time_stamper.html"><tt>time_stamper</tt></a>
141 <li><a href="./property_writer.html"><tt>property_writer</tt></a>
142 <li><a href="./null_visitor.html"><tt>null_visitor</tt></a>
143</ul>
144
145<h3>See Also</h3>
146
147<a href="./EventVisitorList.html">EventVisitorList</a>,
148<a href="./visitor_concepts.html">Visitor concepts</a>
149
150<br>
151<HR>
152<TABLE>
153<TR valign=top>
154<TD nowrap>Copyright &copy 2000-2001</TD><TD>
155<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
156Indiana University (<A
157HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
158<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>
159<A HREF=http://www.osl.iu.edu/~lums>Andrew Lumsdaine</A>,
160Indiana University (<A
161HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
162</TD></TR></TABLE>
163
164</BODY>
165</HTML> 
Note: See TracBrowser for help on using the repository browser.