Boost logo

Boost Users :

From: Douglas Gregor (doug.gregor_at_[hidden])
Date: 2005-03-14 10:20:39


On Mar 10, 2005, at 9:57 AM, Stephen Torri wrote:
> Here is my visitor after making the suggested changes. I am not sure
> this does the job because I don't understand the following:
>
> 1) How is a custom visitor used as a replacement to depth_first_search?
> The code for how to handle the coloring of the vertex nodes seems to be
> handled by the depth_first_search algorithm and not the associated
> visitor.

The algorithm will handle the coloring of vertices, but will call the
member functions of the visitor (discover_vertex, tree_edge, etc.) when
it reaches the associated event.

> 2) When is the operator() called?

The "event_filter" typedef tells the BGL which event to associate
operator() with. For instance, in the code below it is typedef'd to
on_discover_vertex, so operator() will be called whenever a vertex is
first discovered in the DFS traversal, e.g., when it's color goes from
white to gray.

        Doug


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net