C++ Boost

bfs_visitor<EventVisitorList>

このクラスは、 EventVisitor のリスト (std::pair を使って作られる) を BFSVisitor に変換するアダプタである。

Example

以下は examples/bfs.cpp からの抜粋である。ここでは 3 つのイベントビジタを結合して BFS ビジタを作っている。関数 boost::record_distancesboost::record_predecessorscopy_graph は全て、イベントビジタを作る関数だ。
  // Construct graph G and obtain the source vertex s ...

  boost::breadth_first_search(G, s, 
   boost::make_bfs_visitor(
    std::make_pair(boost::record_distances(d, boost::on_tree_edge()),
    std::make_pair(boost::record_predecessors(p.begin(), 
                                              boost::on_tree_edge()),
                   copy_graph(G_copy, boost::on_examine_edge())))) );

Model of

BFSVisitor

Template Parameters

パラメータ説明デフォルト
EventVisitorList std::pair で作られた EventVisitor のリスト。 null_visitor

Where Defined

boost/graph/breadth_first_search.hpp

Member Functions

このクラスは BFSVisitor に要求される全てのメンバ関数を実装している。それぞれの関数で、適切なイベントが EventVisitorList の中の EventVisitor にディスパッチされる。

Non-Member Functions

関数説明
template <class EventVisitorList>
bfs_visitor<EventVisitorList>
make_bfs_visitor(EventVisitorList ev_list);
イベントビジタのリストを BFS ビジタに適合させたものを返す。

See Also

Visitor concepts

イベントビジタ: predecessor_recorderdistance_recordertime_stamperproperty_writer


Copyright © 2000-2001 Jeremy Siek, Indiana University (jsiek@osl.iu.edu)
Lie-Quan Lee, Indiana University (llee@cs.indiana.edu)
Andrew Lumsdaine, Indiana University (lums@osl.iu.edu)

Japanese Translation Copyright © 2003 Hiroshi Ichikawa
オリジナルの、及びこの著作権表示が全ての複製の中に現れる限り、この文書の複製、利用、変更、販売そして配布を認める。このドキュメントは「あるがまま」に提供されており、いかなる明示的、暗黙的保証も行わない。また、いかなる目的に対しても、その利用が適していることを関知しない。

このドキュメントの対象: Boost Version 1.29.0
最新版ドキュメント (英語)