]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/graph/doc/PropertyGraph.html
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / graph / doc / PropertyGraph.html
CommitLineData
7c673cae
FG
1<HTML>
2<!--
3 Copyright (c) Jeremy Siek 2000
4
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)
8 -->
9<Head>
10<Title>PropertyGraph</Title>
11<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
12 ALINK="#ff0000">
13<IMG SRC="../../../boost.png"
14 ALT="C++ Boost" width="277" height="86">
15
16<BR Clear>
17
18<H2><A NAME="concept:PropertyGraph"></A>
19PropertyGraph
20</H2>
21
22A PropertyGraph is a graph that has some property associated with each
23of the vertices or edges in the graph. As a given graph may have
24several properties associated with each vertex or edge, a tag is used
25to identify which property is being accessed. The graph provides a
26function which returns a property map object.
27
28<P>
29
30<H3>Refinement of</H3>
31
32<a href="./Graph.html">Graph</a>
33
34<h3>Notation</h3>
35
36<Table>
37<TR>
38<TD><tt>G</tt></TD>
39<TD>A type that is a model of PropertyGraph.</TD>
40</TR>
41
42<TR>
43<TD><tt>g</tt></TD>
44<TD>An object of type <tt>G</tt>.</TD>
45</TR>
46
47<TR>
48<TD><tt>X</tt></TD>
49<TD>Either the vertex or edge descriptor type for <tt>G</tt>.</TD>
50</TR>
51
52<TR>
53<TD><tt>x</tt></TD>
54<TD>An object of type <tt>X</tt>.</TD>
55</TR>
56
57
58<TR>
59<TD><tt>Map</tt></TD>
60<TD>The type <tt>boost::property_map&lt;G, Property&gt;::const_type</tt>.</TD>
61</TR>
62
63<TR>
64<TD><tt>v</tt></TD>
65<TD>An object of type <tt>boost::property_traits&lt;Map&gt;::value_type</tt>.</TD>
66</TR>
67
68<TR>
69<TD><tt>PropertyTag</tt></TD>
70<TD>A type that models the <a href="./PropertyTag.html">PropertyTag</a> concept.</TD>
71</TR>
72
73<TR>
74<TD><tt>p</tt></TD>
75<TD>An object of type <tt>PropertyTag</tt>.</td>
76</TR>
77
78<TR>
79<TD><tt>pmap</tt></TD>
80<TD>An object of type <tt>Map</tt>.</td>
81</TR>
82
83</table>
84
85<H3>Associated types</H3>
86
87<table border>
88
89<tr>
90<td><pre>boost::property_map&lt;G, PropertyTag&gt;::type</pre>
91The type of the property map for the property specified by
92<TT>PropertyTag</TT>. This type must be a model of <a
93href="../../property_map/doc/ReadWritePropertyMap.html">ReadWritePropertyMap</a>
94with a key type the same as the graph's vertex or edge descriptor type.
95</td>
96</tr>
97
98<tr>
99<td><pre>boost::property_map&lt;G, PropertyTag&gt;::const_type</pre>
100The type of the const property map for the property specified by
101<TT>PropertyTag</TT>. This type must be a model of <a
102href="../../property_map/doc/ReadablePropertyMap.html">ReadablePropertyMap</a>
103with a key type the same as the graph's vertex or edge descriptor type.
104</td>
105</tr>
106
107</table>
108
109<h3>Valid Expressions</h3>
110
111<table border>
112
113<tr>
114<td> <TT>get(p,&nbsp;g)</TT> </td>
115<td>
116Returns the property map for the property specified by the
117<tt>PropertyTag</tt> type. The object <tt>p</tt> is only used to
118carry the type.<br>
119Return type: <TT>boost::property_map&lt;G,&nbsp;PropertyTag&gt;::type</TT> if <TT>g</TT> is mutable and <br><TT>boost::property_map&lt;G,&nbsp;PropertyTag&gt;::const_type</TT> otherwise.
120</td>
121</TR>
122
123<tr>
124<td> <TT>get(p,&nbsp;g,&nbsp;x)</TT> </td>
125<td>
126Returns the property value (specified by the <tt>PropertyTag</tt> type)
127associated with object <tt>x</tt> (a vertex or edge).
128The object <tt>p</tt> is only used to carry the type.
129This function is equivalent to:<br>
130<tt>get(get(p, g), x)</tt><br>
131Return type: <tt>boost::property_traits&lt;Map&gt;::value_type</tt>
132</td>
133</TR>
134
135<tr>
136<td> <TT>put(p,&nbsp;g,&nbsp;x,&nbsp;v)</TT> </td>
137<td>
138Set the property (specified by the <tt>PropertyTag</tt> type)
139associated with object <tt>x</tt> (a vertex or edge) to
140the value <tt>v</tt>. The object <tt>p</tt> is only used to carry the type.
141This function is equivalent to:<br>
142<tt>
143pmap = get(p, g);<br>
144put(pmap, x, v)
145</tt><br>
146Return type: <TT>void</TT>
147</td>
148</TR>
149
150
151</TABLE>
152
153<H3>Complexity</H3>
154
155The <tt>get()</tt> property map function must be constant time.
156
157
158<H3>Models</H3>
159
160
161<UL>
162<LI><tt>adjacency_list</tt> with <tt>VertexProperty=property&lt;vertex_distance_t,int,property&lt;vertex_in_degree_t,int&gt; &gt;</tt> and <tt>PropertyTag=vertex_distance_t</tt>.</li>
163<li><tt>adjacency_list</tt> with <tt>VertexPropertyTag=property&lt;vertex_distance_t,int,property&lt;vertex_in_degree_t,int&gt; &gt;</TT> and <tt>PropertyTag=vertex_in_degree_t</tt>.</li>
164</UL>
165
166
167<H3>Concept Checking Class</H3>
168
169<PRE>
170 template &lt;class Graph, class X, class PropertyTag&gt;
171 struct PropertyGraphConcept
172 {
173 typedef typename property_map&lt;G, PropertyTag&gt;::type Map;
174 typedef typename property_map&lt;G, PropertyTag&gt;::const_type const_Map;
175 void constraints() {
176 BOOST_CONCEPT_ASSERT(( GraphConcept&lt;G&gt; ));
177 BOOST_CONCEPT_ASSERT(( ReadWritePropertyMapConcept&lt;Map, X&gt; ));
178 BOOST_CONCEPT_ASSERT(( ReadablePropertyMapConcept&lt;const_Map, X&gt; ));
179
180 Map pmap = get(PropertyTag(), g);
181 pval = get(PropertyTag(), g, x);
182 put(PropertyTag(), g, x, pval);
183 ignore_unused_variable_warning(pmap);
184 }
185 void const_constraints(const G&amp; g) {
186 const_Map pmap = get(PropertyTag(), g);
187 pval = get(PropertyTag(), g, x);
188 ignore_unused_variable_warning(pmap);
189 }
190 G g;
191 X x;
192 typename property_traits&lt;Map&gt;::value_type pval;
193 };
194</PRE>
195
196
197<h3>See Also</h3>
198
199<a href="./property_map.html"><tt>property_map</tt></a>
200
201<br>
202<HR>
203<TABLE>
204<TR valign=top>
205<TD nowrap>Copyright &copy; 2000-2001</TD><TD>
206<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>)
207</TD></TR></TABLE>
208
209</BODY>
210</HTML>