123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- #ifndef BOOST_GRAPH_MUTABILITY_TRAITS_HPP
- #define BOOST_GRAPH_MUTABILITY_TRAITS_HPP
- #include <boost/config.hpp>
- #include <boost/mpl/if.hpp>
- #include <boost/mpl/and.hpp>
- #include <boost/mpl/bool.hpp>
- #include <boost/type_traits/is_same.hpp>
- namespace boost
- {
- struct add_vertex_tag
- {
- };
- struct add_vertex_property_tag : virtual add_vertex_tag
- {
- };
- struct add_edge_tag
- {
- };
- struct add_edge_property_tag : virtual add_edge_tag
- {
- };
- struct remove_vertex_tag
- {
- };
- struct remove_edge_tag
- {
- };
- struct mutable_vertex_graph_tag : virtual add_vertex_tag,
- virtual remove_vertex_tag
- {
- };
- struct mutable_vertex_property_graph_tag : virtual add_vertex_property_tag,
- virtual remove_vertex_tag
- {
- };
- struct mutable_edge_graph_tag : virtual add_edge_tag, virtual remove_edge_tag
- {
- };
- struct mutable_edge_property_graph_tag : virtual add_edge_property_tag,
- virtual remove_edge_tag
- {
- };
- struct mutable_graph_tag : virtual mutable_vertex_graph_tag,
- virtual mutable_edge_graph_tag
- {
- };
- struct mutable_property_graph_tag : virtual mutable_vertex_property_graph_tag,
- virtual mutable_edge_property_graph_tag
- {
- };
- struct add_only_property_graph_tag : virtual add_vertex_property_tag,
- virtual mutable_edge_property_graph_tag
- {
- };
- template < typename Graph > struct graph_mutability_traits
- {
- typedef typename Graph::mutability_category category;
- };
- template < typename Graph >
- struct graph_has_add_vertex
- : mpl::bool_<
- is_convertible< typename graph_mutability_traits< Graph >::category,
- add_vertex_tag >::value >
- {
- };
- template < typename Graph >
- struct graph_has_add_vertex_with_property
- : mpl::bool_<
- is_convertible< typename graph_mutability_traits< Graph >::category,
- add_vertex_property_tag >::value >
- {
- };
- template < typename Graph >
- struct graph_has_remove_vertex
- : mpl::bool_<
- is_convertible< typename graph_mutability_traits< Graph >::category,
- remove_vertex_tag >::value >
- {
- };
- template < typename Graph >
- struct graph_has_add_edge
- : mpl::bool_<
- is_convertible< typename graph_mutability_traits< Graph >::category,
- add_edge_tag >::value >
- {
- };
- template < typename Graph >
- struct graph_has_add_edge_with_property
- : mpl::bool_<
- is_convertible< typename graph_mutability_traits< Graph >::category,
- add_edge_property_tag >::value >
- {
- };
- template < typename Graph >
- struct graph_has_remove_edge
- : mpl::bool_<
- is_convertible< typename graph_mutability_traits< Graph >::category,
- remove_edge_tag >::value >
- {
- };
- template < typename Graph >
- struct is_mutable_vertex_graph
- : mpl::and_< graph_has_add_vertex< Graph >, graph_has_remove_vertex< Graph > >
- {
- };
- template < typename Graph >
- struct is_mutable_vertex_property_graph
- : mpl::and_< graph_has_add_vertex_with_property< Graph >,
- graph_has_remove_vertex< Graph > >
- {
- };
- template < typename Graph >
- struct is_mutable_edge_graph
- : mpl::and_< graph_has_add_edge< Graph >, graph_has_remove_edge< Graph > >
- {
- };
- template < typename Graph >
- struct is_mutable_edge_property_graph
- : mpl::and_< graph_has_add_edge_with_property< Graph >,
- graph_has_remove_edge< Graph > >
- {
- };
- template < typename Graph >
- struct is_mutable_graph
- : mpl::and_< is_mutable_vertex_graph< Graph >, is_mutable_edge_graph< Graph > >
- {
- };
- template < typename Graph >
- struct is_mutable_property_graph
- : mpl::and_< is_mutable_vertex_property_graph< Graph >,
- is_mutable_edge_property_graph< Graph > >
- {
- };
- template < typename Graph >
- struct is_add_only_property_graph
- : mpl::bool_<
- is_convertible< typename graph_mutability_traits< Graph >::category,
- add_only_property_graph_tag >::value >
- {
- };
- }
- #endif
|