[Positioning] Stock: reorganise with Doxygen groups

This commit is contained in:
Matteo Cypriani 2010-06-23 17:45:59 +02:00
parent 6f0c0af5be
commit 29ce5a51af
2 changed files with 55 additions and 17 deletions

View File

@ -22,8 +22,24 @@ unordered_set<ReferencePoint> Stock::reference_points ;
unordered_set<CalibrationRequest> Stock::calibration_requests ; unordered_set<CalibrationRequest> 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:: const Waypoint& Stock::
find_create_waypoint(const Point3D &point) 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. * @param mac The MAC address of the Mobile to search for.
* It must be a valid MAC address, as no check is performed. * 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. * @param mac The MAC address of the AccessPoint to search for.
* It must be a valid MAC address, as no check is performed. * 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:: const ReferencePoint& Stock::
find_create_reference_point(const ReferencePoint &point) find_create_reference_point(const ReferencePoint &point)
{ {
@ -231,6 +263,10 @@ point: reference point list is empty!") ;
} }
/* *** CalibrationRequest operations *** */
const CalibrationRequest& Stock:: const CalibrationRequest& Stock::
find_create_calibration_request(const CalibrationRequest &request) find_create_calibration_request(const CalibrationRequest &request)
{ {
@ -238,19 +274,3 @@ find_create_calibration_request(const CalibrationRequest &request)
calibration_requests.insert(request) ; calibration_requests.insert(request) ;
return *ret.first ; 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() ;
}

View File

@ -37,11 +37,16 @@ private:
static std::tr1::unordered_set<CalibrationRequest> calibration_requests ; static std::tr1::unordered_set<CalibrationRequest> calibration_requests ;
public: public:
/** @name Building operations */
//@{
/// Read the Building corresponding to a given name /// Read the Building corresponding to a given name
static const Building& get_building(const std::string &name) ; static const Building& get_building(const std::string &name) ;
/// Look for a Building and create it if it does not exist /// Look for a Building and create it if it does not exist
static const Building& find_create_building(const std::string &name) ; 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 /// Look for a Waypoint and add it if it does not exist
static const Waypoint& static const Waypoint&
find_create_waypoint(const Waypoint &point) ; find_create_waypoint(const Waypoint &point) ;
@ -53,14 +58,20 @@ public:
/// delete the Waypoint if it is not linked to any Building any more /// delete the Waypoint if it is not linked to any Building any more
static void waypoint_remove_building(const Waypoint &point, static void waypoint_remove_building(const Waypoint &point,
const Building *building) ; const Building *building) ;
//@}
/** @name Mobile operations */
//@{
/// Read the Mobile corresponding to a given MAC address /// Read the Mobile corresponding to a given MAC address
static const Mobile& get_mobile(const std::string &mac) ; static const Mobile& get_mobile(const std::string &mac) ;
/// Look for a Mobile and create it if it does not exist /// Look for a Mobile and create it if it does not exist
static const Mobile& find_create_mobile(const std::string &mac) ; static const Mobile& find_create_mobile(const std::string &mac) ;
/// Get a reference to the Mobile corresponding to a given MAC address /// Get a reference to the Mobile corresponding to a given MAC address
static Mobile& getw_mobile(const std::string &mac) ; static Mobile& getw_mobile(const std::string &mac) ;
//@}
/** @name AccessPoint operations */
//@{
/// Read the AccessPoint corresponding to a given MAC address /// Read the AccessPoint corresponding to a given MAC address
static const AccessPoint& get_ap(const std::string &mac) ; static const AccessPoint& get_ap(const std::string &mac) ;
/// Look for an AccessPoint and create it if it does not exist /// 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) ; static AccessPoint& getw_ap(const std::string &mac) ;
/// Update the friis indexes of all the APs /// Update the friis indexes of all the APs
static void update_all_friis_indexes(void) ; static void update_all_friis_indexes(void) ;
//@}
/** @name ReferencePoint operations */
//@{
/// Look for a ReferencePoint and add it if it does not exist /// Look for a ReferencePoint and add it if it does not exist
static const ReferencePoint& static const ReferencePoint&
find_create_reference_point(const ReferencePoint &point) ; find_create_reference_point(const ReferencePoint &point) ;
@ -77,10 +91,14 @@ public:
/// space) to a given Request /// space) to a given Request
static const ReferencePoint& static const ReferencePoint&
closest_reference_point(const Request &request) ; closest_reference_point(const Request &request) ;
//@}
/** @name CalibrationRequest operations */
//@{
/// Look for a CalibrationRequest and add it if it does not exist /// Look for a CalibrationRequest and add it if it does not exist
static const CalibrationRequest& static const CalibrationRequest&
find_create_calibration_request(const CalibrationRequest &request) ; find_create_calibration_request(const CalibrationRequest &request) ;
//@}
/// Deletes all elements in all attributes /// Deletes all elements in all attributes
static void clear(void) ; static void clear(void) ;