3 Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
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)
10 <Title>Boost Graph Library: time_stamper
</Title>
11 <BODY BGCOLOR=
"#ffffff" LINK=
"#0000ee" TEXT=
"#000000" VLINK=
"#551a8b"
13 <IMG SRC=
"../../../boost.png"
14 ALT=
"C++ Boost" width=
"277" height=
"86">
20 time_stamper
<TimeMap, TimeT, EventTag
>
24 This is an
<a href=
"./EventVisitor.html">EventVisitor
</a> that can be
25 used to
"stamp
" a time at some event-point within an
26 algorithm. An example of this is recording the discover or finish time
27 of a vertex during a graph search.
30 <tt>time_stamper
</tt> can be used with graph algorithms by
31 wrapping it with the algorithm specific adaptor, such as
<a
32 href=
"./bfs_visitor.html"><tt>bfs_visitor
</tt></a> and
<a
33 href=
"./dfs_visitor.html"><tt>dfs_visitor
</tt></a>. Also, this event
34 visitor can be combined with other event visitors using
35 <tt>std::pair
</tt> to form an EventVisitorList.
39 The following example shows the usage of the
<tt>time_stamper
</tt>.
43 std::vector
<default_color_type> color(num_vertices(G));
44 std::vector
<size_type> dtime(num_vertices(G));
45 std::vector
<size_type> ftime(num_vertices(G));
48 boost::breadth_first_search
49 (G, vertex(s, G), make_bfs_visitor(
50 std::make_pair(stamp_times(dtime.begin(), time, on_discover_vertex()),
51 stamp_times(ftime.begin(), time, on_finish_vertex()))),
57 <a href=
"./EventVisitor.html">EventVisitor
</a>
60 <H3>Where Defined
</H3>
63 <a href=
"../../../boost/graph/visitors.hpp">
64 <TT>boost/graph/visitors.hpp
</TT></a>
66 <H3>Template Parameters
</H3>
71 <th>Parameter
</th><th>Description
</th><th>Default
</th>
74 <TR><TD><TT>TimeMap
</TT></TD>
77 href=
"../../property_map/doc/WritablePropertyMap.html">WritablePropertyMap
</a>
78 where the
<tt>key_type
</tt> is the vertex descriptor type or edge
79 descriptor of the graph (depending on the kind of event tag) and
80 where the
<tt>TimeT
</tt> type is convertible to the
81 <tt>value_type
</tt> of the time property map.
86 <TR><TD><TT>TimeT
</TT></TD>
88 The type for the time counter which should be convertible to the
89 <tt>value_type
</tt> of the time property map
95 <TR><TD><TT>EventTag
</TT></TD>
97 The tag to specify when the
<tt>time_stamper
</tt> should be
98 applied during the graph algorithm.
105 <H2>Associated Types
</H2>
110 <th>Type
</th><th>Description
</th>
114 <td><tt>time_stamper::event_filter
</tt></td>
116 This will be the same type as the template parameter
<tt>EventTag
</tt>.
122 <h3>Member Functions
</h3>
128 <th>Member
</th><th>Description
</th>
133 time_stamper(TimeMap time_pa, TimeT& t);
136 Construct a time stamper object with time property map
137 <tt>time_pa
</tt> and time counter
<tt>t
</tt>.
143 template
<class X, class Graph
><br>
144 void operator()(X x, const Graph& g);
147 This increments the time count and
"stamps
" the time:
<br>
148 <tt>put(time_pa, x, ++t);
</tt>
154 <h3>Non-Member Functions
</h3>
158 <th>Function
</th><th>Description
</th>
162 template
<class TimeMap, class TimeT, class Tag
><br>
163 time_stamper
<TimeMap, TimeT, Tag
><br>
164 stamp_times(TimeMap pa, TimeT& t, Tag);
166 A convenient way to create a
<tt>time_stamper
</tt>.
173 <a href=
"./visitor_concepts.html">Visitor concepts
</a>
175 The following are other event visitors:
<a
176 <a href=
"./distance_recorder.html"><tt>distance_recorder
</tt></a>,
177 <a href=
"./time_stamper.html"><tt>time_stamper
</tt></a>,
178 and
<a href=
"./property_writer.html"><tt>property_writer
</tt></a>.
185 <TD nowrap
>Copyright
© 2000-
2001</TD><TD>
186 <A HREF=
"http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek
</A>,
187 Indiana University (
<A
188 HREF=
"mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu
</A>)
<br>
189 <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>
190 <A HREF=
"http://www.osl.iu.edu/~lums">Andrew Lumsdaine
</A>,
191 Indiana University (
<A
192 HREF=
"mailto:lums@osl.iu.edu">lums@osl.iu.edu
</A>)
197 <!-- LocalWords: TimeMap TimeT EventTag EventVisitor bfs dfs EventVisitorList
199 <!-- LocalWords: cpp num dtime ftime int WritablePropertyMap map
201 <!-- LocalWords: const Siek Univ Quan Lumsdaine