summaryrefslogtreecommitdiff
path: root/boost/graph/adjacency_list.hpp
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2013-08-26 08:15:55 -0400
committerAnas Nashif <anas.nashif@intel.com>2013-08-26 08:15:55 -0400
commitbb4dd8289b351fae6b55e303f189127a394a1edd (patch)
tree77c9c35a31b1459dd7988c2448e797d142530c41 /boost/graph/adjacency_list.hpp
parent1a78a62555be32868418fe52f8e330c9d0f95d5a (diff)
downloadboost-bb4dd8289b351fae6b55e303f189127a394a1edd.tar.gz
boost-bb4dd8289b351fae6b55e303f189127a394a1edd.tar.bz2
boost-bb4dd8289b351fae6b55e303f189127a394a1edd.zip
Imported Upstream version 1.51.0upstream/1.51.0
Diffstat (limited to 'boost/graph/adjacency_list.hpp')
-rw-r--r--boost/graph/adjacency_list.hpp179
1 files changed, 9 insertions, 170 deletions
diff --git a/boost/graph/adjacency_list.hpp b/boost/graph/adjacency_list.hpp
index 5034fec5a5..21b7500d26 100644
--- a/boost/graph/adjacency_list.hpp
+++ b/boost/graph/adjacency_list.hpp
@@ -51,11 +51,6 @@ namespace boost {
// adjacency_list, and the container_gen traits class which is used
// to map the selectors to the container type used to implement the
// graph.
- //
- // The main container_gen traits class uses partial specialization,
- // so we also include a workaround.
-
-#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#if !defined BOOST_NO_SLIST
struct slistS {};
@@ -130,93 +125,6 @@ namespace boost {
typedef boost::unordered_multiset<ValueType> type;
};
-#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
-#if !defined BOOST_NO_SLIST
- struct slistS {
- template <class T>
- struct bind_ { typedef BOOST_STD_EXTENSION_NAMESPACE::slist<T> type; };
- };
-#endif
-
- struct vecS {
- template <class T>
- struct bind_ { typedef std::vector<T> type; };
- };
-
- struct listS {
- template <class T>
- struct bind_ { typedef std::list<T> type; };
- };
-
- struct setS {
- template <class T>
- struct bind_ { typedef std::set<T, std::less<T> > type; };
- };
-
-
- struct mapS {
- template <class T>
- struct bind_ { typedef std::set<T, std::less<T> > type; };
- };
-
- struct multisetS {
- template <class T>
- struct bind_ { typedef std::multiset<T, std::less<T> > type; };
- };
-
- struct multimapS {
- template <class T>
- struct bind_ { typedef std::multiset<T, std::less<T> > type; };
- };
-
- struct hash_setS {
- template <class T>
- struct bind_ { typedef boost::unordered_set<T> type; };
- };
-
- struct hash_mapS {
- template <class T>
- struct bind_ { typedef boost::unordered_set<T> type; };
- };
-
- struct hash_multisetS {
- template <class T>
- struct bind_ { typedef boost::unordered_multiset<T> type; };
- };
-
- struct hash_multimapS {
- template <class T>
- struct bind_ { typedef boost::unordered_multiset<T> type; };
- };
-
- template <class Selector> struct container_selector {
- typedef vecS type;
- };
-
-#define BOOST_CONTAINER_SELECTOR(NAME) \
- template <> struct container_selector<NAME> { \
- typedef NAME type; \
- }
-
- BOOST_CONTAINER_SELECTOR(vecS);
- BOOST_CONTAINER_SELECTOR(listS);
- BOOST_CONTAINER_SELECTOR(mapS);
- BOOST_CONTAINER_SELECTOR(setS);
- BOOST_CONTAINER_SELECTOR(multisetS);
- BOOST_CONTAINER_SELECTOR(hash_mapS);
-#if !defined BOOST_NO_SLIST
- BOOST_CONTAINER_SELECTOR(slistS);
-#endif
-
- template <class Selector, class ValueType>
- struct container_gen {
- typedef typename container_selector<Selector>::type Select;
- typedef typename Select:: template bind_<ValueType>::type type;
- };
-
-#endif // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
template <class StorageSelector>
struct parallel_edge_traits { };
@@ -354,13 +262,7 @@ namespace boost {
adjacency_list<OutEdgeListS,VertexListS,DirectedS,
VertexProperty,EdgeProperty,GraphProperty,EdgeListS>,
VertexListS, OutEdgeListS, DirectedS,
-#if !defined(BOOST_GRAPH_NO_BUNDLED_PROPERTIES)
- typename detail::retag_property_list<vertex_bundle_t,
- VertexProperty>::type,
- typename detail::retag_property_list<edge_bundle_t, EdgeProperty>::type,
-#else
VertexProperty, EdgeProperty,
-#endif
GraphProperty, EdgeListS>::type,
// Support for named vertices
public graph::maybe_named_graph<
@@ -371,25 +273,14 @@ namespace boost {
VertexProperty>
{
public:
-#if !defined(BOOST_GRAPH_NO_BUNDLED_PROPERTIES)
- typedef typename graph_detail::graph_prop<GraphProperty>::property graph_property_type;
- typedef typename graph_detail::graph_prop<GraphProperty>::bundle graph_bundled;
-
- typedef typename graph_detail::vertex_prop<VertexProperty>::property vertex_property_type;
- typedef typename graph_detail::vertex_prop<VertexProperty>::bundle vertex_bundled;
-
- typedef typename graph_detail::edge_prop<EdgeProperty>::property edge_property_type;
- typedef typename graph_detail::edge_prop<EdgeProperty>::bundle edge_bundled;
-#else
typedef GraphProperty graph_property_type;
- typedef no_graph_bundle graph_bundled;
+ typedef typename lookup_one_property<GraphProperty, graph_bundle_t>::type graph_bundled;
typedef VertexProperty vertex_property_type;
- typedef no_vertex_bundle vertex_bundled;
+ typedef typename lookup_one_property<VertexProperty, vertex_bundle_t>::type vertex_bundled;
typedef EdgeProperty edge_property_type;
- typedef no_edge_bundle edge_bundled;
-#endif
+ typedef typename lookup_one_property<EdgeProperty, edge_bundle_t>::type edge_bundled;
private:
typedef adjacency_list self;
@@ -502,20 +393,20 @@ namespace boost {
#define ADJLIST adjacency_list<OEL,VL,D,VP,EP,GP,EL>
template<ADJLIST_PARAMS, typename Tag, typename Value>
- inline void set_property(ADJLIST& g, Tag, Value const& value) {
- get_property_value(*g.m_property, Tag()) = value;
+ inline void set_property(ADJLIST& g, Tag tag, Value const& value) {
+ get_property_value(*g.m_property, tag) = value;
}
template<ADJLIST_PARAMS, typename Tag>
inline typename graph_property<ADJLIST, Tag>::type&
- get_property(ADJLIST& g, Tag) {
- return get_property_value(*g.m_property, Tag());
+ get_property(ADJLIST& g, Tag tag) {
+ return get_property_value(*g.m_property, tag);
}
template<ADJLIST_PARAMS, typename Tag>
inline typename graph_property<ADJLIST, Tag>::type const&
- get_property(ADJLIST const& g, Tag) {
- return get_property_value(*g.m_property, Tag());
+ get_property(ADJLIST const& g, Tag tag) {
+ return get_property_value(*g.m_property, tag);
}
// dwa 09/25/00 - needed to be more explicit so reverse_graph would work.
@@ -545,58 +436,6 @@ namespace boost {
return e.m_target;
}
- // Support for bundled properties
-#ifndef BOOST_GRAPH_NO_BUNDLED_PROPERTIES
- template<typename OutEdgeListS, typename VertexListS, typename DirectedS, typename VertexProperty,
- typename EdgeProperty, typename GraphProperty, typename EdgeListS, typename T, typename Bundle>
- inline
- typename property_map<adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty, EdgeProperty,
- GraphProperty, EdgeListS>, T Bundle::*>::type
- get(T Bundle::* p, adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty, EdgeProperty,
- GraphProperty, EdgeListS>& g)
- {
- typedef typename property_map<adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty,
- EdgeProperty, GraphProperty, EdgeListS>, T Bundle::*>::type
- result_type;
- return result_type(&g, p);
- }
-
- template<typename OutEdgeListS, typename VertexListS, typename DirectedS, typename VertexProperty,
- typename EdgeProperty, typename GraphProperty, typename EdgeListS, typename T, typename Bundle>
- inline
- typename property_map<adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty, EdgeProperty,
- GraphProperty, EdgeListS>, T Bundle::*>::const_type
- get(T Bundle::* p, adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty, EdgeProperty,
- GraphProperty, EdgeListS> const & g)
- {
- typedef typename property_map<adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty,
- EdgeProperty, GraphProperty, EdgeListS>, T Bundle::*>::const_type
- result_type;
- return result_type(&g, p);
- }
-
- template<typename OutEdgeListS, typename VertexListS, typename DirectedS, typename VertexProperty,
- typename EdgeProperty, typename GraphProperty, typename EdgeListS, typename T, typename Bundle,
- typename Key>
- inline T
- get(T Bundle::* p, adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty, EdgeProperty,
- GraphProperty, EdgeListS> const & g, const Key& key)
- {
- return get(get(p, g), key);
- }
-
- template<typename OutEdgeListS, typename VertexListS, typename DirectedS, typename VertexProperty,
- typename EdgeProperty, typename GraphProperty, typename EdgeListS, typename T, typename Bundle,
- typename Key>
- inline void
- put(T Bundle::* p, adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty, EdgeProperty,
- GraphProperty, EdgeListS>& g, const Key& key, const T& value)
- {
- put(get(p, g), key, value);
- }
-
-#endif
-
// Mutability Traits
template <ADJLIST_PARAMS>
struct graph_mutability_traits<ADJLIST> {