bool NBLoadedTLDef::addToSignalGroup(const std::string& groupid, const NBConnectionVector& connections) { bool ok = true; for (NBConnectionVector::const_iterator i = connections.begin(); i != connections.end(); i++) { ok &= addToSignalGroup(groupid, *i); } return ok; }
void NBLoadedTLDef::SignalGroup::remapOutgoing(NBEdge* which, const EdgeVector& by) { NBConnectionVector newConns; for (NBConnectionVector::iterator i = myConnections.begin(); i != myConnections.end();) { if ((*i).getTo() == which) { NBConnection conn((*i).getFrom(), (*i).getTo()); i = myConnections.erase(i); for (EdgeVector::const_iterator j = by.begin(); j != by.end(); j++) { NBConnection curr(conn); if (!curr.replaceTo(which, *j)) { throw ProcessError("Could not replace edge '" + which->getID() + "' by '" + (*j)->getID() + "'.\nUndefined..."); } newConns.push_back(curr); } } else { i++; } } copy(newConns.begin(), newConns.end(), back_inserter(myConnections)); }