diff options
Diffstat (limited to 'boost/graph/compressed_sparse_row_graph.hpp')
-rw-r--r-- | boost/graph/compressed_sparse_row_graph.hpp | 375 |
1 files changed, 190 insertions, 185 deletions
diff --git a/boost/graph/compressed_sparse_row_graph.hpp b/boost/graph/compressed_sparse_row_graph.hpp index caa27a9060..59e8bb4aba 100644 --- a/boost/graph/compressed_sparse_row_graph.hpp +++ b/boost/graph/compressed_sparse_row_graph.hpp @@ -41,12 +41,9 @@ #include <boost/graph/properties.hpp> #include <boost/static_assert.hpp> #include <boost/functional/hash.hpp> -#include <boost/utility.hpp> - -#ifdef BOOST_GRAPH_NO_BUNDLED_PROPERTIES -# error The Compressed Sparse Row graph only supports bundled properties. -# error You will need a compiler that conforms better to the C++ standard. -#endif +#include <boost/next_prior.hpp> +#include <boost/property_map/transform_value_property_map.hpp> +#include <boost/mpl/print.hpp> namespace boost { @@ -195,8 +192,8 @@ class compressed_sparse_row_graph<directedS, VertexProperty, EdgeProperty, Graph public: // For Property Graph - typedef typename graph_detail::graph_prop<GraphProperty>::property graph_property_type; - typedef typename graph_detail::graph_prop<GraphProperty>::bundle graph_bundled; + typedef GraphProperty graph_property_type; + typedef typename lookup_one_property<GraphProperty, graph_bundle_t>::type graph_bundled; typedef detail::compressed_sparse_row_structure<EdgeProperty, Vertex, EdgeIndex> forward_type; @@ -746,8 +743,8 @@ class compressed_sparse_row_graph<bidirectionalS, VertexProperty, EdgeProperty, public: // For Property Graph - typedef typename graph_detail::graph_prop<GraphProperty>::property graph_property_type; - typedef typename graph_detail::graph_prop<GraphProperty>::bundle graph_bundled; + typedef GraphProperty graph_property_type; + typedef typename lookup_one_property<GraphProperty, graph_bundle_t>::type graph_bundled; // typedef GraphProperty graph_property_type; typedef detail::compressed_sparse_row_structure<EdgeProperty, Vertex, EdgeIndex> forward_type; @@ -933,6 +930,7 @@ class compressed_sparse_row_graph<bidirectionalS, VertexProperty, EdgeProperty, { m_forward.assign(g, vi, numverts, numedges); inherited_vertex_properties::resize(numverts); + set_up_backward_property_links(); } // Requires the above, plus VertexListGraph and EdgeListGraph @@ -946,6 +944,7 @@ class compressed_sparse_row_graph<bidirectionalS, VertexProperty, EdgeProperty, vertices_size_type numverts = num_vertices(g); m_forward.assign(g, vi, numverts, numedges); inherited_vertex_properties::resize(numverts); + set_up_backward_property_links(); } // Requires the above, plus a vertex_index map. @@ -959,125 +958,7 @@ class compressed_sparse_row_graph<bidirectionalS, VertexProperty, EdgeProperty, vertices_size_type numverts = num_vertices(g); m_forward.assign(g, get(vertex_index, g), numverts, numedges); inherited_vertex_properties::resize(numverts); - } - - // Add edges from a sorted (smallest sources first) range of pairs and edge - // properties - template <typename BidirectionalIteratorOrig, typename EPIterOrig, - typename GlobalToLocal> - void - add_edges_sorted_internal( - BidirectionalIteratorOrig first_sorted, - BidirectionalIteratorOrig last_sorted, - EPIterOrig ep_iter_sorted, - const GlobalToLocal& global_to_local) { - m_forward.add_edges_sorted_internal(first_sorted, last_sorted, ep_iter_sorted, global_to_local); - } - - template <typename BidirectionalIteratorOrig, typename EPIterOrig> - void - add_edges_sorted_internal( - BidirectionalIteratorOrig first_sorted, - BidirectionalIteratorOrig last_sorted, - EPIterOrig ep_iter_sorted) { - m_forward.add_edges_sorted_internal(first_sorted, last_sorted, ep_iter_sorted, typed_identity_property_map<Vertex>()); - } - - // Add edges from a sorted (smallest sources first) range of pairs - template <typename BidirectionalIteratorOrig> - void - add_edges_sorted_internal( - BidirectionalIteratorOrig first_sorted, - BidirectionalIteratorOrig last_sorted) { - m_forward.add_edges_sorted_internal(first_sorted, last_sorted, detail::default_construct_iterator<edge_bundled>()); - } - - template <typename BidirectionalIteratorOrig, typename GlobalToLocal> - void - add_edges_sorted_internal_global( - BidirectionalIteratorOrig first_sorted, - BidirectionalIteratorOrig last_sorted, - const GlobalToLocal& global_to_local) { - m_forward.add_edges_sorted_internal(first_sorted, last_sorted, detail::default_construct_iterator<edge_bundled>(), global_to_local); - } - - template <typename BidirectionalIteratorOrig, typename EPIterOrig, - typename GlobalToLocal> - void - add_edges_sorted_internal_global( - BidirectionalIteratorOrig first_sorted, - BidirectionalIteratorOrig last_sorted, - EPIterOrig ep_iter_sorted, - const GlobalToLocal& global_to_local) { - m_forward.add_edges_sorted_internal(first_sorted, last_sorted, ep_iter_sorted, global_to_local); - } - - // Add edges from a range of (source, target) pairs that are unsorted - template <typename InputIterator, typename GlobalToLocal> - inline void - add_edges_internal(InputIterator first, InputIterator last, - const GlobalToLocal& global_to_local) { - typedef compressed_sparse_row_graph Graph; - typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex_t; - typedef typename boost::graph_traits<Graph>::vertices_size_type vertex_num; - typedef typename boost::graph_traits<Graph>::edges_size_type edge_num; - typedef std::vector<std::pair<vertex_t, vertex_t> > edge_vector_t; - edge_vector_t new_edges(first, last); - if (new_edges.empty()) return; - std::sort(new_edges.begin(), new_edges.end()); - this->add_edges_sorted_internal_global(new_edges.begin(), new_edges.end(), global_to_local); - } - - template <typename InputIterator> - inline void - add_edges_internal(InputIterator first, InputIterator last) { - this->add_edges_internal(first, last, typed_identity_property_map<Vertex>()); - } - - // Add edges from a range of (source, target) pairs and edge properties that - // are unsorted - template <typename InputIterator, typename EPIterator, typename GlobalToLocal> - inline void - add_edges_internal(InputIterator first, InputIterator last, - EPIterator ep_iter, EPIterator ep_iter_end, - const GlobalToLocal& global_to_local) { - typedef compressed_sparse_row_graph Graph; - typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex_t; - typedef typename boost::graph_traits<Graph>::vertices_size_type vertex_num; - typedef typename boost::graph_traits<Graph>::edges_size_type edge_num; - typedef std::pair<vertex_t, vertex_t> vertex_pair; - typedef std::vector< - boost::tuple<vertex_pair, - edge_bundled> > - edge_vector_t; - edge_vector_t new_edges - (boost::make_zip_iterator(boost::make_tuple(first, ep_iter)), - boost::make_zip_iterator(boost::make_tuple(last, ep_iter_end))); - if (new_edges.empty()) return; - std::sort(new_edges.begin(), new_edges.end(), - boost::detail::compare_first< - std::less<vertex_pair> >()); - m_forward.add_edges_sorted_internal - (boost::make_transform_iterator( - new_edges.begin(), - boost::detail::my_tuple_get_class<0, vertex_pair>()), - boost::make_transform_iterator( - new_edges.end(), - boost::detail::my_tuple_get_class<0, vertex_pair>()), - boost::make_transform_iterator( - new_edges.begin(), - boost::detail::my_tuple_get_class - <1, edge_bundled>()), - global_to_local); - } - - // Add edges from a range of (source, target) pairs and edge properties that - // are unsorted - template <typename InputIterator, typename EPIterator> - inline void - add_edges_internal(InputIterator first, InputIterator last, - EPIterator ep_iter, EPIterator ep_iter_end) { - this->add_edges_internal(first, last, ep_iter, ep_iter_end, typed_identity_property_map<Vertex>()); + set_up_backward_property_links(); } using inherited_vertex_properties::operator[]; @@ -1134,7 +1015,6 @@ add_vertices(typename BOOST_DIR_CSR_GRAPH_TYPE::vertices_size_type count, BOOST_ Vertex old_num_verts_plus_one = g.m_forward.m_rowstart.size(); EdgeIndex numedges = g.m_forward.m_rowstart.back(); g.m_forward.m_rowstart.resize(old_num_verts_plus_one + count, numedges); - g.m_backward.m_rowstart.resize(old_num_verts_plus_one + count, numedges); g.vertex_properties().resize(num_vertices(g)); return old_num_verts_plus_one - 1; } @@ -1383,26 +1263,110 @@ edges(const BOOST_CSR_GRAPH_TYPE& g) // Graph properties template<BOOST_CSR_GRAPH_TEMPLATE_PARMS, class Tag, class Value> inline void -set_property(BOOST_CSR_GRAPH_TYPE& g, Tag, const Value& value) +set_property(BOOST_CSR_GRAPH_TYPE& g, Tag tag, const Value& value) { - get_property_value(g.m_property, Tag()) = value; + get_property_value(g.m_property, tag) = value; } template<BOOST_CSR_GRAPH_TEMPLATE_PARMS, class Tag> inline typename graph_property<BOOST_CSR_GRAPH_TYPE, Tag>::type& -get_property(BOOST_CSR_GRAPH_TYPE& g, Tag) +get_property(BOOST_CSR_GRAPH_TYPE& g, Tag tag) { - return get_property_value(g.m_property, Tag()); + return get_property_value(g.m_property, tag); } template<BOOST_CSR_GRAPH_TEMPLATE_PARMS, class Tag> inline const typename graph_property<BOOST_CSR_GRAPH_TYPE, Tag>::type& -get_property(const BOOST_CSR_GRAPH_TYPE& g, Tag) +get_property(const BOOST_CSR_GRAPH_TYPE& g, Tag tag) { - return get_property_value(g.m_property, Tag()); + return get_property_value(g.m_property, tag); +} + +template <typename G, typename Tag, typename Kind> +struct csr_property_map_helper {}; +// Kind == void for invalid property tags, so we can use that to SFINAE out + +template <BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename Tag> +struct csr_property_map_helper<BOOST_CSR_GRAPH_TYPE, Tag, vertex_property_tag> { + typedef vertex_all_t all_tag; + typedef typename property_traits<typename property_map<BOOST_CSR_GRAPH_TYPE, vertex_all_t>::type>::key_type key_type; + typedef VertexProperty plist_type; + typedef typename property_map<BOOST_CSR_GRAPH_TYPE, vertex_all_t>::type all_type; + typedef typename property_map<BOOST_CSR_GRAPH_TYPE, vertex_all_t>::const_type all_const_type; + typedef transform_value_property_map<detail::lookup_one_property_f<plist_type, Tag>, all_type> type; + typedef transform_value_property_map<detail::lookup_one_property_f<const plist_type, Tag>, all_const_type> const_type; +}; + +template <BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename Tag> +struct csr_property_map_helper<BOOST_CSR_GRAPH_TYPE, Tag, edge_property_tag> { + typedef edge_all_t all_tag; + typedef typename property_traits<typename property_map<BOOST_CSR_GRAPH_TYPE, edge_all_t>::type>::key_type key_type; + typedef EdgeProperty plist_type; + typedef typename property_map<BOOST_CSR_GRAPH_TYPE, edge_all_t>::type all_type; + typedef typename property_map<BOOST_CSR_GRAPH_TYPE, edge_all_t>::const_type all_const_type; + typedef transform_value_property_map<detail::lookup_one_property_f<plist_type, Tag>, all_type> type; + typedef transform_value_property_map<detail::lookup_one_property_f<const plist_type, Tag>, all_const_type> const_type; +}; + +template <BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename Tag> +struct csr_property_map_helper<BOOST_CSR_GRAPH_TYPE, Tag, graph_property_tag> { + typedef graph_all_t all_tag; + typedef BOOST_CSR_GRAPH_TYPE* key_type; + typedef GraphProperty plist_type; + typedef typename property_map<BOOST_CSR_GRAPH_TYPE, graph_all_t>::type all_type; + typedef typename property_map<BOOST_CSR_GRAPH_TYPE, graph_all_t>::const_type all_const_type; + typedef transform_value_property_map<detail::lookup_one_property_f<plist_type, Tag>, all_type> type; + typedef transform_value_property_map<detail::lookup_one_property_f<const plist_type, Tag>, all_const_type> const_type; +}; + +template <BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename Tag> +struct property_map<BOOST_CSR_GRAPH_TYPE, Tag>: + csr_property_map_helper< + BOOST_CSR_GRAPH_TYPE, + Tag, + typename detail::property_kind_from_graph<BOOST_CSR_GRAPH_TYPE, Tag> + ::type> {}; + +template <BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename Tag> +typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::type +get(Tag tag, BOOST_CSR_GRAPH_TYPE& g) { + return typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::type(tag, get(typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::all_tag(), g)); +} + +template <BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename Tag> +typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::const_type +get(Tag tag, const BOOST_CSR_GRAPH_TYPE& g) { + return typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::const_type(tag, get(typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::all_tag(), g)); +} + +template <BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename Tag> +typename property_traits<typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::type>::reference +get(Tag tag, BOOST_CSR_GRAPH_TYPE& g, typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::key_type k) { + typedef typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::all_tag all_tag; + typedef typename property_map<BOOST_CSR_GRAPH_TYPE, all_tag>::type outer_pm; + return lookup_one_property<typename property_traits<outer_pm>::value_type, Tag>::lookup(get(all_tag(), g, k), tag); +} + +template <BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename Tag> +typename property_traits<typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::const_type>::reference +get(Tag tag, const BOOST_CSR_GRAPH_TYPE& g, typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::key_type k) { + typedef typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::all_tag all_tag; + typedef typename property_map<BOOST_CSR_GRAPH_TYPE, all_tag>::const_type outer_pm; + return lookup_one_property<const typename property_traits<outer_pm>::value_type, Tag>::lookup(get(all_tag(), g, k), tag); +} + +template <BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename Tag> +void +put(Tag tag, + BOOST_CSR_GRAPH_TYPE& g, + typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::key_type k, + typename lookup_one_property<typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::plist_type, Tag>::type val) { + typedef typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::all_tag all_tag; + typedef typename property_map<BOOST_CSR_GRAPH_TYPE, all_tag>::type outer_pm; + lookup_one_property<typename property_map<BOOST_CSR_GRAPH_TYPE, Tag>::plist_type, Tag>::lookup(get(all_tag(), g, k), tag) = val; } template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> @@ -1420,20 +1384,27 @@ struct property_map<BOOST_CSR_GRAPH_TYPE, edge_index_t> }; template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> -struct property_map<BOOST_CSR_GRAPH_TYPE, vertex_bundle_t> +struct property_map<BOOST_CSR_GRAPH_TYPE, vertex_all_t> { typedef typename BOOST_CSR_GRAPH_TYPE::inherited_vertex_properties::vertex_map_type type; typedef typename BOOST_CSR_GRAPH_TYPE::inherited_vertex_properties::const_vertex_map_type const_type; }; template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> -struct property_map<BOOST_CSR_GRAPH_TYPE, edge_bundle_t> +struct property_map<BOOST_CSR_GRAPH_TYPE, edge_all_t> { typedef typename BOOST_CSR_GRAPH_TYPE::forward_type::inherited_edge_properties::edge_map_type type; typedef typename BOOST_CSR_GRAPH_TYPE::forward_type::inherited_edge_properties::const_edge_map_type const_type; }; template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> +struct property_map<BOOST_CSR_GRAPH_TYPE, graph_all_t> +{ + typedef boost::ref_property_map<BOOST_CSR_GRAPH_TYPE*, typename BOOST_CSR_GRAPH_TYPE::graph_property_type> type; + typedef boost::ref_property_map<BOOST_CSR_GRAPH_TYPE*, const typename BOOST_CSR_GRAPH_TYPE::graph_property_type> const_type; +}; + +template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> inline typed_identity_property_map<Vertex> get(vertex_index_t, const BOOST_CSR_GRAPH_TYPE&) { @@ -1449,6 +1420,21 @@ get(vertex_index_t, } template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> +inline typed_identity_property_map<Vertex> +get(vertex_index_t, BOOST_CSR_GRAPH_TYPE&) +{ + return typed_identity_property_map<Vertex>(); +} + +template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> +inline Vertex +get(vertex_index_t, + BOOST_CSR_GRAPH_TYPE&, Vertex v) +{ + return v; +} + +template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> inline typename property_map<BOOST_CSR_GRAPH_TYPE, edge_index_t>::const_type get(edge_index_t, const BOOST_CSR_GRAPH_TYPE&) { @@ -1466,125 +1452,144 @@ get(edge_index_t, const BOOST_CSR_GRAPH_TYPE&, } template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> -inline typename property_map<BOOST_CSR_GRAPH_TYPE, vertex_bundle_t>::type -get(vertex_bundle_t, BOOST_CSR_GRAPH_TYPE& g) +inline typename property_map<BOOST_CSR_GRAPH_TYPE, edge_index_t>::const_type +get(edge_index_t, BOOST_CSR_GRAPH_TYPE&) +{ + typedef typename property_map<BOOST_CSR_GRAPH_TYPE, edge_index_t>::const_type + result_type; + return result_type(); +} + +template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> +inline EdgeIndex +get(edge_index_t, BOOST_CSR_GRAPH_TYPE&, + typename BOOST_CSR_GRAPH_TYPE::edge_descriptor e) +{ + return e.idx; +} + +template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> +inline typename property_map<BOOST_CSR_GRAPH_TYPE, vertex_all_t>::type +get(vertex_all_t, BOOST_CSR_GRAPH_TYPE& g) { return g.get_vertex_bundle(get(vertex_index, g)); } template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> -inline typename property_map<BOOST_CSR_GRAPH_TYPE, vertex_bundle_t>::const_type -get(vertex_bundle_t, const BOOST_CSR_GRAPH_TYPE& g) +inline typename property_map<BOOST_CSR_GRAPH_TYPE, vertex_all_t>::const_type +get(vertex_all_t, const BOOST_CSR_GRAPH_TYPE& g) { return g.get_vertex_bundle(get(vertex_index, g)); } template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> inline VertexProperty& -get(vertex_bundle_t, +get(vertex_all_t, BOOST_CSR_GRAPH_TYPE& g, Vertex v) { - return get(vertex_bundle, g)[v]; + return get(vertex_all, g)[v]; } template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> inline const VertexProperty& -get(vertex_bundle_t, +get(vertex_all_t, const BOOST_CSR_GRAPH_TYPE& g, Vertex v) { - return get(vertex_bundle, g)[v]; + return get(vertex_all, g)[v]; } template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> inline void -put(vertex_bundle_t, +put(vertex_all_t, BOOST_CSR_GRAPH_TYPE& g, Vertex v, const VertexProperty& val) { - put(get(vertex_bundle, g), v, val); + put(get(vertex_all, g), v, val); } template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> -inline typename property_map<BOOST_CSR_GRAPH_TYPE, edge_bundle_t>::type -get(edge_bundle_t, BOOST_CSR_GRAPH_TYPE& g) +inline typename property_map<BOOST_CSR_GRAPH_TYPE, edge_all_t>::type +get(edge_all_t, BOOST_CSR_GRAPH_TYPE& g) { return g.m_forward.get_edge_bundle(get(edge_index, g)); } template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> -inline typename property_map<BOOST_CSR_GRAPH_TYPE, edge_bundle_t>::const_type -get(edge_bundle_t, const BOOST_CSR_GRAPH_TYPE& g) +inline typename property_map<BOOST_CSR_GRAPH_TYPE, edge_all_t>::const_type +get(edge_all_t, const BOOST_CSR_GRAPH_TYPE& g) { return g.m_forward.get_edge_bundle(get(edge_index, g)); } template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> inline EdgeProperty& -get(edge_bundle_t, +get(edge_all_t, BOOST_CSR_GRAPH_TYPE& g, const typename BOOST_CSR_GRAPH_TYPE::edge_descriptor& e) { - return get(edge_bundle, g)[e]; + return get(edge_all, g)[e]; } template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> inline const EdgeProperty& -get(edge_bundle_t, +get(edge_all_t, const BOOST_CSR_GRAPH_TYPE& g, const typename BOOST_CSR_GRAPH_TYPE::edge_descriptor& e) { - return get(edge_bundle, g)[e]; + return get(edge_all, g)[e]; } template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> inline void -put(edge_bundle_t, +put(edge_all_t, BOOST_CSR_GRAPH_TYPE& g, const typename BOOST_CSR_GRAPH_TYPE::edge_descriptor& e, const EdgeProperty& val) { - put(get(edge_bundle, g), e, val); + put(get(edge_all, g), e, val); } -template<BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename T, typename Bundle> -inline -typename property_map<BOOST_CSR_GRAPH_TYPE, T Bundle::*>::type -get(T Bundle::* p, BOOST_CSR_GRAPH_TYPE& g) +template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> +inline typename property_map<BOOST_CSR_GRAPH_TYPE, graph_all_t>::type +get(graph_all_t, BOOST_CSR_GRAPH_TYPE& g) { - typedef typename property_map<BOOST_CSR_GRAPH_TYPE, - T Bundle::*>::type - result_type; - return result_type(&g, p); + return typename property_map<BOOST_CSR_GRAPH_TYPE, graph_all_t>::type(g.m_property); } -template<BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename T, typename Bundle> -inline -typename property_map<BOOST_CSR_GRAPH_TYPE, T Bundle::*>::const_type -get(T Bundle::* p, BOOST_CSR_GRAPH_TYPE const & g) +template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> +inline typename property_map<BOOST_CSR_GRAPH_TYPE, graph_all_t>::const_type +get(graph_all_t, const BOOST_CSR_GRAPH_TYPE& g) { - typedef typename property_map<BOOST_CSR_GRAPH_TYPE, - T Bundle::*>::const_type - result_type; - return result_type(&g, p); + return typename property_map<BOOST_CSR_GRAPH_TYPE, graph_all_t>::const_type(g.m_property); } -template<BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename T, typename Bundle, - typename Key> -inline T -get(T Bundle::* p, BOOST_CSR_GRAPH_TYPE const & g, - const Key& key) +template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> +inline GraphProperty& +get(graph_all_t, + BOOST_CSR_GRAPH_TYPE& g, + BOOST_CSR_GRAPH_TYPE*) { - return get(get(p, g), key); + return g.m_property; } -template<BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename T, typename Bundle, - typename Key> +template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> +inline const GraphProperty& +get(graph_all_t, + const BOOST_CSR_GRAPH_TYPE& g, + BOOST_CSR_GRAPH_TYPE*) +{ + return g.m_property; +} + +template<BOOST_CSR_GRAPH_TEMPLATE_PARMS> inline void -put(T Bundle::* p, BOOST_CSR_GRAPH_TYPE& g, - const Key& key, const T& value) +put(graph_all_t, + BOOST_CSR_GRAPH_TYPE& g, + BOOST_CSR_GRAPH_TYPE*, + const GraphProperty& val) { - put(get(p, g), key, value); + g.m_property = val; } #undef BOOST_CSR_GRAPH_TYPE |