Boost logo

Boost Users :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-09-22 00:43:09


Stephen torri wrote:

> I see that the boost graph library is used to contain data but can it be
> used to contain a class which a visitor moves along the graph per a
> preset algorithm calling interfacing functions as it moves along?

I can't understand the question, sorry. What's "moves along" and what's
"present algorithm".

> class Blue : Color_Base
> {
> virtual ~Blue (){}
>
> virtual std::string get_Name ()
> { return std::string("Blue"); }
> };
>
> So we could have a graph like
>
> |
> Blue -- Red
> | /
> | /
> | /
> Yellow
>
> I have a visitor called Color_Visitor which has the following pseudo
> code:
>
> for each vertice in graph
> visit vertice
> call get_Name()
> print result

You can assign a Color_Base* to each vertex using either internal or
external property and call 'get_Name()' on each vertex.

- Volodya


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