VertexPropertyGraph
A VertexPropertyGraph is a graph that has some property associated
with each of the vertices in the graph. As a given graph may have
several properties associated with each vertex, 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::vertex_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 vertex descriptor type.
|
| Const Property Accessor Type |
boost::vertex_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 vertex descriptor type.
|
Valid Expressions
| Name | Expression | Return Type | Description |
| Get Vertex Property Accessor Object |
get_vertex_property_accessor(g, tag) |
boost::vertex_property_accessor<G, Tag>::type
if g is mutable and boost::vertex_property_accessor<G, Tag>::const_type otherwise. |
Returns the property accessor for the vertex property specified by the
Tag type.
|
Complexity
The get_vertex_property_accessor() function must be constant time.
Models
- adjacency_list with VertexPlugin=plugin<distance_tag,int,plugin<in_degree_tag,int> > and Tag=distance_tag.
- adjacency_list with VertexPlugin=plugin<distance_tag,int,plugin<in_degree_tag,int> > and Tag=in_degree_tag.
Concept Checking Class
template <class G, class Tag>
struct VertexPropertyGraph_concept
{
typedef typename boost::graph_traits<G>::vertex_descriptor Vertex;
typedef typename vertex_property_accessor<G, Tag>::type PA;
typedef typename vertex_property_accessor<G, Tag>::const_type const_PA;
void constraints() {
REQUIRE(G, Graph);
REQUIRE2(PA, Vertex, ReadWritePropertyAccessor);
REQUIRE2(const_PA, Vertex, ReadablePropertyAccessor);
PA pa = get_vertex_property_accessor(g, Tag());
ignore_unused_variable_warning(pa);
}
void const_constraints(const G& g) {
const_PA pa = get_vertex_property_accessor(g, Tag());
ignore_unused_variable_warning(pa);
}
G g;
};