void RODFRouteCont::addRouteDesc(RODFRouteDesc& desc) { // routes may be duplicate as in-between routes may have different starting points if (find_if(myRoutes.begin(), myRoutes.end(), route_finder(desc)) == myRoutes.end()) { // compute route id setID(desc); myRoutes.push_back(desc); } else { RODFRouteDesc& prev = *find_if(myRoutes.begin(), myRoutes.end(), route_finder(desc)); prev.overallProb += desc.overallProb; } }
bool RODFRouteCont::removeRouteDesc(RODFRouteDesc &desc) throw() { std::vector<RODFRouteDesc>::const_iterator j = find_if(myRoutes.begin(), myRoutes.end(), route_finder(desc)); if (j==myRoutes.end()) { return false; } return true; }