From 29ce5a51afdac5f2505095fb8bbbe72e31a5cc6a Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Wed, 23 Jun 2010 17:45:59 +0200 Subject: [PATCH] [Positioning] Stock: reorganise with Doxygen groups --- owlps-positioning/src/stock.cc | 54 +++++++++++++++++++++++----------- owlps-positioning/src/stock.hh | 18 ++++++++++++ 2 files changed, 55 insertions(+), 17 deletions(-) diff --git a/owlps-positioning/src/stock.cc b/owlps-positioning/src/stock.cc index 96621d3..2fa780e 100644 --- a/owlps-positioning/src/stock.cc +++ b/owlps-positioning/src/stock.cc @@ -22,8 +22,24 @@ unordered_set Stock::reference_points ; unordered_set Stock::calibration_requests ; +void Stock::clear() +{ + buildings.clear() ; -/* *** Accessors *** */ + // Waypoints are normally deleted in Building::~Building(), so we must + // not clear waypoints before buildings, but we clear it *after*, just + // in case. + waypoints.clear() ; + + mobiles.clear() ; + aps.clear() ; + reference_points.clear() ; + calibration_requests.clear() ; +} + + + +/* *** Building operations *** */ /** @@ -59,6 +75,10 @@ const Building& Stock::get_building(const string &name) } + +/* *** Waypoint operations *** */ + + const Waypoint& Stock:: find_create_waypoint(const Point3D &point) { @@ -89,6 +109,10 @@ void Stock::waypoint_remove_building(const Waypoint &point, } + +/* *** Mobile operations *** */ + + /** * @param mac The MAC address of the Mobile to search for. * It must be a valid MAC address, as no check is performed. @@ -121,6 +145,10 @@ const Mobile& Stock::find_create_mobile(const string &mac) } + +/* *** AccessPoint operations *** */ + + /** * @param mac The MAC address of the AccessPoint to search for. * It must be a valid MAC address, as no check is performed. @@ -194,6 +222,10 @@ void Stock::update_all_friis_indexes() } + +/* *** ReferencePoint operations *** */ + + const ReferencePoint& Stock:: find_create_reference_point(const ReferencePoint &point) { @@ -231,6 +263,10 @@ point: reference point list is empty!") ; } + +/* *** CalibrationRequest operations *** */ + + const CalibrationRequest& Stock:: find_create_calibration_request(const CalibrationRequest &request) { @@ -238,19 +274,3 @@ find_create_calibration_request(const CalibrationRequest &request) calibration_requests.insert(request) ; return *ret.first ; } - - -void Stock::clear() -{ - buildings.clear() ; - - // Waypoints are normally deleted in Building::~Building(), so we must - // not clear waypoints before buildings, but we clear it *after*, just - // in case. - waypoints.clear() ; - - mobiles.clear() ; - aps.clear() ; - reference_points.clear() ; - calibration_requests.clear() ; -} diff --git a/owlps-positioning/src/stock.hh b/owlps-positioning/src/stock.hh index 1ce70b2..e9884f9 100644 --- a/owlps-positioning/src/stock.hh +++ b/owlps-positioning/src/stock.hh @@ -37,11 +37,16 @@ private: static std::tr1::unordered_set calibration_requests ; public: + /** @name Building operations */ + //@{ /// Read the Building corresponding to a given name static const Building& get_building(const std::string &name) ; /// Look for a Building and create it if it does not exist static const Building& find_create_building(const std::string &name) ; + //@} + /** @name Waypoint operations */ + //@{ /// Look for a Waypoint and add it if it does not exist static const Waypoint& find_create_waypoint(const Waypoint &point) ; @@ -53,14 +58,20 @@ public: /// delete the Waypoint if it is not linked to any Building any more static void waypoint_remove_building(const Waypoint &point, const Building *building) ; + //@} + /** @name Mobile operations */ + //@{ /// Read the Mobile corresponding to a given MAC address static const Mobile& get_mobile(const std::string &mac) ; /// Look for a Mobile and create it if it does not exist static const Mobile& find_create_mobile(const std::string &mac) ; /// Get a reference to the Mobile corresponding to a given MAC address static Mobile& getw_mobile(const std::string &mac) ; + //@} + /** @name AccessPoint operations */ + //@{ /// Read the AccessPoint corresponding to a given MAC address static const AccessPoint& get_ap(const std::string &mac) ; /// Look for an AccessPoint and create it if it does not exist @@ -69,7 +80,10 @@ public: static AccessPoint& getw_ap(const std::string &mac) ; /// Update the friis indexes of all the APs static void update_all_friis_indexes(void) ; + //@} + /** @name ReferencePoint operations */ + //@{ /// Look for a ReferencePoint and add it if it does not exist static const ReferencePoint& find_create_reference_point(const ReferencePoint &point) ; @@ -77,10 +91,14 @@ public: /// space) to a given Request static const ReferencePoint& closest_reference_point(const Request &request) ; + //@} + /** @name CalibrationRequest operations */ + //@{ /// Look for a CalibrationRequest and add it if it does not exist static const CalibrationRequest& find_create_calibration_request(const CalibrationRequest &request) ; + //@} /// Deletes all elements in all attributes static void clear(void) ;