[Positioning] Add Stock::mobile_exists()

This commit is contained in:
Matteo Cypriani 2011-07-19 19:08:50 +02:00
parent 0b43e7f5fc
commit 6b662a597a
2 changed files with 15 additions and 0 deletions

View File

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

View File

@ -70,6 +70,8 @@ public:
//@{
/// Returns the number of mobiles
static unsigned int nb_mobiles(void) ;
/// Verify the existence of a mobile
static bool mobile_exists(const std::string &mac) ;
/// Reads the Mobile corresponding to a given MAC address
static const Mobile& get_mobile(const std::string &mac) ;
/// \brief Searches for a Mobile given its MAC address and creates