Hi all,
I have to manage connections between different items in an audio control
software. Currently, I am using several maps to manage "connections".
I was thinking of using a graph for this but there are several questions
arising. Maybe, someone can enlighten this:
I am controlling a hardware which has several inputs and outputs and
between it a layer of nodes. The inputs are connected to the nodes as
well as the outputs. An input can be connected to several nodes, an
output only to one node.
So, the graph has to represent connections between inputs, nodes, and
outputs. (Actually, there are more layers, but to keep it simple I show
only these 3).
The inputs, outputs, etc. in the end are integers, which are sent to the
device. I represent them as enums.
So I have, e.g.
enum Inputs{
Input1 = 0,
Input2,
InputNone
};
enum Nodes{
NodeM=0,
NodeN,
NodeNone
};
enum Outputs{
AnalogOut1 = 0,
AnalogOut2
OutputNone
};
Now, to use graphs, I have to define vertices. These have to be of "one"
type, as far as I understand that. How do I use the enums as shown
above? A vertice-value may be in enum Inputs or Nodes or Outputs.
Do I have to use a graph with elements of type ints and cast them to my
enums?
From the introduction to BGL, modified:
const int num_vertices = InputNone + NodeNone + OutputNone;
// writing out the edges in the graph
typedef std::pair