From 84acee629c3fcb5580bfe7fa1e796f7866d63ea4 Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Mon, 25 Jul 2011 19:23:20 +0200 Subject: [PATCH] [Positioning] Add Stock::reference_point_exists() --- owlps-positioning/src/stock.cc | 8 ++++++++ owlps-positioning/src/stock.hh | 2 ++ 2 files changed, 10 insertions(+) diff --git a/owlps-positioning/src/stock.cc b/owlps-positioning/src/stock.cc index 9ee4dab..9fc3407 100644 --- a/owlps-positioning/src/stock.cc +++ b/owlps-positioning/src/stock.cc @@ -342,6 +342,14 @@ bool Stock::is_ap_coordinate(const Point3D &coord) /* *** ReferencePoint operations *** */ +bool Stock::reference_point_exists(const ReferencePoint &point) +{ + unordered_set::const_iterator i = + reference_points.find(point) ; + return i != reference_points.end() ; +} + + /** * @param point Coordinates of the wanted ReferencePoint. * @return The ReferencePoint at the given coordinates, if found. diff --git a/owlps-positioning/src/stock.hh b/owlps-positioning/src/stock.hh index 8c4cac7..bfd6c25 100644 --- a/owlps-positioning/src/stock.hh +++ b/owlps-positioning/src/stock.hh @@ -122,6 +122,8 @@ public: //@{ /// Returns the number of reference points static unsigned int nb_reference_points(void) ; + /// Verify the existence of a reference point at the given coordinates + static bool reference_point_exists(const ReferencePoint &point) ; /// Reads the ReferencePoint at the given coordinates static const ReferencePoint& get_reference_point(const ReferencePoint &point) ;