This commit was manufactured by cvs2svn to create branch 'RC_1_28_0'.

[SVN r13795]
This commit is contained in:
nobody
2002-05-10 04:34:27 +00:00
parent 247ecc439a
commit 5df94cd0e2
7 changed files with 0 additions and 987 deletions

View File

@@ -1,106 +0,0 @@
<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>LvaluePropertyAccessor</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:LvaluePropertyAccessor"></A>
LvaluePropertyAccessor
</H2>
The LvaluePropertyAccessor provides an interface for accessing a
reference to a property object (instead of a copy of the object as in
the <TT>get()</TT> function required by <a
href="./ReadablePropertyAccessor.html">ReadablePropertyAccessor</a>). An
LvaluePropertyAccessor can be <I>mutable</I> or
<I>non-mutable</I>. The mutable LvaluePropertyAccessor returns a
reference whereas the non-mutable returns a const reference.
<H3>Refinement of</H3>
<a href="./ReadablePropertyAccessor.html">ReadablePropertyAccessor</a>
for non-mutable or <a href="./ReadWritePropertyAccessor.html">ReadWritePropertyAccessor</a> for mutable property accessor.
<h3>Notation</h3>
<Table>
<TR>
<TD><tt>PA</tt></TD>
<TD>A type that is a model of LvaluePropertyAccessor.</TD>
</TR>
<TR>
<TD><tt>pa</tt></TD>
<TD>An object of type <tt>PA</tt>.</td>
</TR>
<TR>
<TD><tt>key</tt></TD>
<TD>An object of type <tt>boost::property_traits&lt;PA&gt;::key_type</tt>.</td>
</TR>
</table>
<h3>Associated Types</h3>
<table border>
<tr>
<td>Property Accessor Category
<td><TT>boost::property_traits&lt;PA&gt;::category</TT></td>
<td>
The category of the property: a type convertible to
<TT>boost::lvalue_property_accessor_tag</TT>.
</td>
</tr>
</table>
<h3>Valid Expressions</h3>
<table border>
<tr>
<th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th>
</tr>
<tr>
<td>Access Property Value </td>
<TD><TT>pa[key]</TT></TD>
<TD>
<TT>value_type&amp;</TT> for mutable, <TT>const value_type&amp;</TT>
otherwise.
</TD>
<TD>Obtain a reference to the property identified by <TT>key</TT>.</TD>
</TR>
</TABLE>
<h3>See Also</h3>
<a href="./property_accessor.html">Property accessor concepts</a>
<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>

View File

@@ -1,79 +0,0 @@
<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>ReadWritePropertyAccessor</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:ReadWritePropertyAccessor"></A>
<BR>
ReadWritePropertyAccessor
</H2>
A ReadWritePropertyAccessor can be used to read property values via
the <tt>get()</tt> function and can be used to write property values
via the <tt>put()</tt> function.
<H3>Refinement of</H3>
<a href="./ReadablePropertyAccessor.html">ReadablePropertyAccessor</a>
and
<a href="./WritablePropertyAccessor.html">WritablePropertyAccessor</a>
<h3>Notation</h3>
<Table>
<TR>
<TD><tt>PA</tt></TD>
<TD>A type that is a model of LvaluePropertyAccessor.</TD>
</TR>
</table>
<h2>Associated Types</h2>
<table border>
<tr>
<td>Property Accessor Category
<td><TT>boost::property_traits&lt;PA&gt;::category</TT></td>
<td>
The category of the property accessor must be a type convertible to
<TT>read_write_property_accessor_tag</TT>.
</td>
</tr>
</table>
<h3>See Also</h3>
<a href="./property_accessor.html">Property accessor concepts</a>
<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>

View File

@@ -1,114 +0,0 @@
<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>ReadablePropertyAccessor</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:ReadablePropertyAccessor"></A>
ReadablePropertyAccessor
</H2>
A ReadablePropertyAccessor provides read-access to the value object
associted with a given key via a call to the <tt>get()</tt> function.
The <tt>get()</tt> function returns a copy of the value object.
<h3>Refinement of</h3>
<a href="../utility/CopyConstructible.html">CopyConstructible</a>
<h3>Notation</h3>
<Table>
<TR>
<TD><tt>PA</tt></TD>
<TD>A type that is a model of LvaluePropertyAccessor.</TD>
</TR>
<TR>
<TD><tt>pa</tt></TD>
<TD>An object of type <tt>PA</tt>.</td>
</TR>
<TR>
<TD><tt>key</tt></TD>
<TD>An object of type <tt>boost::property_traits&lt;PA&gt;::key_type</tt>.</td>
</TR>
</table>
<h3>Associated Types</h3>
<table border>
<tr>
<td>Value Type </td>
<td><TT>boost::property_traits&lt;PA&gt;::value_type</TT></td>
<td>The type of the property.</td>
</tr>
<tr>
<td>Key Type</td>
<td><TT>boost::property_traits&lt;PA&gt;::key_type</TT></td>
<td>
The type of the key object used to look up the property. The property
accessor may be templated on the key type, in which case this
typedef can be <TT>void</TT>.
</td>
</tr>
<tr>
<td>Property Accessor Category</td>
<td><TT>boost::property_traits&lt;PA&gt;::category</TT></td>
<td>
The category of the property: a type convertible to
<TT>readable_property_accessor_tag</TT>.
</td>
</tr>
</table>
<h3>Valid Expressions</h3>
<table border>
<tr>
<th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th>
</tr>
<tr>
<td>Get Property Value </td>
<TD><TT>get(pa, key)</TT></TD>
<TD><TT>value_type</TT></TD>
<TD>Lookup the property of the object identified by <TT>key</TT>.</TD>
</TR>
</TABLE>
<h3>See Also</h3>
<a href="./property_accessor.html">Property accessor concepts</a>
<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>

View File

@@ -1,140 +0,0 @@
<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>WritablePropertyAccessor</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:WritablePropertyAccessor"></A>
WritablePropertyAccessor
</H2>
A WritablePropertyAccessor has the capability of setting the value
object associated with the given key object via the <tt>put()</tt>
function.
<h3>Refinement of</h3>
<a href="../utility/CopyConstructible.html">CopyConstructible</a>
<h3>Notation</h3>
<Table>
<TR>
<TD><tt>PA</tt></TD>
<TD>A type that is a model of LvaluePropertyAccessor.</TD>
</TR>
<TR>
<TD><tt>pa</tt></TD>
<TD>An object of type <tt>PA</tt>.</td>
</TR>
<TR>
<TD><tt>key</tt></TD>
<TD>An object of type <tt>boost::property_traits&lt;PA&gt;::key_type</tt>.</td>
</TR>
<TR>
<TD><tt>val</tt></TD>
<TD>An object of type <tt>boost::property_traits&lt;PA&gt;::value_type</tt>.</td>
</TR>
</table>
<h3>Associated Types</h3>
<table border>
<tr>
<td>Value Type</td>
<td><TT>boost::property_traits&lt;PA&gt;::value_type</TT></td>
<td>
The type of the property.
</td>
</tr>
<tr>
<td>Key Type</td>
<td><TT>boost::property_traits&lt;PA&gt;::key_type</TT></td>
<td>
The type of the key object used to look up the property. The property
accessor may be templated on the key type, in which case this typedef
can be <TT>void</TT>.
</td>
</tr>
<tr>
<td>Property Accessor Category </td>
<td><TT>boost::property_traits&lt;PA&gt;::category</TT></td>
<td>
The category of the property: a type convertible to
<TT>writable_property_accessor_tag</TT>.
</td>
</tr>
</table>
<h3>Valid Expressions</h3>
<table border>
<tr>
<th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th>
</tr>
<tr>
<td>Put Property Value<a href="#1">[1]</a></td>
<TD><TT>put(pa, key, val)</TT></TD>
<TD><TT>void</TT></TD>
<TD>
Assign <TT>val</TT> to the property associated with <TT>k</TT>.
</TD>
</TR>
</TABLE>
<h3>Notes</h3>
<a name="1">[1]</a> The function <tt>put()</tt> was originally named
<tt>set()</tt>, but was changed to avoid name conflicts with the
<tt>std::set</tt> class when using a compiler (Microsoft Visual C++)
with non-standard name lookup rules. The following example demonstrates
the problem.
<pre>
#include &lt;set&gt;
using namespace std;
namespace boost {
void set() { }
}
</pre>
<h3>See Also</h3>
<a href="./property_accessor.html">Property accessor concepts</a>
<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>

View File

@@ -1,125 +0,0 @@
<HTML>
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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. We make no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-->
<Head>
<Title>Identity Property Accessor</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="sec:identity-property-accessor"></A>
<PRE>
identity_property_accessor
</PRE>
</H2>
This property accessor applies the identity function, that is, it just
returns a copy of the key object that was input.
<h3>Model of</h3>
<a href="./ReadablePropertyAccessor.html">ReadablePropertyAccessor</a>
<h3>Associated Types</h3>
<table border>
<tr>
<th>Type</th><th>Description</th>
</tr>
<tr>
<td><tt>
boost::property_traits&lt;identity_property_accessor&gt;::value_type
</tt></td>
<td>
This type is <tt>void</tt>; the accessor functions are templated.
</td>
</tr>
<tr>
<td><tt>
boost::property_traits&lt;identity_property_accessor&gt;::key_type
</tt></td>
<td>
This type is <tt>void</tt>; the accessor functions are templated.
</td>
</tr>
<tr>
<td><tt>
boost::property_traits&lt;identity_property_accessor&gt;::category
</tt></td>
<td>
This type is <tt>boost::readable_op_bracket_tag</tt>.
</td>
</tr>
</table>
<h3>Member Functions</h3>
<table border>
<tr>
<th>Member</th><th>Description</th>
</tr>
<tr>
<td><tt>
template &lt;class T&gt;<br>
T operator[](T x) const
</tt></td>
<td>
Returns a copy of object <tt>x</tt>.
</td>
</tr>
</table>
<h3>Non-Member Functions</h3>
<table border>
<tr>
<th>Member</th><th>Description</th>
</tr>
<tr>
<td><tt>
template &lt;class T&gt;<br>
T get(const identity_property_accessor& pa, T x)
</tt></td>
<td>
Returns a copy of object <tt>x</tt>.
</td>
</tr>
</table>
<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>)<br>
<A HREF=http://www.lsc.nd.edu/~llee1>Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
</TD></TR></TABLE>
</BODY>
</HTML>

View File

@@ -1,210 +0,0 @@
<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>Property Accessor Concepts</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../c++boost.gif"
ALT="C++ Boost">
<BR Clear>
<H1><A NAME="sec:property-accessors"></A>
Property Accessor Concepts
</H1>
The property accessor interface consists of a set of concept that
define a general purpose mechanism for mapping key objects to
corresponding value objects, thereby hiding the details of how the
mapping is implemented from algorithms that use property accessors.
The property accessor requirements are purposefully vague on the type
of the key and value objects to allow for the utmost flexibility.
Since the property accessor operations are global functions, it is
possible to overload the accessor functions such that nearly arbitrary
property accessor types and key types can be used. The interface for
property accessors consists of three functions: <tt>get()</tt>,
<tt>put()</tt>, and <tt>at()</tt>. The following concrete example
shows how the three functions could be used to access the addresses
associated with various people.
<pre>
template &lt;class AddressAccessor&gt;
void foo(AddressAccessor address)
{
typedef typename boost::property_traits&lt;AddressAccessor&gt;::value_type value_type;
typedef typename boost::property_traits&lt;AddressAccessor&gt;::key_type key_type;
value_type old_address, new_address;
key_type fred = &quot;Fred&quot;;
old_address = get(address, fred);
new_address = &quot;384 Fitzpatrick Street&quot;
put(address, fred, new_address);
key_type joe = &quot;Joe&quot;;
value_type& joes_address = at(address, joe);
joes_address = &quot;325 Cushing Avenue&quot;;
}
</pre>
<p>
For each property accessor object there is a set of <i>valid keys</i>
for which the mapping to value objects is defined. Invoking a
property accessor function on an <i>invalid</i> key results in
undefined behaviour. The property accessor concepts do not specify how
this set of valid keys is created or modified. A function that uses a
property accessor must specify the expected set of valid keys in its
preconditions.
<p>
The need for property accessors came out of the design of the Boost
Graph Library, whose algorithms needed an interface for accessing
properties attached to vertices and edges in a graph. In this context
the vertex and edge descriptors are the key type of the property
accessors.
<!-- historical note about Decorators and Data Accessors -->
<P>
Several categories of property accessors provide
different access capabilities:
<DL>
<DT><STRONG>readable</STRONG></DT>
<DD>The associated property data can only be read.
The data is returned by-value. Many property accessors defining the
problem input (such as edge weight) can be defined as readable
property accessors.
<P>
</DD>
<DT><STRONG>writeable</STRONG></DT>
<DD>The associated property can only be written to.
The parent array used to record the paths in a bread-first search tree
is an example of a property accessor that would be defined writeable.
<P>
</DD>
<DT><STRONG>read/write</STRONG></DT>
<DD>The associated property can both be written and read.
The distance property use in Dijkstra's shortest paths algorithm
would need to provide both read and write capabilities.
<P>
</DD>
<DT><STRONG>lvalue</STRONG></DT>
<DD>The associated property is actually represented in
memory and it is possible to get a reference to it.
The property accessors in the lvalue
category also support the requirements for read/write property
accessors.
<P>
</DD>
</DL>
<P>
There is a separate concept defined for each of the four property
accessor categories. These property accessor concepts are listed
below, with links to the documentation for each of them.
<ul>
<li><a href="./ReadablePropertyAccessor.html">ReadablePropertyAccessor</a></li>
<li><a href="./WritablePropertyAccessor.html">WritablePropertyAccessor</a></li>
<li><a href="./ReadWritePropertyAccessor.html">ReadWritePropertyAccessor</a></li>
<li><a href="./LvaluePropertyAccessor.html">LvaluePropertyAccessor</a></li>
</ul>
<P>
There is a tag struct for each of the categories of property
accessors, which is defined in the header
<tt>&lt;boost/property_accessor.hpp&gt;</tt>.
<P>
<PRE>
namespace boost {
struct readable_property_accessor_tag { };
struct writable_property_accessor_tag { };
struct read_write_property_accessor_tag :
public readable_property_accessor_tag,
public writable_property_accessor_tag { };
struct lvalue_property_accessor_tag :
public read_write_property_accessor_tag { };
}
</PRE>
<P>
Similar to the <TT>std::iterator_traits</TT> class of the STL, there
is a <TT>boost::property_traits</TT> class that can be used to deduce
the types associated with a property accessor type: the key and value
types, and the property accessor category. There is a specialization
of <TT>boost::property_traits</TT> so that pointers can be used as
property accessor objects. In addition, the property accessor
functions are overloaded for pointers. These traits classes and
functions are defined in <tt>&lt;boost/property_accessor.hpp&gt;</tt>.
<P>
<PRE>
namespace boost {
template &lt;class PropertyAccessor&gt;
struct property_traits {
typedef typename PropertyAccessor::key_type key_type;
typedef typename PropertyAccessor::value_type value_type;
typedef typename PropertyAccessor::category category;
};
// specialization for using pointers as property accessors
template &lt;class T&gt;
struct property_traits&lt;T*&gt; {
typedef T value_type;
typedef ptrdiff_t key_type;
typedef random_access_iterator_pa_tag category;
};
// overloads of the property accessor functions for pointers
template <class T>
void put(T* pa, std::ptrdiff_t k, const T& val) { pa[k] = val; }
template <class T>
const T& get(const T* pa, std::ptrdiff_t k) { return pa[k]; }
template <class T>
T& at(T* pa, std::ptrdiff_t k) { return pa[k]; }
template <class T>
const T& at(const T* pa, std::ptrdiff_t k) { return pa[k]; }
}
</PRE>
<h3>Notes to Implementors</h3>
Copying a property accessor should be inexpensive since they are often
passed by value.
<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>

View File

@@ -1,213 +0,0 @@
<HTML>
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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. We make no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-->
<Head>
<Title>Random Access Iterator Property Accessor Adaptor</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="sec:random-access-iterator-property-accessor"></A>
<PRE>
random_access_iterator_property_accessor&lt;Iterator,T,R,OffsetPA&gt;
</PRE>
</H2>
<P>
This property accessor is an adaptor that converts any random access
iterator into a <a
href="./LvaluePropertyAccessor.html">LvaluePropertyAccessor</a>.
The <tt>OffsetPA</tt> type is responsible for converting
key objects to integers that can be used as offsets with the
random access iterator.
<P>
<h3>Example</h3>
<pre>
// print out the capacity and flow for all the edges in the graph
template &lt;class Graph, class CapacityPA, class FlowPA&gt;
void print_network(Graph& G, CapacityPA capacity, FlowPA flow)
{
typedef typename boost::graph_traits&lt;Graph&gt;::vertex_iterator Viter;
typedef typename boost::graph_traits&lt;Graph&gt;::out_edge_iterator OutEdgeIter;
typedef typename boost::graph_traits&lt;Graph&gt;::in_edge_iterator InEdgeIter;
Viter ui, uiend;
for (boost::tie(ui, uiend) = vertices(G); ui != uiend; ++ui) {
OutEdgeIter out, out_end;
std::cout &lt;&lt; *ui &lt;&lt; "\t";
for(boost::tie(out, out_end) = out_edges(*ui, G); out != out_end; ++out)
std::cout &lt;&lt; "--(" &lt;&lt; get(capacity, *out) &lt;&lt; ", "
&lt;&lt; get(flow, *out) &lt;&lt; ")--> " &lt;&lt; target(*out,G) &lt;&lt; "\t";
std::cout &lt;&lt; std::endl &lt;&lt; "\t";
InEdgeIter in, in_end;
for(boost::tie(in, in_end) = in_edges(*ui, G); in != in_end; ++in)
std::cout &lt;&lt; "<--(" &lt;&lt; get(capacity, *in) &lt;&lt; "," &lt;&lt; get(flow, *in) &lt;&lt; ")-- "
&lt;&lt; source(*in,G) &lt;&lt; "\t";
std::cout &lt;&lt; std::endl;
}
}
int main(int, char*[])
{
typedef boost::adjacency_list&lt;boost::vecS, boost::vecS,
boost::bidirectionalS, boost::no_plugin,
boost::plugin&lt;boost::id_tag, std::size_t&gt; &gt; Graph;
const int num_vertices = 9;
Graph G(num_vertices);
int capacity[] = { 10, 20, 20, 20, 40, 40, 20, 20, 20, 10 };
int flow[] = { 8, 12, 12, 12, 12, 12, 16, 16, 16, 8 };
// add edges to the graph, and assign each edge an ID number
// to index into the property arrays
add_edge(G, 0, 1, 0);
// ...
typedef boost::graph_traits&lt;Graph&gt;::edge_descriptor Edge;
typedef boost::edge_property_accessor&lt;Graph, boost::id_tag&gt;::type EdgeID_PA;
EdgeID_PA edge_id = get_edge_property_accessor(G, boost::id_tag());
boost::random_access_iterator_property_accessor&lt;int*, int, int&, EdgeID_PA&gt;
capacity_pa(capacity, edge_id),
flow_pa(flow, edge_id);
print_network(G, capacity_pa, flow_pa);
return 0;
}
</pre>
<H3>Where Defined</H3>
<P>
<a href="../../boost/property_accessor.hpp"><TT>boost/property_accessor.hpp</TT></a>
<p>
<H3>Model Of</H3>
<a href="./LvaluePropertyAccessor.html">LvaluePropertyAccessor</a>
<P>
<H3>Template Parameters</H3>
<P>
<TABLE border>
<TR>
<th>Parameter</th><th>Description</th><th>Default</th>
</tr>
<TR>
<TD><TT>Iterator</TT></TD>
<TD>Must be a model of <a href="http://www.sgi.com/Technology/STL/RandomAccessIterator.html">RandomAccessIterator</a>.</TD>
<TD>&nbsp;</td>
</tr>
<TR>
<TD><TT>T</TT></TD>
<TD>The value type of the iterator.</TD>
<TD><TT>std::iterator_traits&lt;RandomAccessIterator&gt;::value_type</TT></TD>
</TR>
<TR>
<TD><TT>R</TT></TD>
<TD>The reference type of the iterator.</TD>
<TD><TT>std::iterator_traits&lt;RandomAccessIterator&gt;::reference</TT></TD>
</TR>
<TR>
<TD><TT>OffsetPA</TT></TD> <TD>Must be a model of <a
href="./ReadablePropertyAccessor.html">ReadablePropertyAccessor</a>
and the value type must be convertible to the difference type of the
iterator.</TD> <TD><TT>boost::identity_property_accessor</TT></TD>
</TR>
</TABLE>
<P>
<H3>Members</H3>
<P>
In addition the methods and functions required by <a
href="./LvaluePropertyAccessor.html">LvaluePropertyAccessor</a>, this
class has the following members.
<P>
<table border>
<tr>
<th>Member</th><th>Description</th>
</tr>
<tr>
<td><tt>
value_type
</tt></td>
<td>This will be the same type as
<TT>std::iterator_traits&lt;Iterator&gt;::value_type</TT>.
</td>
</tr>
<tr>
<td><tt>
random_access_iterator_property_accessor(Iterator i)
</tt></td>
<td>
Constructor.
</td>
</tr>
<tr>
<td><tt>
reference operator[](difference_type v) const
</tt></td>
<td>
The operator bracket for property access. The <TT>reference</TT> and
<TT>difference_type</TT> types are from
<TT>std::iterator_traits&lt;Iterator&gt;</TT>.
</td>
</tr>
</table>
<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>)<br>
<A HREF=http://www.lsc.nd.edu/~llee1>Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
</TD></TR></TABLE>
</BODY>
</HTML>