* Delete all flows at a station for specific cargo and destination. * @param via Remote station of flows to be deleted. * @return IDs of source stations for which the complete FlowStat, not only a * share, has been erased. */
| 5274 | * share, has been erased. |
| 5275 | */ |
| 5276 | std::vector<StationID> FlowStatMap::DeleteFlows(StationID via) |
| 5277 | { |
| 5278 | std::vector<StationID> ret; |
| 5279 | for (FlowStatMap::iterator f_it = this->begin(); f_it != this->end();) { |
| 5280 | FlowStat &s_flows = f_it->second; |
| 5281 | s_flows.ChangeShare(via, INT_MIN); |
| 5282 | if (s_flows.GetShares()->empty()) { |
| 5283 | ret.push_back(f_it->first); |
| 5284 | this->erase(f_it++); |
| 5285 | } else { |
| 5286 | ++f_it; |
| 5287 | } |
| 5288 | } |
| 5289 | return ret; |
| 5290 | } |
| 5291 | |
| 5292 | /** |
| 5293 | * Restrict all flows at a station for specific cargo and destination. |