mirror of
https://github.com/boostorg/graph.git
synced 2026-02-27 17:12:11 +00:00
105 lines
2.5 KiB
Plaintext
105 lines
2.5 KiB
Plaintext
[/
|
|
/ Copyright (c) 2007 Andrew Sutton
|
|
/
|
|
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
/]
|
|
|
|
[section Time Stamper]
|
|
|
|
template <class TimeMap, class TimeT, class EventTag>
|
|
class time_stamper;
|
|
|
|
This is an [EventVisitor] that can be used to "stamp" a time at some event-point
|
|
within an algorithm. An example of this is recording the discover or finish time of
|
|
a vertex during a graph search.
|
|
|
|
The [time_stamper] class 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].
|
|
|
|
[h4 Model Of]
|
|
[EventVisitor]
|
|
|
|
[h4 Where Defined]
|
|
`boost/graph/visitors.hpp`
|
|
|
|
[h4 Template Parameters]
|
|
[table
|
|
[[Parameter] [Description] [Default]]
|
|
[
|
|
[`TimeMap`]
|
|
[
|
|
A [WritablePropertyMap] where the key type is of type `vertex_descriptor`
|
|
of `edge_descriptor` (depending on the event tag) and `TimeT` must be convertible
|
|
to the value type.
|
|
]
|
|
]
|
|
[
|
|
[`TimeT`]
|
|
[
|
|
The type of the time counter, which should be convertible to the `value_type` of
|
|
TimeMap.
|
|
]
|
|
]
|
|
[
|
|
[`EventTag`]
|
|
[
|
|
A tag used to specify when the time stamper should be applied during the graph
|
|
algorithm.
|
|
]
|
|
]
|
|
]
|
|
|
|
[h4 Associated Types]
|
|
[table
|
|
[[Type] [Description]]
|
|
[
|
|
[`time_stamper::event_filter`]
|
|
[
|
|
This type will be the same as the template parameter `EventTag`.
|
|
]
|
|
]
|
|
]
|
|
|
|
[h4 Member Functions]
|
|
[table
|
|
[[Function] [Description]]
|
|
[
|
|
[`time_stamper(Timemap pa, TimeT& t)`]
|
|
[Construct a time stamper object with a timestamp property map `pa` and time counter `t`.]
|
|
]
|
|
[
|
|
[
|
|
``
|
|
template <class X, class Graph>
|
|
void operator()(X x, const Graph& g)
|
|
``
|
|
]
|
|
[
|
|
This records the current timestamp for the edge or vertex in the property map
|
|
and increments the time count.
|
|
]
|
|
]
|
|
]
|
|
|
|
[h4 Non-Member Functions]
|
|
[table
|
|
[[Function] [Description]]
|
|
[
|
|
[
|
|
``
|
|
template <class TimeMap, class TimeT, class EventTag>
|
|
time_stamper<TimeMap, EventTag>
|
|
stamp_times(TimeMap pa, TimeT& t, EventTag)
|
|
``
|
|
]
|
|
[
|
|
A convenience function for creating [time_stamper] instances.
|
|
]
|
|
]
|
|
]
|
|
|
|
[endsect]
|