123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- #ifndef BOOST_GRAPH_LABELED_GRAPH_TRAITS_HPP
- #define BOOST_GRAPH_LABELED_GRAPH_TRAITS_HPP
- #include <boost/graph/graph_mutability_traits.hpp>
- namespace boost
- {
- struct label_vertex_tag
- {
- };
- struct labeled_add_vertex_tag : virtual label_vertex_tag
- {
- };
- struct labeled_add_vertex_property_tag : virtual labeled_add_vertex_tag
- {
- };
- struct labeled_remove_vertex_tag
- {
- };
- struct labeled_add_edge_tag : virtual label_vertex_tag
- {
- };
- struct labeled_add_edge_property_tag : virtual labeled_add_edge_tag
- {
- };
- struct labeled_remove_edge_tag
- {
- };
- struct labeled_mutable_vertex_graph_tag : virtual labeled_add_vertex_tag,
- virtual labeled_remove_vertex_tag
- {
- };
- struct labeled_mutable_vertex_property_graph_tag
- : virtual labeled_add_vertex_property_tag,
- virtual labeled_remove_vertex_tag
- {
- };
- struct labeled_mutable_edge_graph_tag : virtual labeled_add_edge_tag,
- virtual labeled_remove_edge_tag
- {
- };
- struct labeled_mutable_edge_property_graph_tag
- : virtual labeled_add_edge_property_tag,
- virtual labeled_remove_edge_tag
- {
- };
- struct labeled_graph_tag : virtual label_vertex_tag
- {
- };
- struct labeled_mutable_graph_tag : virtual labeled_mutable_vertex_graph_tag,
- virtual labeled_mutable_edge_graph_tag
- {
- };
- struct labeled_mutable_property_graph_tag
- : virtual labeled_mutable_vertex_property_graph_tag,
- virtual labeled_mutable_edge_property_graph_tag
- {
- };
- struct labeled_add_only_property_graph_tag
- : virtual labeled_add_vertex_property_tag,
- virtual labeled_mutable_edge_property_graph_tag
- {
- };
- template < typename Graph >
- struct graph_has_add_vertex_by_label
- : mpl::bool_<
- is_convertible< typename graph_mutability_traits< Graph >::category,
- labeled_add_vertex_tag >::value >
- {
- };
- template < typename Graph >
- struct graph_has_add_vertex_by_label_with_property
- : mpl::bool_<
- is_convertible< typename graph_mutability_traits< Graph >::category,
- labeled_add_vertex_property_tag >::value >
- {
- };
- template < typename Graph >
- struct graph_has_remove_vertex_by_label
- : mpl::bool_<
- is_convertible< typename graph_mutability_traits< Graph >::category,
- labeled_remove_vertex_tag >::value >
- {
- };
- template < typename Graph >
- struct graph_has_add_edge_by_label
- : mpl::bool_<
- is_convertible< typename graph_mutability_traits< Graph >::category,
- labeled_add_edge_tag >::value >
- {
- };
- template < typename Graph >
- struct graph_has_add_edge_by_label_with_property
- : mpl::bool_<
- is_convertible< typename graph_mutability_traits< Graph >::category,
- labeled_add_edge_property_tag >::value >
- {
- };
- template < typename Graph >
- struct graph_has_remove_edge_by_label
- : mpl::bool_<
- is_convertible< typename graph_mutability_traits< Graph >::category,
- labeled_remove_edge_tag >::value >
- {
- };
- template < typename Graph >
- struct is_labeled_mutable_vertex_graph
- : mpl::and_< graph_has_add_vertex_by_label< Graph >,
- graph_has_remove_vertex_by_label< Graph > >
- {
- };
- template < typename Graph >
- struct is_labeled_mutable_vertex_property_graph
- : mpl::and_< graph_has_add_vertex_by_label< Graph >,
- graph_has_remove_vertex_by_label< Graph > >
- {
- };
- template < typename Graph >
- struct is_labeled_mutable_edge_graph
- : mpl::and_< graph_has_add_edge_by_label< Graph >,
- graph_has_remove_edge_by_label< Graph > >
- {
- };
- template < typename Graph >
- struct is_labeled_mutable_edge_property_graph
- : mpl::and_< graph_has_add_edge_by_label< Graph >,
- graph_has_remove_edge_by_label< Graph > >
- {
- };
- template < typename Graph >
- struct is_labeled_mutable_graph
- : mpl::and_< is_labeled_mutable_vertex_graph< Graph >,
- is_labeled_mutable_edge_graph< Graph > >
- {
- };
- template < typename Graph >
- struct is_labeled_mutable_property_graph
- : mpl::and_< is_labeled_mutable_vertex_property_graph< Graph >,
- is_labeled_mutable_edge_property_graph< Graph > >
- {
- };
- template < typename Graph >
- struct is_labeled_add_only_property_graph
- : mpl::bool_<
- is_convertible< typename graph_mutability_traits< Graph >::category,
- labeled_add_only_property_graph_tag >::value >
- {
- };
- template < typename Graph >
- struct is_labeled_graph
- : mpl::bool_<
- is_convertible< typename graph_mutability_traits< Graph >::category,
- label_vertex_tag >::value >
- {
- };
- template < typename > struct graph_mutability_traits;
- namespace graph_detail
- {
-
-
-
- template < typename Graph > struct determine_mutability
- {
- typedef typename mpl::if_< is_add_only_property_graph< Graph >,
- labeled_add_only_property_graph_tag,
- typename mpl::if_< is_mutable_property_graph< Graph >,
- labeled_mutable_property_graph_tag,
- typename mpl::if_< is_mutable_graph< Graph >,
- labeled_mutable_graph_tag,
- typename mpl::if_< is_mutable_edge_graph< Graph >,
- labeled_graph_tag,
- typename graph_mutability_traits< Graph >::category >::
- type >::type >::type >::type type;
- };
- }
- #define LABELED_GRAPH_PARAMS typename G, typename L, typename S
- #define LABELED_GRAPH labeled_graph< G, L, S >
- template < LABELED_GRAPH_PARAMS >
- struct graph_mutability_traits< LABELED_GRAPH >
- {
- typedef typename graph_detail::determine_mutability<
- typename LABELED_GRAPH::graph_type >::type category;
- };
- #undef LABELED_GRAPH_PARAMS
- #undef LABELED_GRAPH
- }
- #endif
|