Index: deployment/DeploymentComponent.cpp =================================================================== --- deployment/DeploymentComponent.cpp (revision 30002) +++ deployment/DeploymentComponent.cpp (working copy) @@ -611,40 +611,81 @@ Property* ports = comp.get().getProperty("Ports"); if ( ports != 0 ) { PropertyBag::Names pnams = ports->get().list(); - for (PropertyBag::Names::iterator pit= pnams.begin(); pit !=pnams.end(); pit++) { - PortInterface* p = c->ports()->getPort(*pit); - if ( !p ) { - log(Error)<< "Component '"<< c->getName() <<"' does not have a Port '"<<*pit<<"'." << endlog(); - valid = false; - } - if ( ports->get().getProperty(*pit) == 0) { - log(Error)<< "Property '"<< *pit <<"' is not of type 'string'." << endlog(); - valid = false; - } - // store the port - if (valid){ - string port_name = ports->get().getProperty(*pit)->get(); - bool to_add = true; - // go through the vector to avoid duplicate items. - // NOTE the sizes conmap[port_name].ports.size() and conmap[port_name].owners.size() are supposed to be equal - for(unsigned int a=0; a < conmap[port_name].ports.size(); a++) + + if (0 < pnams.size()) + { + log(Debug) <<"Considering " << pnams.size() << " ports specified for component "<getName() << endlog(); + // add all ports named in the deployment file + for (PropertyBag::Names::iterator pit= pnams.begin(); pit !=pnams.end(); pit++) { + PortInterface* p = c->ports()->getPort(*pit); + if ( !p ) { + log(Error)<< "Component '"<< c->getName() <<"' does not have a Port '"<<*pit<<"'." << endlog(); + valid = false; + } + if ( ports->get().getProperty(*pit) == 0) { + log(Error)<< "Property '"<< *pit <<"' is not of type 'string'." << endlog(); + valid = false; + } + // store the port + if (valid){ + string port_name = ports->get().getProperty(*pit)->get(); + bool to_add = true; + // go through the vector to avoid duplicate items. + // NOTE the sizes conmap[port_name].ports.size() and conmap[port_name].owners.size() are supposed to be equal + for(unsigned int a=0; a < conmap[port_name].ports.size(); a++) { if( conmap[port_name].ports.at(a) == p && conmap[port_name].owners.at(a) == c) - { - to_add = false; - continue; - } + { + log(Debug)<<"ignoring Port: "<getName()<<"."<getName(); + log(Debug)<<" in " << port_name <getName()<<"."<getName(); log(Debug)<<" in " << port_name <ports()->getPortNames(); + log(Debug) <<"Adding all " << names.size() << " ports of component "<getName() << endlog(); + for (DataFlowInterface::PortNames::iterator pit=names.begin(); pit!=names.end(); ++pit) + { + PortInterface* p = c->ports()->getPort(*pit); + string port_name = *pit; + bool to_add = true; + // go through the vector to avoid duplicate items. + // NOTE the sizes conmap[port_name].ports.size() and conmap[port_name].owners.size() are supposed to be equal + for(unsigned int a=0; a < conmap[port_name].ports.size(); a++) + { + if( (conmap[port_name].ports.at(a) == p) && (conmap[port_name].owners.at(a) == c)) + { + log(Debug)<<"ignoring Port: "<getName()<<"."<getName(); + log(Debug)<<" in " << port_name <getName()<<"."<getName(); + log(Debug)<<" in " << port_name <