[Positioning] InputDataReader: print --verbose info

Display the number of elements read when the verbose mode is activated.
This commit is contained in:
Matteo Cypriani 2011-06-16 14:10:43 +02:00
parent abd4b0803e
commit 67ccf674a5
2 changed files with 62 additions and 1 deletions

View File

@ -44,6 +44,9 @@ void InputDataReader::read_access_points()
return ;
initialise_access_points_media() ;
if (Configuration::is_configured("verbose"))
cerr << Stock::nb_aps() << " access points stored.\n" ;
}
@ -86,6 +89,13 @@ void InputDataReader::read_topology()
return ;
initialise_topology_media() ;
if (Configuration::is_configured("verbose"))
{
cerr
<< Stock::nb_buildings() << " buildings stored.\n"
<< Stock::nb_waypoints() << " waypoints stored.\n" ;
}
}
@ -134,6 +144,9 @@ void InputDataReader::read_reference_points()
initialise_reference_points_media() ;
read_from_reference_points_media() ;
if (Configuration::is_configured("verbose"))
cerr << Stock::nb_reference_points() << " reference points stored.\n" ;
}

View File

@ -41,6 +41,8 @@ private:
public:
/** @name Building operations */
//@{
/// Get the number of buildings
static unsigned int nb_buildings(void) ;
/// Read the Building corresponding to a given name
static const Building& get_building(const std::string &name) ;
/// Search for a Building and create it if it does not exist
@ -49,6 +51,8 @@ public:
/** @name Waypoint operations */
//@{
/// Get the number of waypoints
static unsigned int nb_waypoints(void) ;
/// Search for a Waypoint and add it if it does not exist
static const Waypoint&
find_create_waypoint(const Waypoint &point) ;
@ -74,6 +78,8 @@ public:
/** @name AccessPoint operations */
//@{
/// Get the number of access points
static unsigned int nb_aps(void) ;
/// Read the AccessPoint corresponding to a given MAC address
static const AccessPoint& get_ap(const std::string &mac) ;
/// Search for an AccessPoint and create it if it does not exist
@ -89,6 +95,8 @@ public:
/** @name ReferencePoint operations */
//@{
/// Get the number of reference points
static unsigned int nb_reference_points(void) ;
/// Search for a ReferencePoint and add it if it does not exist
static const ReferencePoint&
find_create_reference_point(const ReferencePoint &point) ;
@ -115,7 +123,23 @@ public:
/* *** Accessors *** */
/* *** Building operations *** */
inline unsigned int Stock::nb_buildings()
{
return buildings.size() ;
}
/* *** Waypoint operations *** */
inline unsigned int Stock::nb_waypoints()
{
return waypoints.size() ;
}
inline const Waypoint& Stock::
@ -129,6 +153,10 @@ find_create_waypoint(const Waypoint &point)
}
/* *** Mobile operations *** */
/**
* If the Mobile corresponding to \em mac does not exist, it is created.
* @param mac The MAC address of the Mobile to search for. It must be a
@ -141,6 +169,16 @@ inline Mobile& Stock::getw_mobile(const std::string &mac)
}
/* *** AccessPoint operations *** */
inline unsigned int Stock::nb_aps()
{
return aps.size() ;
}
/**
* If the AccessPoint corresponding to \em mac does not exist, it is
* created.
@ -155,4 +193,14 @@ inline AccessPoint& Stock::getw_ap(const std::string &mac)
/* *** ReferencePoint operations *** */
inline unsigned int Stock::nb_reference_points()
{
return reference_points.size() ;
}
#endif // _OWLPS_POSITIONING_STOCK_HH_