Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::graph::internal_vertex_constructor< VertexProperty > Struct Template Reference

Trait used to construct an instance of a VertexProperty, which is a class type that stores the properties associated with a vertex in a graph, from just the name of that vertex property. More...

#include <named_graph.hpp>

Inheritance diagram for boost::graph::internal_vertex_constructor< VertexProperty >:

Public Types

typedef cannot_add_vertex
< VertexProperty > 
type
 The type field provides a function object that constructs a new instance of VertexProperty from the name of the vertex (as determined by internal_vertex_name). More...
 

Detailed Description

template<typename VertexProperty>
struct boost::graph::internal_vertex_constructor< VertexProperty >

Trait used to construct an instance of a VertexProperty, which is a class type that stores the properties associated with a vertex in a graph, from just the name of that vertex property.

This operation is used when an operation is required to map from a vertex name to a vertex descriptor (e.g., to add an edge outgoing from that vertex), but no vertex by the name exists. The function object provided by this trait will be used to add new vertices based only on their names. Since this cannot be done for arbitrary types, the default behavior is to throw an exception when this routine is called, which requires that all named vertices be added before adding any edges by name.

Member Typedef Documentation

template<typename VertexProperty>
typedef cannot_add_vertex<VertexProperty> boost::graph::internal_vertex_constructor< VertexProperty >::type

The type field provides a function object that constructs a new instance of VertexProperty from the name of the vertex (as determined by internal_vertex_name).

The function object shall accept a vertex name and return a VertexProperty. Predefined options include:

vertex_from_name<VertexProperty>: construct an instance of VertexProperty directly from the name.

cannot_add_vertex<VertexProperty>: the default value, which throws an std::runtime_error if one attempts to add a vertex given just the name.


The documentation for this struct was generated from the following file: