Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Click here to view the latest version of this page.
C++ Boost

MutablePropertyGraph

A MutablePropertyGraph is a MutableGraph with properties attached internally to the vertices and edges. When adding vertices and edges the value of the properties can be given.

Refinement of

MutableGraph and PropertyGraph

Notation

G A type that is a model of Graph.
g An object of type G.
e An object of type boost::graph_traits<G>::edge_descriptor.
u,v are objects of type boost::graph_traits<G>::vertex_descriptor.
epis an object of type G::edge_property_type
vpis an object of type G::vertex_property_type

Associated Types

Edge Property Type graph_traits<G>::edge_property_type
Vertex Property Type graph_traits<G>::vertex_property_type

Valid Expressions

add_edge(u, v, ep, g) Inserts the edge (u,v) into the graph, and copies object ep into the property property for that edge.
Return type: std::pair<edge_descriptor, bool>
add_vertex(vp, g) Add a new vertex to the graph and copy vp into the property property for the new vertex. The vertex_descriptor for the new vertex is returned.
Return type: vertex_descriptor

Models

Concept Checking Class

  template <class G>
  struct MutablePropertyGraphConcept
  {
    typedef typename boost::graph_traits<G>::edge_descriptor edge_descriptor;
    void constraints() {
      function_requires< MutableGraphConcept<G> >();
      v = add_vertex(vp, g);
      p = add_edge(u, v, ep, g);
    }
    G g;
    std::pair<edge_descriptor, bool> p;
    typename boost::graph_traits<G>::vertex_descriptor u, v;
    typename boost::graph_traits<G>::vertex_property_type vp;
    typename boost::graph_traits<G>::edge_property_type ep;
  };


Copyright © 2000-2001 Jeremy Siek, Indiana University (jsiek@osl.iu.edu)