File: EventVisitor.html

package info (click to toggle)
boost1.35 1.35.0-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 203,856 kB
  • ctags: 337,867
  • sloc: cpp: 938,683; xml: 56,847; ansic: 41,589; python: 18,999; sh: 11,566; makefile: 664; perl: 494; yacc: 456; asm: 353; csh: 6
file content (161 lines) | stat: -rw-r--r-- 4,176 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<HTML>
<!--
  -- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
  --
  -- Distributed under the Boost Software License, Version 1.0.
  -- (See accompanying file LICENSE_1_0.txt or copy at
  -- http://www.boost.org/LICENSE_1_0.txt)
  -->
<Head>
<Title>Boost Graph Library: EventVisitor</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" 
        ALINK="#ff0000"> 
<IMG SRC="../../../boost.png" 
     ALT="C++ Boost" width="277" height="86"> 

<BR Clear>

<H1>EventVisitor Concept</H1>

This concept defines the interface for single-event visitors. An
EventVisitor has an apply member function (<tt>operator()</tt>) which
is invoked within the graph algorithm at the event-point specified by
the <tt>event_filter</tt> typedef within the
EventVisitor. EventVisitor's can be combined into an <a
href="./EventVisitorList.html">EventVistorList</a>.

<p>
The following is the list of event tags that can be invoked in BGL
algorithms. Each tag corresponds to a member function of the visitor
for an algorithm. For example, the <a
href="./BFSVisitor.html">BFSVisitor</a> of <a
href="./breadth_first_search.html"><tt>breadth_first_search()</tt></a>
has a <tt>cycle_edge()</tt> member function. The corresponding tag is
<tt>on_cycle_edge</tt>. The first argument is the event visitor's
<tt>operator()</tt> must be either an edge or vertex descriptor
depending on the event tag.

<pre>
namespace boost {
  struct on_initialize_vertex { };
  struct on_start_vertex { };
  struct on_discover_vertex { };
  struct on_examine_edge { };
  struct on_tree_edge { };
  struct on_cycle_edge { };
  struct on_finish_vertex { };
  struct on_forward_or_cross_edge { };
  struct on_back_edge { };
  struct on_edge_relaxed { };
  struct on_edge_not_relaxed { };
  struct on_edge_minimized { };
  struct on_edge_not_minimized { };
} // namespace boost
</pre>


<h3>Refinement of</h3>

<a href="../../utility/CopyConstructible.html">Copy Constructible</a>
(copying a visitor should be a lightweight operation).

<h3>Notation</h3>

<Table>
<TR>
<TD><tt>G</tt></TD>
<TD>A type that is a model of <a href="./Graph.html">Graph</a>.</TD>
</TR>

<TR>
<TD><tt>g</tt></TD>
<TD>An object of type <tt>G</tt>.</TD>
</TR>

<TR>
<TD><tt>V</tt></TD>
<TD>A type that is a model of EventVisitor.</TD>
</TR>

<TR>
<TD><tt>vis</tt></TD>
<TD>An object of type <tt>V</tt>.</TD>
</TR>

<TR>
<TD><tt>x</tt></TD>
<TD>An object of type
<tt>boost::graph_traits&lt;G&gt;::vertex_descriptor</tt>
or <tt>boost::graph_traits&lt;G&gt;::edge_descriptor</tt>.</TD>
</TR>

</table>

<h3>Associated Types</h3>

<Table border>

<TR>
<TD>Event Filter </TD>
<TD><TT>V::event_filter</TT></TD>
<TD>
A tag struct to specify on which event the visitor should be invoked.
</TD>
</TR>

</table>

<h3>Valid Expressions</h3>

<Table border>

<tr>
<th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th>
</tr>

<tr>
<td>Apply Visitor</td>
<td><TT>vis(x, g)</TT></TD>
<TD><TT>void</TT></TD>
<TD>
Invokes the visitor operation on object <tt>x</tt>, which is
either a vertex or edge descriptor of the graph.
</TD>
</TR>


</table>


<h3>Models</h3>

<ul>
 <li><a
 href="./predecessor_recorder.html"><tt>predecessor_recorder</tt></a>
 <li><a href="./distance_recorder.html"><tt>distance_recorder</tt></a>
 <li><a href="./time_stamper.html"><tt>time_stamper</tt></a>
 <li><a href="./property_writer.html"><tt>property_writer</tt></a>
 <li><a href="./null_visitor.html"><tt>null_visitor</tt></a>
</ul>

<h3>See Also</h3>

<a href="./EventVisitorList.html">EventVisitorList</a>,
<a href="./visitor_concepts.html">Visitor concepts</a>

<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000-2001</TD><TD>
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
Indiana University (<A
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
<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>
<A HREF=http://www.osl.iu.edu/~lums>Andrew Lumsdaine</A>,
Indiana University (<A
HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
</TD></TR></TABLE>

</BODY>
</HTML>