const TrackType3D &Catalogue3D::get_track(const TrackType &tt) const
{
- map<const TrackType *, TrackType3D *>::const_iterator i = tracks.find(&tt);
- if(i==tracks.end())
- throw KeyError("Unknown track type");
-
- return *i->second;
+ return *get_item(tracks, &tt);
}
const VehicleType3D &Catalogue3D::get_vehicle(const VehicleType &vt) const
{
- map<const VehicleType *, VehicleType3D *>::const_iterator i = vehicles.find(&vt);
- if(i==vehicles.end())
- throw KeyError("Unknown vehicle type");
-
- return *i->second;
+ return *get_item(vehicles, &vt);
}
void Catalogue3D::track_added(const TrackType &track)
if(FS::exists(path))
return path;
- throw Exception("Can't locate "+name);
+ throw runtime_error("Can't locate "+name);
}
template<typename T>