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

named_graph is a mixin that provides names for the vertices of a graph, including a mapping from names to vertices. More...

#include <named_graph.hpp>

Inheritance diagram for boost::graph::named_graph< Graph, Vertex, VertexProperty >:
Collaboration diagram for boost::graph::named_graph< Graph, Vertex, VertexProperty >:

Public Types

typedef internal_vertex_name
< VertexProperty >::type 
extract_name_type
 The type of the function object that extracts names from vertex properties. More...
 
typedef lookup_one_property
< VertexProperty,
vertex_bundle_t >::type 
bundled_vertex_property_type
 The type of the "bundled" property, from which the name can be extracted. More...
 
typedef
internal_vertex_constructor
< VertexProperty >::type 
vertex_constructor_type
 The type of the function object that generates vertex properties from names, for the implicit addition of vertices. More...
 
typedef remove_cv< typename
remove_reference< typename
extract_name_type::result_type >
::type >::type 
vertex_name_type
 The type used to name vertices in the graph. More...
 
typedef Vertex vertex_descriptor
 The type of vertex descriptors in the graph. More...
 
typedef
multi_index::multi_index_container
< Vertex,
multi_index::indexed_by
< multi_index::hashed_unique
< multi_index::tag
< vertex_name_t >
, extract_name_from_vertex > > > 
named_vertices_type
 The type that maps names to vertices. More...
 
typedef
named_vertices_type::template
index< vertex_name_t >::type 
vertices_by_name_type
 The set of vertices, indexed by name. More...
 

Public Member Functions

 named_graph (const extract_name_type &extract=extract_name_type(), const vertex_constructor_type &vertex_constructor=vertex_constructor_type())
 Construct an instance of the named graph mixin, using the given function object to extract a name from the bundled property associated with a vertex. More...
 
void added_vertex (Vertex vertex)
 Notify the named_graph that we have added the given vertex. More...
 
template<typename VertexIterStability >
void removing_vertex (Vertex vertex, VertexIterStability)
 Notify the named_graph that we are removing the given vertex. More...
 
void clearing_graph ()
 Notify the named_graph that we are clearing the graph. More...
 
Graph & derived ()
 Retrieve the derived instance. More...
 
const Graph & derived () const
 
extract_name_type::result_type extract_name (const bundled_vertex_property_type &property)
 Extract the name from a vertex property instance. More...
 
optional< vertex_descriptorvertex_by_property (const bundled_vertex_property_type &property)
 Search for a vertex that has the given property (based on its name) More...
 

Public Attributes

named_vertices_type named_vertices
 Mapping from names to vertices. More...
 
vertex_constructor_type vertex_constructor
 Constructs a vertex from the name of that vertex. More...
 

Detailed Description

template<typename Graph, typename Vertex, typename VertexProperty>
class boost::graph::named_graph< Graph, Vertex, VertexProperty >

named_graph is a mixin that provides names for the vertices of a graph, including a mapping from names to vertices.

Graph types that may or may not be have vertex names (depending on the properties supplied by the user) should use maybe_named_graph.

Template parameters:

Graph: the graph type that derives from named_graph

Vertex: the type of a vertex descriptor in Graph. Note: we cannot use graph_traits here, because the Graph is not yet defined.

VertexProperty: the type stored with each vertex in the Graph.

Member Typedef Documentation

template<typename Graph, typename Vertex, typename VertexProperty>
typedef lookup_one_property<VertexProperty, vertex_bundle_t>::type boost::graph::named_graph< Graph, Vertex, VertexProperty >::bundled_vertex_property_type

The type of the "bundled" property, from which the name can be extracted.

template<typename Graph, typename Vertex, typename VertexProperty>
typedef internal_vertex_name<VertexProperty>::type boost::graph::named_graph< Graph, Vertex, VertexProperty >::extract_name_type

The type of the function object that extracts names from vertex properties.

template<typename Graph, typename Vertex, typename VertexProperty>
typedef multi_index::multi_index_container< Vertex, multi_index::indexed_by< multi_index::hashed_unique<multi_index::tag<vertex_name_t>, extract_name_from_vertex> > > boost::graph::named_graph< Graph, Vertex, VertexProperty >::named_vertices_type

The type that maps names to vertices.

template<typename Graph, typename Vertex, typename VertexProperty>
typedef internal_vertex_constructor<VertexProperty>::type boost::graph::named_graph< Graph, Vertex, VertexProperty >::vertex_constructor_type

The type of the function object that generates vertex properties from names, for the implicit addition of vertices.

template<typename Graph, typename Vertex, typename VertexProperty>
typedef Vertex boost::graph::named_graph< Graph, Vertex, VertexProperty >::vertex_descriptor

The type of vertex descriptors in the graph.

template<typename Graph, typename Vertex, typename VertexProperty>
typedef remove_cv< typename remove_reference< typename extract_name_type::result_type>::type>::type boost::graph::named_graph< Graph, Vertex, VertexProperty >::vertex_name_type

The type used to name vertices in the graph.

template<typename Graph, typename Vertex, typename VertexProperty>
typedef named_vertices_type::template index<vertex_name_t>::type boost::graph::named_graph< Graph, Vertex, VertexProperty >::vertices_by_name_type

The set of vertices, indexed by name.

Constructor & Destructor Documentation

template<typename Graph , typename Vertex , typename VertexProperty >
boost::graph::named_graph< Graph, Vertex, VertexProperty >::named_graph ( const extract_name_type extract = extract_name_type(),
const vertex_constructor_type vertex_constructor = vertex_constructor_type() 
)

Construct an instance of the named graph mixin, using the given function object to extract a name from the bundled property associated with a vertex.

Member Function Documentation

template<typename Graph , typename Vertex, typename VertexProperty >
void boost::graph::named_graph< Graph, Vertex, VertexProperty >::added_vertex ( Vertex  vertex)
inline

Notify the named_graph that we have added the given vertex.

The name of the vertex will be added to the mapping.

template<typename Graph , typename Vertex , typename VertexProperty >
void boost::graph::named_graph< Graph, Vertex, VertexProperty >::clearing_graph ( )
inline

Notify the named_graph that we are clearing the graph.

This will clear out all of the name->vertex mappings

template<typename Graph, typename Vertex, typename VertexProperty>
Graph& boost::graph::named_graph< Graph, Vertex, VertexProperty >::derived ( )
inline

Retrieve the derived instance.

template<typename Graph, typename Vertex, typename VertexProperty>
const Graph& boost::graph::named_graph< Graph, Vertex, VertexProperty >::derived ( ) const
inline
template<typename Graph , typename Vertex , typename VertexProperty >
named_graph< Graph, Vertex, VertexProperty >::extract_name_type::result_type boost::graph::named_graph< Graph, Vertex, VertexProperty >::extract_name ( const bundled_vertex_property_type property)

Extract the name from a vertex property instance.

template<typename Graph , typename Vertex, typename VertexProperty >
template<typename VertexIterStability >
void boost::graph::named_graph< Graph, Vertex, VertexProperty >::removing_vertex ( Vertex  vertex,
VertexIterStability   
)
inline

Notify the named_graph that we are removing the given vertex.

The name of the vertex will be removed from the mapping.

References BOOST_STATIC_ASSERT_MSG, boost::program_options::value(), and boost::vertex_name.

template<typename Graph , typename Vertex , typename VertexProperty >
optional< typename named_graph< Graph, Vertex, VertexProperty >::vertex_descriptor > boost::graph::named_graph< Graph, Vertex, VertexProperty >::vertex_by_property ( const bundled_vertex_property_type property)

Search for a vertex that has the given property (based on its name)

References boost::graph::find_vertex().

Member Data Documentation

template<typename Graph, typename Vertex, typename VertexProperty>
named_vertices_type boost::graph::named_graph< Graph, Vertex, VertexProperty >::named_vertices

Mapping from names to vertices.

template<typename Graph, typename Vertex, typename VertexProperty>
vertex_constructor_type boost::graph::named_graph< Graph, Vertex, VertexProperty >::vertex_constructor

Constructs a vertex from the name of that vertex.


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