Boost logo

Boost Users :

Subject: Re: [Boost-users] [graph] Overkill to use graph library for 'small' graphs?
From: Rainer Thaden (RThaden_at_[hidden])
Date: 2008-09-10 08:56:21


Dear Aaron,

> you could do something like:
>
> struct VertexProperties { int enum_label; };
>
> struct EdgeProperties
> {
> int Input;
> int Output;
> };
>
> Then, define your graph as:
>
> typedef boost::adjacency_list<boost::listS, boost::vecS,
> boost::bidirectionalS, VertexProperties, EdgeProperties> graph_t;
>

thanks for your quick answer. I understand what you are suggesting.
I thought a bit further on that. Apart from the integers, I have some
classes representing the Inputs and Outputs, etc. which allow to make
settings on them, which contain a name and additional parameters etc.
Also, there are additional layers, which the audio signal runs through.
It would be desirable to have something like "Give me the output that is
connected to input 1" But also: "give me the audio processing block that
is connected to NodeM".
As there are existing classes, it would be nice if I could just use
these for the graph. I guess, all these, then, must have a common base
class, right? And I need RTTI to figure out the class type after I asked
the graph for the neighbour of NodeM, e.g., right?

I expect some benefit in simplicity and maintainability of the code.
Currently I have a "RoutingManager" which I ask for an Output connected
to a Node, etc. This manager has a lot of different methods which makes
it a bit hard to maintain.

Kind regards,

Rainer


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