[Clam-devel] subnetworks interfacing - NE several opened files

Pau Arumí parumi at iua.upf.edu
Fri Aug 1 00:19:40 PDT 2008


On dj, 2008-07-31 at 18:15 -0300, Natanael Olaiz wrote:
> El 07/30/2008 07:19 AM, Pau Arumí escribió: 
> > Reordering the questions:
> > 
> >   
> > > > With graph getter do you mean graph as a networks hierarchy tree? The 
> > > > implementation of that would not go on the newer Network class?
> > > >       
> > 
> > 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)
> >   
> 
> 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)?

No, flat is better: a single list of (source,target) structs (two
strings). Example:[("A.out","B.in"), ("A.out","C.in"))]

P


> FlattenedNetwork.hxx:
>             typedef std::map<std::string, NamesList > ConnectionsMap;
>             virtual void RefreshConnections();
>             virtual const ConnectionsMap getConnectionsMap() const
>         { return _connections; }
>             ConnectionsMap _connections;
> FlattenedNetwork.cxx:
>             void FlattenedNetwork::RefreshConnections()
>             {
>                 _connections.clear();
>                 ProcessingsMap::const_iterator itProcessings;
>                 for (itProcessings=BeginProcessings(); itProcessings!
>         =EndProcessings(); itProcessings++)
>                 {
>                     std::string producerName = itProcessings->first;
>                     CLAM::Processing & producer =
>         GetProcessing(producerName);
>                     CLAM::OutPortRegistry & outPorts =
>         producer.GetOutPorts();
>                     for (int op = 0; op<outPorts.Size(); op++)
>                     {
>                         CLAM::OutPortBase & outPort =
>         outPorts.GetByNumber(op);
>                         std::string completeOutName = producerName +
>         "." + outPort.GetName();
>                         NamesList connectedTo =
>         GetInPortsConnectedTo( completeOutName );
>                         if (not connectedTo.empty())
>         
>         _connections.insert(ConnectionsMap::value_type(completeOutName,connectedTo));
>                     }
>                 }
>             }
> 
> 
> > [...]
> 
> _______________________________________________
> Clam-devel mailing list
> Clam-devel at llistes.projectes.lafarga.org
> https://llistes.projectes.lafarga.org/cgi-bin/mailman/listinfo/clam-devel





More information about the clam-devel mailing list