• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<HTML>
2<!--
3     Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
4     Copyright (c) 2010 Matthias Walter (xammy@xammy.homelinux.net)
5     Copyright (c) 2010 Trustees of Indiana University
6
7     Distributed under the Boost Software License, Version 1.0.
8     (See accompanying file LICENSE_1_0.txt or copy at
9     http://www.boost.org/LICENSE_1_0.txt)
10  -->
11<Head>
12<Title>Boost Graph Library: property_put</Title>
13<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
14        ALINK="#ff0000">
15<IMG SRC="../../../boost.png"
16     ALT="C++ Boost" width="277" height="86">
17
18<BR Clear>
19
20<H1>
21<pre>
22property_put&lt;PropertyMap, EventTag&gt;
23</pre>
24</H1>
25
26This is an <a href="./EventVisitor.html">EventVisitor</a> that can be
27used to write a fixed value to a property map when a vertex or edge is
28visited at some event-point within an algorithm.  For example, this
29visitor can be used as an alternative to a loop to initialize a
30property map, or it can be used to mark only back edges with a
31property.
32
33<p>
34<tt>property_put</tt> can be used with graph algorithms by
35wrapping it with the algorithm-specific adaptor, such as <a
36href="./bfs_visitor.html"><tt>bfs_visitor</tt></a> and <a
37href="./dfs_visitor.html"><tt>dfs_visitor</tt></a>. Also, this event
38visitor can be combined with other event visitors using
39<tt>std::pair</tt> to form an EventVisitorList.
40
41<h3>Example</h3>
42
43<pre>
44  boost::depth_first_search
45    (G, boost::visitor(
46          boost::make_dfs_visitor(
47            boost::put_property(is_back_edge, boost::on_back_edge()))));
48</pre>
49
50<h3>Model of</h3>
51
52<a href="./EventVisitor.html">EventVisitor</a>
53
54
55<H3>Where Defined</H3>
56
57<P>
58<a href="../../../boost/graph/visitors.hpp">
59<TT>boost/graph/visitors.hpp</TT></a>
60
61<H3>Template Parameters</H3>
62
63<P>
64<TABLE border>
65<TR>
66<th>Parameter</th><th>Description</th><th>Default</th>
67</tr>
68
69<TR><TD><TT>PropertyMap</TT></TD>
70<TD>
71A <a
72href="../../property_map/doc/WritablePropertyMap.html">WritablePropertyMap</a>,
73where the <tt>key_type</tt> is the vertex descriptor type or edge
74descriptor of the graph (depending on the kind of event tag).
75</TD>
76<TD>&nbsp;</TD>
77</TR>
78
79<TR><TD><TT>EventTag</TT></TD>
80<TD>
81The tag to specify when the <tt>property_put</tt> should be
82applied during the graph algorithm.
83</TD>
84<TD>&nbsp;</TD>
85</TR>
86
87</table>
88
89<H2>Associated Types</H2>
90
91<table border>
92
93<tr>
94<th>Type</th><th>Description</th>
95</tr>
96
97<tr>
98<td><tt>property_put::event_filter</tt></td>
99<td>
100This will be the same type as the template parameter <tt>EventTag</tt>.
101</td>
102</tr>
103
104</table>
105
106<h3>Member Functions</h3>
107
108<p>
109
110<table border>
111<tr>
112<th>Member</th><th>Description</th>
113</tr>
114
115<tr>
116<td><tt>
117property_put(PropertyMap pa, property_traits<PropertyMap>::value_type val);
118</tt></td>
119<td>
120Construct a property put object with the property map
121<tt>pa</tt> and constant value <tt>val</tt>.
122</td>
123</tr>
124
125<tr>
126<td><tt>
127template &lt;class X, class Graph&gt;<br>
128void operator()(X x, const Graph& g);
129</tt></td>
130<td>
131This puts the value <tt>val</tt> into the property map for the vertex
132or edge <tt>x</tt>.<br>
133</td>
134</tr>
135
136</table>
137
138<h3>Non-Member Functions</h3>
139
140<table border>
141<tr>
142<th>Function</th><th>Description</th>
143</tr>
144
145<tr><td><tt>
146template &lt;class PropertyMap, class EventTag&gt;<br>
147property_put&lt;PropertyMap, EventTag&gt;<br>
148put_property(PropertyMap pa,
149             typename property_traits<PropertyMap>::value_type val,
150             EventTag);
151</tt></td><td>
152A convenient way to create a <tt>property_put</tt>.
153</td></tr>
154
155</table>
156
157<h3>See Also</h3>
158
159<a href="./visitor_concepts.html">Visitor concepts</a>
160<p>
161The following are other event visitors: <a
162<a href="./distance_recorder.html"><tt>distance_recorder</tt></a>,
163<a href="./predecessor_recorder.html"><tt>predecessor_recorder</tt></a>,
164and <a href="./time_stamper.html"><tt>time_stamper</tt></a>.
165
166<br>
167<HR>
168<TABLE>
169<TR valign=top>
170<TD nowrap>Copyright &copy; 2000-2001</TD><TD>
171<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
172Indiana University (<A
173HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
174<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>
175<A HREF="https://homes.cs.washington.edu/~al75">Andrew Lumsdaine</A>,
176Indiana University (<A
177HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
178</TD></TR>
179<tr><td>Copyright &copy; 2010</td><td>Matthias Walter (<a href="mailto:xammy@xammy.homelinux.net">xammy@xammy.homelinux.net</a>)</td></tr>
180<tr><td></td><td>Trustees of Indiana University</td></tr>
181</TABLE>
182
183</BODY>
184</HTML>
185<!--  LocalWords:  PropertyMap OutputIterator EventTag EventVisitor bfs dfs EventVisitorList
186 -->
187<!--  LocalWords:  cpp num dtime ftime int WritablePropertyMap map adaptor
188 -->
189<!--  LocalWords:  const Siek Univ Quan Lumsdaine typename
190 -->
191