[Positioning] Add Stock::ap_exists()
This commit is contained in:
parent
68b97451aa
commit
2b1248fbec
|
@ -152,6 +152,19 @@ const Mobile& Stock::find_create_mobile(const string &mac)
|
||||||
/* *** AccessPoint operations *** */
|
/* *** 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.
|
* @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.
|
||||||
|
|
|
@ -81,6 +81,8 @@ public:
|
||||||
//@{
|
//@{
|
||||||
/// Returns the number of access points
|
/// Returns the number of access points
|
||||||
static unsigned int nb_aps(void) ;
|
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
|
/// Reads 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) ;
|
||||||
/// \brief Searches for an AccessPoint given its MAC address and
|
/// \brief Searches for an AccessPoint given its MAC address and
|
||||||
|
|
Loading…
Reference in New Issue