隣接イテレータ・アダプタは out_edge_iterator を隣接イテレータに 変形する。すなわち、辺の方々を巡回するイテレータを取り、それらの 終点の方々を巡回するイテレータを作成する。このアダプタと共に Incidence Graph をモデルとするグラフ型を 取り、Adjacency Graph によって要求される能力を付け加えるのは些細な事である。
namespace boost { template <class Graph, class VertexDescriptor, class OutEdgeIter> class adjacency_iterator_generator { public: typedef iterator_adaptor<...> type; }; }
下記は adjacency_iterator_generator クラスの使い方の例である。
#include <boost/graph/adjacency_iterator.hpp> class my_graph { // ... typedef ... out_edge_iterator; typedef ... vertex_descriptor; typedef boost::adjacency_iterator_generator<my_graph, vertex_descriptor, out_edge_iterator>::type adjacency_iterator; // ... };
パラメータ | 説明 |
---|---|
Graph | グラフ型で、それは Incidence Graph をモデルとしなければならない。 |
VertexDescriptor | これは graph_traits<Graph>::vertex_descriptor と同じ型で
なければならない。これがテンプレート・パラメータである理由は、
adjacency_iterator_generator の主な使用はグラフ・クラスの定義の
内側であり、その文脈中でまだ完全に定義されていないグラフ・
クラスの上で graph_traits を使えないからである。
デフォルト: graph_traits<Graph>::vertex_descriptor |
OutEdgeIter | これは
graph_traits<Graph>::out_edge_iterator と同じ型でなければ
ならない。 デフォルト: graph_traits<Graph>::out_edge_iterator |
adjacency_iterator_generator::type(const OutEdgeIter& it)
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.
[訳注: 原文がcharset=windows-1252であり、©がゥと化けている。]Japanese Translation Copyright © 2003 Takashi Itou
オリジナルの、及びこの著作権表示が全ての複製の中に現れる限り、この文書の複製、利用、変更、販売そして配布を認める。このドキュメントは「あるがまま」に提供されており、いかなる明示的、暗黙的保証も行わない。また、いかなる目的に対しても、その利用が適していることを関知しない。
このドキュメントの対象: Boost Version 1.29.0
最新版ドキュメント (英語)