- static List findWithinRange(const SGGeod& aPos, double aRangeNm, const Filter& aFilter);
-
- static List findWithinRangeByType(const SGGeod& aPos, double aRangeNm, Type aTy);
+ class TypeFilter : public Filter
+ {
+ public:
+ TypeFilter(Type aTy) : mType(aTy) { ; }
+ virtual bool pass(FGPositioned* aPos) const
+ { return (mType == aPos->type()); }
+ private:
+ const Type mType;
+ };
+
+ static List findWithinRange(const SGGeod& aPos, double aRangeNm, Filter* aFilter = NULL);
+
+ static FGPositionedRef findClosestWithIdent(const std::string& aIdent, const SGGeod& aPos, Filter* aFilter = NULL);
+
+ /**
+ * Find the next item with the specified partial ID, after the 'current' item
+ * Note this function is not hyper-efficient, particular where the partial id
+ * spans a large number of candidates.
+ *
+ * @param aCur - Current item, or NULL to retrieve the first item with partial id
+ * @param aId - the (partial) id to lookup
+ */
+ static FGPositionedRef findNextWithPartialId(FGPositionedRef aCur, const std::string& aId, Filter* aFilter = NULL);
+
+ /**
+ * As above, but searches using an offset index
+ */
+ static FGPositionedRef findWithPartialId(const std::string& aId, Filter* aFilter, int aOffset, bool& aNext);