Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/graph/doc/adjacency_iterator.html @ 12

Last change on this file since 12 was 12, checked in by landauf, 18 years ago

added boost

File size: 3.7 KB
Line 
1<html>
2
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
6<meta name="ProgId" content="FrontPage.Editor.Document">
7<title>Adjacency Iterator Adaptor Documentation</title>
8</head>
9
10<body bgcolor="#FFFFFF" text="#000000">
11
12<img src="../../../boost.png" alt="boost.png (6897 bytes)"
13align="center" width="277" height="86">
14
15<h1>Adjacency Iterator Adaptor</h1>
16
17Defined in header
18<a href="../../../boost/graph/adjacency_iterator.hpp">boost/graph/adjacency_iterator.hpp</a>
19
20<p>
21The adjacency iterator adaptor transforms an
22<tt>out_edge_iterator</tt> into an adjacency iterator. That is, it
23takes an iterator that traverses over edges, and creates an iterator
24that traverses over the <b><i>target</i></b> vertices of those edges.
25With this adaptor it is trivial to take a graph type that models <a
26href="IncidenceGraph.html">Incidence Graph</a> and add the
27capabilities required of <a href="AdjacencyGraph.html">Adjacency
28Graph</a>.
29
30
31<h2>Synopsis</h2>
32
33<pre>
34namespace boost {
35  template &lt;class Graph, class VertexDescriptor, class OutEdgeIter&gt;
36  class adjacency_iterator_generator {
37  public:
38    typedef <a href="../../iterator/doc/iterator_adaptor.html">iterator_adaptor</a>&lt;...&gt; type;
39  };
40}
41</pre>
42
43<hr>
44
45<h3>Example</h3>
46
47<p>
48The following is an example of how to use the
49<tt>adjacency_iterator_generator</tt> class.
50
51<p>
52<PRE>
53#include &lt;boost/graph/adjacency_iterator.hpp&gt;
54
55class my_graph {
56  // ...
57  typedef ... out_edge_iterator;
58  typedef ... vertex_descriptor;
59  typedef boost::adjacency_iterator_generator&lt;my_graph, vertex_descriptor, out_edge_iterator&gt;::type adjacency_iterator;
60  // ...
61};
62
63</PRE>
64
65<h3>Template Parameters</h3>
66
67<Table border>
68<TR>
69<TH>Parameter</TH><TH>Description</TH>
70</TR>
71
72<TR>
73<TD><tt>Graph</tt></TD>
74<TD>The graph type, which must model <a
75href="./IncidenceGraph.html">Incidence Graph</a>.</TD>
76</TR>
77
78<TR>
79<TD><tt>VertexDescriptor</tt></TD>
80<TD>This must be the same type as
81<tt>graph_traits&lt;Graph&gt;::vertex_descriptor</tt>.  The reason why
82this is a template parameter is that the primary use of
83<tt>adjacency_iterator_generator</tt> is <b><i>inside</i></b> the
84definition of the graph class, and in that context we can not use
85<tt>graph_traits</tt> on the not yet fully defined graph class.<br>
86<b>Default:</b> <tt>graph_traits&lt;Graph&gt;::vertex_descriptor</tt></TD>
87</TR>
88
89<TR>
90<TD><tt>OutEdgeIter</tt></TD>
91<TD>This must be the same type as
92<tt>graph_traits&lt;Graph&gt;::out_edge_iterator</tt>.<br>
93<b>Default:</b> <tt>graph_traits&lt;Graph&gt;::out_edge_iterator
94</TD>
95</TR>
96
97</Table>
98
99<h3>Model of</h3>
100
101The adjacency iterator adaptor (the type
102<tt>adjacency_iterator_generator<...>::type</tt>) is a model of <a
103href="../../utility/MultiPassInputIterator.html">Multi-Pass Input Iterator</a>
104</a>.
105
106
107<h3>Members</h3>
108
109The adjacency iterator type implements the member functions and
110operators required of the <a
111href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">Random Access Iterator</a>
112concept, except that the <tt>reference</tt> type is the same as the <tt>value_type</tt>
113so <tt>operator*()</tt> returns by-value. In addition it has the following constructor:
114
115<pre>
116adjacency_iterator_generator::type(const OutEdgeIter&amp; it, const Graph* g)
117</pre>
118
119<hr>
120<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan -->19 Aug 2001<!--webbot bot="Timestamp" endspan i-checksum="14767" --></p>
121<p>© Copyright Jeremy Siek 2000. Permission to copy, use,
122modify, sell and distribute this document is granted provided this copyright
123notice appears in all copies. This document is provided &quot;as is&quot;
124without express or implied warranty, and with no claim as to its suitability for
125any purpose.</p>
126
127</body>
128
129</html>
Note: See TracBrowser for help on using the repository browser.