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

Natanael Olaiz nolaiz at gmail.com
Thu Jul 31 14:15:35 PDT 2008


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)?

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));
                }
            }
        }



> [...]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20080731/b62e94a3/attachment-0004.htm>


More information about the clam-devel mailing list