time_stamper<TimeMap, TimeT, EventTag>
time_stamper 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.
std::vectorcolor(num_vertices(G)); std::vector dtime(num_vertices(G)); std::vector ftime(num_vertices(G)); int time = 0; boost::breadth_first_search (G, vertex(s, G), make_bfs_visitor( std::make_pair(stamp_times(dtime.begin(), time, on_discover_vertex()), stamp_times(ftime.begin(), time, on_finish_vertex()))), color.begin());
Parameter | Description | Default |
---|---|---|
TimeMap | A WritablePropertyMap, where the key_type is the vertex descriptor type or edge descriptor of the graph (depending on the kind of event tag), and where the TimeT type is convertible to the value_type of the time property map. | |
TimeT | The type for the time counter, which should be convertible to the value_type of the time property map | |
EventTag | The tag to specify when the time_stamper should be applied during the graph algorithm. |
Type | Description |
---|---|
time_stamper::event_filter | This will be the same type as the template parameter EventTag. |
Member | Description |
---|---|
time_stamper(TimeMap time_pa, TimeT& t); | Construct a time stamper object with time property map time_pa and time counter t. |
template <class X, class Graph> void operator()(X x, const Graph& g); |
This increments the time count and "stamps" the time: put(time_pa, x, ++t); |
Function | Description |
---|---|
template <class TimeMap, class TimeT, class Tag> time_stamper<TimeMap, TimeT, Tag> stamp_times(TimeMap pa, TimeT& t, Tag); | A convenient way to create a time_stamper. |
The following are other event visitors: distance_recorder,
time_stamper,
and property_writer.
Copyright © 2000-2001 |
Jeremy Siek,
Indiana University (jsiek@osl.iu.edu) Lie-Quan Lee, Indiana University (llee@cs.indiana.edu) Andrew Lumsdaine, Indiana University (lums@osl.iu.edu) |