]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | <html> |
2 | <!-- | |
3 | Copyright (c) 2000 Jeremy Siek | |
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 | ||
10 | <head> | |
11 | <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> | |
12 | <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> | |
13 | <meta name="ProgId" content="FrontPage.Editor.Document"> | |
14 | <title>Inverse Adjacency Iterator Adaptor Documentation</title> | |
15 | </head> | |
16 | ||
17 | <body bgcolor="#FFFFFF" text="#000000"> | |
18 | ||
19 | <img src="../../../boost.png" alt="boost.png (6897 bytes)" | |
20 | align="center" width="277" height="86"> | |
21 | ||
22 | <h1>Inverse Adjacency Iterator Adaptor</h1> | |
23 | ||
24 | Defined in header | |
25 | <a href="../../../boost/graph/adjacency_iterator.hpp">boost/graph/adjacency_iterator.hpp</a> | |
26 | ||
27 | <p> | |
28 | The inverse adjacency iterator adaptor transforms an | |
29 | <tt>in_edge_iterator</tt> into an inverse adjacency iterator. That is, it | |
30 | takes an iterator that traverses over edges, and creates an iterator | |
31 | that traverses over the <b><i>source</i></b> vertices of those edges. | |
32 | ||
33 | <!-- | |
34 | With this adaptor it is trivial to take a graph type that models <a | |
35 | href="IncidenceGraph.html">Incidence Graph</a> and add the | |
36 | capabilities required of <a href="AdjacencyGraph.html">Adjacency | |
37 | Graph</a>. --> | |
38 | ||
39 | ||
40 | <h2>Synopsis</h2> | |
41 | ||
42 | <pre> | |
43 | namespace boost { | |
44 | template <class Graph, class VertexDescriptor, class InEdgeIter> | |
45 | class inv_adjacency_iterator_generator { | |
46 | public: | |
47 | typedef <a href="../../iterator/doc/iterator_adaptor.html">iterator_adaptor</a><...> type; | |
48 | }; | |
49 | } | |
50 | </pre> | |
51 | ||
52 | <hr> | |
53 | ||
54 | <h3>Example</h3> | |
55 | ||
56 | <p> | |
57 | The following is an example of how to use the | |
58 | <tt>inv_adjacency_iterator_generator</tt> class. | |
59 | ||
60 | <p> | |
61 | <PRE> | |
62 | #include <boost/graph/adjacency_iterator.hpp> | |
63 | ||
64 | class my_graph { | |
65 | // ... | |
66 | typedef ... in_edge_iterator; | |
67 | typedef ... vertex_descriptor; | |
68 | typedef boost::inv_adjacency_iterator_generator<my_graph, vertex_descriptor, in_edge_iterator>::type inv_adjacency_iterator; | |
69 | // ... | |
70 | }; | |
71 | ||
72 | </PRE> | |
73 | ||
74 | <h3>Template Parameters</h3> | |
75 | ||
76 | <Table border> | |
77 | <TR> | |
78 | <TH>Parameter</TH><TH>Description</TH> | |
79 | </TR> | |
80 | ||
81 | <TR> | |
82 | <TD><tt>Graph</tt></TD> | |
83 | <TD>The graph type, which must model <a | |
84 | href="./IncidenceGraph.html">Incidence Graph</a>.</TD> | |
85 | </TR> | |
86 | ||
87 | <TR> | |
88 | <TD><tt>VertexDescriptor</tt></TD> | |
89 | <TD>This must be the same type as | |
90 | <tt>graph_traits<Graph>::vertex_descriptor</tt>. The reason why | |
91 | this is a template parameter is that the primary use of | |
92 | <tt>inv_adjacency_iterator_generator</tt> is <b><i>inside</i></b> the | |
93 | definition of the graph class, and in that context we can not use | |
94 | <tt>graph_traits</tt> on the not yet fully defined graph class.<br> | |
95 | <b>Default:</b> <tt>graph_traits<Graph>::vertex_descriptor</tt></TD> | |
96 | </TR> | |
97 | ||
98 | <TR> | |
99 | <TD><tt>InEdgeIter</tt></TD> | |
100 | <TD>This must be the same type as | |
101 | <tt>graph_traits<Graph>::in_edge_iterator</tt>.<br> | |
102 | <b>Default:</b> <tt>graph_traits<Graph>::in_edge_iterator | |
103 | </TD> | |
104 | </TR> | |
105 | ||
106 | </Table> | |
107 | ||
108 | <h3>Model of</h3> | |
109 | ||
110 | The inverse adjacency iterator adaptor (the type | |
111 | <tt>inv_adjacency_iterator_generator<...>::type</tt>) is a model of <a | |
112 | href="../../utility/MultiPassInputIterator.html">Multi-Pass Input Iterator</a> | |
113 | </a>. | |
114 | ||
115 | ||
116 | <h3>Members</h3> | |
117 | ||
118 | The inverse adjacency iterator type implements the member functions and | |
119 | operators required of the <a | |
120 | href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">Random Access Iterator</a> | |
121 | concept, except that the <tt>reference</tt> type is the same as the <tt>value_type</tt> | |
122 | so <tt>operator*()</tt> returns by-value. In addition it has the following constructor: | |
123 | ||
124 | <pre> | |
125 | inv_adjacency_iterator_generator::type(const InEdgeIter& it, const Graph* g) | |
126 | </pre> | |
127 | ||
128 | <hr> | |
129 | <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> | |
130 |