<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
El 07/30/2008 07:19 AM, Pau Arumí escribió:
<blockquote cite="mid:1217413143.6141.23.camel@macbook" type="cite">
  <pre wrap="">Reordering the questions:

  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">With graph getter do you mean graph as a networks hierarchy tree? The 
implementation of that would not go on the newer Network class?
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->
Not necessarily. 
There are two clients of the get-graph interface: FlowControl and 
NetworkCanvas. Right now they do complicated things to retrieve the graph,
like asking to each port to which port they are connected.
We should change this to something more straightforward like: get a list 
of processings and a list of connections (nodes+arcs)
  </pre>
</blockquote>
<br>
Pau, do you like a std::map for the connections list, using the
completes names (producer.outport as a key, std::list with
consumers.inports as value)?<br>
<br>
FlattenedNetwork.hxx:<br>
<blockquote><tt>    typedef std::map<std::string, NamesList >
ConnectionsMap;<br>
    virtual void RefreshConnections();<br>
    virtual const ConnectionsMap getConnectionsMap() const { return
_connections; }<br>
    ConnectionsMap _connections;</tt><br>
</blockquote>
FlattenedNetwork.cxx:<br>
<blockquote><tt>    void FlattenedNetwork::RefreshConnections()</tt><br>
  <tt>    {</tt><br>
  <tt>        _connections.clear();</tt><br>
  <tt>        ProcessingsMap::const_iterator itProcessings;</tt><br>
  <tt>        for (itProcessings=BeginProcessings();
itProcessings!=EndProcessings(); itProcessings++)</tt><br>
  <tt>        {</tt><br>
  <tt>            std::string producerName = itProcessings->first;</tt><br>
  <tt>            CLAM::Processing & producer =
GetProcessing(producerName);</tt><br>
  <tt>            CLAM::OutPortRegistry & outPorts =
producer.GetOutPorts();</tt><br>
  <tt>            for (int op = 0; op<outPorts.Size(); op++)</tt><br>
  <tt>            {</tt><br>
  <tt>                CLAM::OutPortBase & outPort =
outPorts.GetByNumber(op);</tt><br>
  <tt>                std::string completeOutName = producerName + "."
+ outPort.GetName();</tt><br>
  <tt>                NamesList connectedTo = GetInPortsConnectedTo(
completeOutName );</tt><br>
  <tt>                if (not connectedTo.empty())</tt><br>
  <tt>                   
_connections.insert(ConnectionsMap::value_type(completeOutName,connectedTo));</tt><br>
  <tt>            }</tt><br>
  <tt>        }</tt><br>
  <tt>    }</tt><br>
</blockquote>
<br>
<br>
<blockquote cite="mid:1217413143.6141.23.camel@macbook" type="cite">[...]<br>
</blockquote>
<br>
</body>
</html>