mirror of
https://github.com/boostorg/graph.git
synced 2026-01-28 07:12:14 +00:00
*** empty log message ***
[SVN r11539]
This commit is contained in:
@@ -84,7 +84,6 @@ namespace boost {
|
||||
return label_writer<Name>(n);
|
||||
}
|
||||
|
||||
|
||||
enum edge_attribute_t { edge_attribute = 1111 };
|
||||
enum vertex_attribute_t { vertex_attribute = 2222 };
|
||||
enum graph_graph_attribute_t { graph_graph_attribute = 3333 };
|
||||
|
||||
@@ -20,40 +20,23 @@
|
||||
|
||||
#include <boost/property_map_iterator.hpp>
|
||||
#include <boost/graph/properties.hpp>
|
||||
#include <boost/pending/ct_if.hpp>
|
||||
#include <boost/type_traits/same_traits.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
//======================================================================
|
||||
// graph property iterator range
|
||||
|
||||
namespace detail {
|
||||
|
||||
template <class PropertyKind>
|
||||
struct choose_graph_iterator { };
|
||||
|
||||
template <>
|
||||
struct choose_graph_iterator<vertex_property_tag> {
|
||||
template <class Graph> struct bind {
|
||||
typedef typename graph_traits<Graph>::vertex_iterator type;
|
||||
};
|
||||
};
|
||||
template <>
|
||||
struct choose_graph_iterator<edge_property_tag> {
|
||||
template <class Graph> struct bind {
|
||||
typedef typename graph_traits<Graph>::edge_iterator type;
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <class Graph, class PropertyTag>
|
||||
class graph_property_iter_range {
|
||||
typedef typename property_map<Graph, PropertyTag>::type map_type;
|
||||
typedef typename property_map<Graph, PropertyTag>::const_type
|
||||
const_map_type;
|
||||
typedef typename property_kind<PropertyTag>::type Kind;
|
||||
typedef typename detail::choose_graph_iterator<Kind>
|
||||
::template bind<Graph>::type iter;
|
||||
typedef typename ct_if<is_same<Kind, vertex_property_tag>::value,
|
||||
typename graph_traits<Graph>::vertex_iterator,
|
||||
typename graph_traits<Graph>::edge_iterator>::type iter;
|
||||
public:
|
||||
typedef typename property_map_iterator_generator<map_type, iter>::type
|
||||
iterator;
|
||||
|
||||
@@ -29,11 +29,11 @@ namespace boost {
|
||||
template <int TagMatched>
|
||||
struct property_value_dispatch {
|
||||
template <class Property, class T, class Tag>
|
||||
static T& get_value(Property& p, T*, Tag) {
|
||||
inline static T& get_value(Property& p, T*, Tag) {
|
||||
return p.m_value;
|
||||
}
|
||||
template <class Property, class T, class Tag>
|
||||
static const T& const_get_value(const Property& p, T*, Tag) {
|
||||
inline static const T& const_get_value(const Property& p, T*, Tag) {
|
||||
return p.m_value;
|
||||
}
|
||||
};
|
||||
@@ -43,7 +43,7 @@ namespace boost {
|
||||
template <class T> struct result { typedef T type; };
|
||||
|
||||
template <class T, class Tag>
|
||||
static T& get_value(Property& p, T* t, Tag tag) {
|
||||
inline static T& get_value(Property& p, T* t, Tag tag) {
|
||||
typedef typename Property::next_type Next;
|
||||
typedef typename Next::tag_type Next_tag;
|
||||
enum { match = same_property<Next_tag,Tag>::value };
|
||||
@@ -51,7 +51,7 @@ namespace boost {
|
||||
::get_value(static_cast<Next&>(p), t, tag);
|
||||
}
|
||||
template <class T, class Tag>
|
||||
static const T& const_get_value(const Property& p, T* t, Tag tag) {
|
||||
inline static const T& const_get_value(const Property& p, T* t, Tag tag) {
|
||||
typedef typename Property::next_type Next;
|
||||
typedef typename Next::tag_type Next_tag;
|
||||
enum { match = same_property<Next_tag,Tag>::value };
|
||||
@@ -67,13 +67,13 @@ namespace boost {
|
||||
|
||||
// Stop the recursion and return error
|
||||
template <class T, class Tag>
|
||||
static detail::error_property_not_found&
|
||||
inline static detail::error_property_not_found&
|
||||
get_value(no_property&, T*, Tag) {
|
||||
static error_property_not_found s_prop_not_found;
|
||||
return s_prop_not_found;
|
||||
}
|
||||
template <class T, class Tag>
|
||||
static const detail::error_property_not_found&
|
||||
inline static const detail::error_property_not_found&
|
||||
const_get_value(const no_property&, T*, Tag) {
|
||||
static error_property_not_found s_prop_not_found;
|
||||
return s_prop_not_found;
|
||||
@@ -83,12 +83,12 @@ namespace boost {
|
||||
template <>
|
||||
struct property_value_dispatch<0> {
|
||||
template <class Property, class T, class Tag>
|
||||
static typename property_value_end<Property>::template result<T>::type&
|
||||
inline static typename property_value_end<Property>::template result<T>::type&
|
||||
get_value(Property& p, T* t, Tag tag) {
|
||||
return property_value_end<Property>::get_value(p, t, tag);
|
||||
}
|
||||
template <class Property, class T, class Tag>
|
||||
static const typename property_value_end<Property>::template result<T>::type&
|
||||
inline static const typename property_value_end<Property>::template result<T>::type&
|
||||
const_get_value(const Property& p, T* t, Tag tag) {
|
||||
return property_value_end<Property>::const_get_value(p, t, tag);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user