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: property_writer
</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 property_writer
<PropertyMap, OutputIterator, EventTag
>
24 This is an
<a href=
"./EventVisitor.html">EventVisitor
</a> that can be
25 used to output the property of a vertex or edge at some event-point
29 <tt>property_writer
</tt> can be used with graph algorithms by
30 wrapping it with the algorithm-specific adaptor, such as
<a
31 href=
"./bfs_visitor.html"><tt>bfs_visitor
</tt></a> and
<a
32 href=
"./dfs_visitor.html"><tt>dfs_visitor
</tt></a>. Also, this event
33 visitor can be combined with other event visitors using
34 <tt>std::pair
</tt> to form an EventVisitorList.
38 The following is an excerpt from
<a
39 href=
"../example/dave.cpp"><tt>examples/dave.cpp
</tt></a>.
42 std::ostream_iterator
<int> cout_int(std::cout,
" ");
43 std::ostream_iterator
<char> cout_char(std::cout,
" ");
45 boost::breadth_first_search
46 (G, vertex(a, G), make_bfs_visitor(
47 std::make_pair(write_property(name, cout_char, on_discover_vertex()),
48 std::make_pair(write_property(distance.begin(), cout_int,
49 on_discover_vertex()),
50 std::make_pair(print_edge(name, std::cout, on_examine_edge()),
51 print_endl(std::cout, 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>PropertyMap
</TT></TD>
77 href=
"../../property_map/doc/ReadablePropertyMap.html">ReadablePropertyMap
</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 the
<tt>value_type
</tt> of the property is convertible
81 to the
<tt>value_type
</tt> of the
<tt>OutputIterator
</tt>.
86 <TR><TD><TT>OutputIterator
</TT></TD>
88 The iterator type used to write out the property values, which must be
90 href=
"http://www.sgi.com/tech/stl/OutputIterator.html">OutputIterator
</a>.
96 <TR><TD><TT>EventTag
</TT></TD>
98 The tag to specify when the
<tt>property_writer
</tt> should be
99 applied during the graph algorithm.
106 <H2>Associated Types
</H2>
111 <th>Type
</th><th>Description
</th>
115 <td><tt>property_writer::event_filter
</tt></td>
117 This will be the same type as the template parameter
<tt>EventTag
</tt>.
123 <h3>Member Functions
</h3>
129 <th>Member
</th><th>Description
</th>
134 property_writer(PropertyMap pa, OutputIterator out);
137 Construct a property writer object with the property map
138 <tt>pa
</tt> and output iterator
<tt>out
</tt>.
144 template
<class X, class Graph
><br>
145 void operator()(X x, const Graph& g);
148 This writes the property value for
<tt>x
</tt> to the output iterator.
<br>
149 <tt>*out++ = get(pa, x);
</tt>
155 <h3>Non-Member Functions
</h3>
159 <th>Function
</th><th>Description
</th>
163 template
<class PropertyMap, class OutputIterator, class Tag
><br>
164 property_writer
<PropertyMap, OutputIterator, Tag
><br>
165 write_property(PropertyMap pa, OutputIterator out, Tag);
167 A convenient way to create a
<tt>property_writer
</tt>.
174 <a href=
"./visitor_concepts.html">Visitor concepts
</a>
176 The following are other event visitors:
<a
177 <a href=
"./distance_recorder.html"><tt>distance_recorder
</tt></a>,
178 <a href=
"./predecessor_recorder.html"><tt>predecessor_recorder
</tt></a>,
179 and
<a href=
"./time_stamper.html"><tt>time_stamper
</tt></a>.
186 <TD nowrap
>Copyright
© 2000-
2001</TD><TD>
187 <A HREF=
"http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek
</A>,
188 Indiana University (
<A
189 HREF=
"mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu
</A>)
<br>
190 <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>
191 <A HREF=
"http://www.osl.iu.edu/~lums">Andrew Lumsdaine
</A>,
192 Indiana University (
<A
193 HREF=
"mailto:lums@osl.iu.edu">lums@osl.iu.edu
</A>)
198 <!-- LocalWords: PropertyMap OutputIterator EventTag EventVisitor bfs dfs EventVisitorList
200 <!-- LocalWords: cpp num dtime ftime int WritablePropertyMap map
202 <!-- LocalWords: const Siek Univ Quan Lumsdaine