C++ Boost

EdgePropertyGraph

A EdgePropertyGraph is a graph that has some property associated with each of the edges in the graph. As a given graph may have several properties associated with each edge, a tag is used to identity which property is being accessed. The graph provides a function which returns a property accessor object.

Refinement of

Graph

Notation

G A type that is a model of Graph.
g An object of type G.
Tag An empty class used as a tag to specify the property.
tag An object of type Tag.

Associated Types

Property Accessor Type boost::edge_property_accessor<G,Tag>::type The type of the property accessor for the property specified by Tag. This type must be a model of ReadWritePropertyAccessor with a key type the same as the graph's edge descriptor type.
Const Property Accessor Type boost::edge_property_accessor<G,Tag>::const_type The type of the const property accessor for the property specified by Tag. This type must be a model of ReadablePropertyAccessor with a key type the same as the graph's edge descriptor type.

Valid Expressions

Get Property Accessor Object get_edge_property_accessor(g, tag) boost::edge_property_accessor<G,Tag>::type if g is mutable and boost::edge_property_accessor<G,Tag>::const_type otherwise.

Complexity

The get_edge_property_accessor() function must be constant time.

Models

Concept Checking Class

  template <class G, class Tag>
  struct EdgePropertyGraph_concept
  {
    typedef typename boost::graph_traits<G>::edge_descriptor Edge;
    typedef typename edge_property_accessor<G,Tag>::type PA;
    typedef typename edge_property_accessor<G,Tag>::const_type const_PA;
    void constraints() {
      REQUIRE(G, Graph);
      REQUIRE2(PA, Edge, ReadWritePropertyAccessor);
      REQUIRE2(const_PA, Edge, ReadablePropertyAccessor);

      PA pa = get_edge_property_accessor(g, Tag());
    }
    void const_constraints(const G& g) {
      const_PA pa = get_edge_property_accessor(g, Tag());
    }
    G g;
  };


Copyright © 2000 Jeremy Siek, Univ.of Notre Dame (jsiek@lsc.nd.edu)