[Positioning] Add Stock::ap_exists()

This commit is contained in:
Matteo Cypriani 2011-06-29 16:13:44 +02:00
parent 68b97451aa
commit 2b1248fbec
2 changed files with 15 additions and 0 deletions

View File

@ -152,6 +152,19 @@ 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.
* @return \em true if an AP with this MAC address exists.
* @return \em false if this MAC address was not found.
*/
bool Stock::ap_exists(const std::string &mac)
{
unordered_map<string, AccessPoint>::const_iterator i = aps.find(mac) ;
return i != aps.end() ;
}
/**
* @param mac The MAC address of the AccessPoint to search for.
* It must be a valid MAC address, as no check is performed.

View File

@ -81,6 +81,8 @@ public:
//@{
/// Returns the number of access points
static unsigned int nb_aps(void) ;
/// Verify the existence of an AP
static bool ap_exists(const std::string &mac) ;
/// Reads the AccessPoint corresponding to a given MAC address
static const AccessPoint& get_ap(const std::string &mac) ;
/// \brief Searches for an AccessPoint given its MAC address and