C++ Boost

PropertyGraph

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

Refinement of

Graph

Notation

G A type that is a model of Graph.
g An object of type G.
X Either the vertex or edge descriptor type for G.
x An object of type X.
v An object of type property_traits<property_map<G, Property>::type>::value_type.
Property A type that models the Property concept.
property An object of type Property.

Associated types

Property Map Type boost::property_map<G, Property>::type The type of the property map for the property specified by Property. This type must be a model of ReadWritePropertyAccessor with a key type the same as the graph's vertex or descriptor type.
Const Property Map Type boost::property_map<G, Property>::const_type The type of the const property map for the property specified by Property. This type must be a model of ReadablePropertyAccessor with a key type the same as the graph's vertex or edge descriptor type.
Valid Expressions
NameExpressionReturn TypeDescription
Get Property Map get(property, g) boost::property_map<G, Property>::type if g is mutable and boost::property_map<G, Property>::const_type otherwise. Returns the property map object for the property specified by the Property type.
Get Property get(property, g, x) boost::property_traits<boost::property_map<G, Property>::type>::value_type Returns the property (specified by the Property type) associated with object x (a vertex or edge). This function is equivalent to:
get(get(property, g), x)
Put Property put(property, g, x, v) void Set the property (specified by the Property type) associated with object x (a vertex or edge) to the value v. This function is equivalent to:
put(get(property, g), x, v)

Complexity

The get() property map function must be constant time.

Models

Concept Checking Class

  template <class Graph, class X, class Property>
  struct PropertyGraph_concept
  {
    typedef typename property_map<G, Property>::type PMap;
    typedef typename property_map<G, Property>::const_type const_PMap;
    void constraints() {
      REQUIRE(G, Graph);
      REQUIRE2(PMap, X, ReadWritePropertyMap);
      REQUIRE2(const_PMap, X, ReadablePropertyMap);

      PMap pmap = get(Property(), g);
      pval = get(Property(), g, x);
      put(Property(), g, x, pval);
      ignore_unused_variable_warning(pmap);
    }
    void const_constraints(const G& g) {
      const_PA pmap = get(Property(), g);
      pval = get(Property(), g, x);
      ignore_unused_variable_warning(pmap);
    }
    G g;
    X x;
    typename property_traits<PMap>::value_type pval;
  };


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