2
0
mirror of https://github.com/boostorg/graph.git synced 2026-02-01 20:42:11 +00:00
Files
graph/docs/EdgePropertyGraph.html
Jeremy Siek 631f3b7e59 various edits
[SVN r7724]
2000-09-18 17:02:49 +00:00

159 lines
4.0 KiB
HTML

<HTML>
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-->
<Head>
<Title>EdgePropertyGraph</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
ALT="C++ Boost">
<BR Clear>
<H2><A NAME="concept:EdgePropertyGraph"></A>
EdgePropertyGraph
</H2>
A EdgePropertyGraph is a graph that has some property associated with
each of the edges in the graph. As a given graph may have several
properties associated with each edge, a tag is used to identity which
property is being accessed. The graph provides a function which
returns a property accessor object.
<H3>Refinement of</H3>
<a href="./Graph.html">Graph</a>
<h3>Notation</h3>
<Table>
<TR>
<TD><tt>G</tt></TD>
<TD>A type that is a model of Graph.</TD>
</TR>
<TR>
<TD><tt>g</tt></TD>
<TD>An object of type <tt>G</tt>.</TD>
</TR>
<TR>
<TD><tt>Tag</tt></TD>
<TD>An empty class used as a tag to specify the property.</TD>
</TR>
<TR>
<TD><tt>tag</tt></TD>
<TD>An object of type <tt>Tag</tt>.</td>
</TR>
</table>
<H3>Associated Types</H3>
<table border>
<tr>
<td>Property Accessor Type</td>
<td><TT>boost::edge_property_accessor&lt;G,Tag&gt;::type</TT> </td>
<td>
The type of the property accessor for the property specified by
<TT>Tag</TT>. This type must be a model of <a
href="../../property_accessor/ReadWritePropertyAccessor.html">ReadWritePropertyAccessor</a>
with a key type the same as the graph's edge descriptor type.
</td>
</td>
<tr>
<td>Const Property Accessor Type </td>
<td><TT>boost::edge_property_accessor&lt;G,Tag&gt;::const_type</TT></td>
<td>
The type of the const property accessor for the property specified by
<TT>Tag</TT>. This type must be a model of <a
href="../../property_accessor/ReadablePropertyAccessor.html">ReadablePropertyAccessor</a>
with a key type the same as the graph's edge descriptor type.
</td>
</tr>
</table>
<h3>Valid Expressions</h3>
<table border>
<tr>
<td>Get Property Accessor Object </td>
<td> <TT>get_edge_property_accessor(g, tag)</TT> </td>
<TD>
<TT>boost::edge_property_accessor&lt;G,Tag&gt;::type</TT> if
<TT>g</TT> is mutable and
<TT>boost::edge_property_accessor&lt;G,Tag&gt;::const_type</TT>
otherwise.
</TD>
</TR>
</TABLE>
<H3>Complexity</H3>
The <TT>get_edge_property_accessor()</TT> function must be constant time.
<P>
<H3>Models</H3>
<UL>
<LI><tt>adjacency_list</tt> with <TT>EdgePluginG=plugin&lt;flow_tag,int, plugin&lt;capacity_tag,int&gt; &gt;</TT> and <TT>Tag=capacity_tag</TT>
</LI>
<LI><tt>adjacency_list</tt> with <TT>plugin&lt;flow_tag,int, plugin&lt;capacity_tag,int&gt; &gt; </TT> and <TT>Tag=flow_tag</TT>
</LI>
</UL>
<P>
<H3>Concept Checking Class</H3>
<P>
<PRE>
template &lt;class G, class Tag&gt;
struct EdgePropertyGraph_concept
{
typedef typename boost::graph_traits&lt;G&gt;::edge_descriptor Edge;
typedef typename edge_property_accessor&lt;G,Tag&gt;::type PA;
typedef typename edge_property_accessor&lt;G,Tag&gt;::const_type const_PA;
void constraints() {
REQUIRE(G, Graph);
REQUIRE2(PA, Edge, ReadWritePropertyAccessor);
REQUIRE2(const_PA, Edge, ReadablePropertyAccessor);
PA pa = get_edge_property_accessor(g, Tag());
}
void const_constraints(const G&amp; g) {
const_PA pa = get_edge_property_accessor(g, Tag());
}
G g;
};
</PRE>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF=http://www.boost.org/people/jeremy_siek.htm>Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
</TD></TR></TABLE>
</BODY>
</HTML>