From 8400e599ca61e4c60f0aefba9fa04e005d30c373 Mon Sep 17 00:00:00 2001 From: Jeremiah Willcock Date: Tue, 3 Apr 2012 05:50:09 +0000 Subject: [PATCH] Starting on converting to Boost.Parameter; not finished yet because of interaction with PBGL [SVN r77737] --- include/boost/graph/breadth_first_search.hpp | 47 +++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/include/boost/graph/breadth_first_search.hpp b/include/boost/graph/breadth_first_search.hpp index 3af85f3f..80683204 100644 --- a/include/boost/graph/breadth_first_search.hpp +++ b/include/boost/graph/breadth_first_search.hpp @@ -322,7 +322,7 @@ namespace boost { } // namespace detail - +#if 1 // Named Parameter Variant template void breadth_first_search @@ -339,6 +339,7 @@ namespace boost { detail::bfs_dispatch::apply(ng, s, params, get_param(params, vertex_color)); } +#endif // This version does not initialize colors, user has to. @@ -370,6 +371,50 @@ namespace boost { ); } + namespace graph { + namespace detail { + template + struct breadth_first_search_impl { + typedef void result_type; + void operator()(const Graph& g, const Source& source, const ArgPack& arg_pack) { + using namespace boost::graph::keywords; + typename boost::graph_traits::vertex_descriptor sources[1] = {source}; + boost::queue::vertex_descriptor> Q; + boost::breadth_first_search(g, + &sources[0], + &sources[1], + boost::unwrap_ref(arg_pack[_buffer | boost::ref(Q)]), + arg_pack[_visitor | make_bfs_visitor(null_visitor())], + boost::detail::make_color_map_from_arg_pack(g, arg_pack)); + } + }; + } + BOOST_GRAPH_MAKE_FORWARDING_FUNCTION(breadth_first_search, 2, 4) + } + +#if 0 + // Named Parameter Variant + template + void + breadth_first_search(const VertexListGraph& g, + typename graph_traits::vertex_descriptor s, + const bgl_named_params& params) + { + typedef bgl_named_params params_type; + BOOST_GRAPH_DECLARE_CONVERTED_PARAMETERS(params_type, params) + boost::graph::breadth_first_search_with_named_params(g, s, arg_pack); + } + + template + void + breadth_first_search(const VertexListGraph& g, + typename graph_traits::vertex_descriptor s) + { + BOOST_GRAPH_DECLARE_CONVERTED_PARAMETERS(no_named_parameters, no_named_parameters()) + boost::graph::breadth_first_search_with_named_params(g, s, arg_pack); + } +#endif + } // namespace boost #ifdef BOOST_GRAPH_USE_MPI