3rdParty/boost/1.78.0/libs/graph/doc/property_writer.html
property_writer<PropertyMap, OutputIterator, EventTag>This is an EventVisitor that can be used to output the property of a vertex or edge at some event-point within an algorithm.
property_writer can be used with graph algorithms by wrapping it with the algorithm-specific adaptor, such as bfs_visitor and dfs_visitor. Also, this event visitor can be combined with other event visitors using std::pair to form an EventVisitorList.
The following is an excerpt from examples/dave.cpp.
std::ostream_iterator cout\_int(std::cout, " "); std::ostream\_iterator cout\_char(std::cout, " "); boost::breadth\_first\_search (G, vertex(a, G), make\_bfs\_visitor( std::make\_pair(write\_property(name, cout\_char, on\_discover\_vertex()), std::make\_pair(write\_property(distance.begin(), cout\_int, on\_discover\_vertex()), std::make\_pair(print\_edge(name, std::cout, on\_examine\_edge()), print\_endl(std::cout, on\_finish\_vertex() ))))));
| Parameter | Description | Default |
|---|---|---|
| PropertyMap | A ReadablePropertyMap where the key_type is the vertex descriptor type or edge descriptor of the graph (depending on the kind of event tag) and the value_type of the property is convertible to the value_type of the OutputIterator. | |
| OutputIterator | The iterator type used to write out the property values, which must be a model of OutputIterator. | |
| EventTag | The tag to specify when the property_writer should be applied during the graph algorithm. |
| Type | Description |
|---|---|
| property_writer::event_filter | This will be the same type as the template parameter EventTag. |
| Member | Description |
|---|---|
| property_writer(PropertyMap pa, OutputIterator out); | Construct a property writer object with the property map pa and output iterator out. |
| template <class X, class Graph> | |
| void operator()(X x, const Graph& g); | This writes the property value for x to the output iterator. |
| *out++ = get(pa, x); |
| Function | Description |
|---|---|
| template <class PropertyMap, class OutputIterator, class Tag> | |
| property_writer<PropertyMap, OutputIterator, Tag> | |
| write_property(PropertyMap pa, OutputIterator out, Tag); | A convenient way to create a property_writer. |
The following are other event visitors: distance_recorder, predecessor_recorder, and time_stamper.
| Copyright © 2000-2001 | Jeremy Siek, Indiana University ([email protected])
Lie-Quan Lee, Indiana University ([email protected])
Andrew Lumsdaine, Indiana University ([email protected]) |