inv_adjacency_iterator.html 4.1 KB

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