The inverse adjacency iterator adaptor transforms an in_edge_iterator into an inverse adjacency iterator. That is, it takes an iterator that traverses over edges, and creates an iterator that traverses over the source vertices of those edges.
namespace boost { template <class Graph, class VertexDescriptor, class InEdgeIter> class inv_adjacency_iterator_generator { public: typedef iterator_adaptor<...> type; }; }
The following is an example of how to use the inv_adjacency_iterator_generator class.
#include <boost/graph/adjacency_iterator.hpp> class my_graph { // ... typedef ... in_edge_iterator; typedef ... vertex_descriptor; typedef boost::inv_adjacency_iterator_generator<my_graph, vertex_descriptor, in_edge_iterator>::type inv_adjacency_iterator; // ... };
Parameter | Description |
---|---|
Graph | The graph type, which must model Incidence Graph. |
VertexDescriptor | This must be the same type as
graph_traits<Graph>::vertex_descriptor. The reason why
this is a template parameter is that the primary use of
inv_adjacency_iterator_generator is inside the
definition of the graph class, and in that context we can not use
graph_traits on the not yet fully defined graph class. Default: graph_traits<Graph>::vertex_descriptor |
InEdgeIter | This must be the same type as
graph_traits<Graph>::in_edge_iterator. Default: graph_traits<Graph>::in_edge_iterator |
inv_adjacency_iterator_generator::type(const InEdgeIter& it, const Graph* g)
Revised 19 Aug 2001
© Copyright Jeremy Siek 2000. Permission to copy, use, modify, sell and distribute this document is granted provided this copyright notice appears in all copies. This document is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.