File indexing completed on 2025-01-18 09:37:21
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_GRAPH_CONTAINER_PROPERTY_MAP_HPP
0008 #define BOOST_GRAPH_CONTAINER_PROPERTY_MAP_HPP
0009
0010 #include <boost/graph/detail/index.hpp>
0011 #include <boost/property_map/property_map.hpp>
0012
0013 namespace boost
0014 {
0015
0016
0017
0018
0019 template < typename Graph, typename Key, typename Container >
0020 struct container_property_map
0021 : public boost::put_get_helper<
0022 typename iterator_property_map< typename Container::iterator,
0023 typename property_map< Graph,
0024 typename detail::choose_indexer< Graph,
0025 Key >::index_type >::type >::reference,
0026 container_property_map< Graph, Key, Container > >
0027 {
0028 typedef typename detail::choose_indexer< Graph, Key >::indexer_type
0029 indexer_type;
0030 typedef typename indexer_type::index_type index_type;
0031 typedef iterator_property_map< typename Container::iterator,
0032 typename property_map< Graph, index_type >::type >
0033 map_type;
0034 typedef typename map_type::key_type key_type;
0035 typedef typename map_type::value_type value_type;
0036 typedef typename map_type::reference reference;
0037 typedef typename map_type::category category;
0038
0039
0040
0041
0042 inline container_property_map() : m_map() {}
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052 inline container_property_map(Container& c, const Graph& g)
0053 : m_map(c.begin(), indexer_type::index_map(const_cast< Graph& >(g)))
0054 {
0055 }
0056
0057
0058 inline container_property_map(const container_property_map& x)
0059 : m_map(x.m_map)
0060 {
0061 }
0062
0063
0064 inline reference operator[](const key_type& k) const { return m_map[k]; }
0065
0066 map_type m_map;
0067 };
0068 }
0069
0070 #endif