LocationCache Class Reference

This class represents the cached list of accesspoint with their corresponfin location. More...

#include <LocationCache.h>

List of all members.

Public Slots

void addCache (QHash< QString, QGeoCoordinate >)
 Slot called if WiGLE has downloaded and parsed the APs.
void setCacheRegion (QGeoCoordinate center)
 Set the size of the cache region.

Signals

void cacheDone (QString src)

Public Member Functions

 LocationCache (QObject *parent=0)
 Construct an AP Cache Object.
virtual ~LocationCache ()
 Destruct Cache object.
void add (QString mac, QGeoCoordinate pos)
 DEPRECATED: Add a signle AP to the cache.
QGeoCoordinate getCacheCenter ()
 Get the current value of the region's center.
void updateCache ()
 Update Cache.
void reset ()
 Reset Cache.
void init ()
 Initialize AP Cache.
QGeoCoordinate getPos (QString mac)
 Lookup an APs position in the Cache.
QGeoCoordinate getPos (QList< QString > macs)
 Get the mean position of a list of APs.

Detailed Description

This class represents the cached list of accesspoint with their corresponfin location.


Constructor & Destructor Documentation

LocationCache::LocationCache ( QObject *  parent = 0  ) 

Construct an AP Cache Object.

An instance to WiFLE is created. This instance is required to to cache updates.


Member Function Documentation

void LocationCache::add ( QString  mac,
QGeoCoordinate  pos 
)

DEPRECATED: Add a signle AP to the cache.

Parameters:
mac the AP's mac address
pos the position of the AP
void LocationCache::addCache ( QHash< QString, QGeoCoordinate >  newCache  )  [slot]

Slot called if WiGLE has downloaded and parsed the APs.

The cache is written to disk.

Parameters:
newCache is a QHash with the new APs' information
QGeoCoordinate LocationCache::getPos ( QList< QString >  macs  ) 

Get the mean position of a list of APs.

Parameters:
macs a list of AP MAC addresses
Returns:
the mean position, or 0.0,0.0 if no AP was is the cache
QGeoCoordinate LocationCache::getPos ( QString  mac  ) 

Lookup an APs position in the Cache.

Parameters:
mac is the APs MAC addres
Returns:
the APs position or 0.0,0.0 if it is not in the cache
void LocationCache::init (  ) 

Initialize AP Cache.

Reads previous cache information from file. If the file is empty it start a cache update.

void LocationCache::reset (  ) 

Reset Cache.

Clear the cache in memory, clean the cache file on disk

void LocationCache::setCacheRegion ( QGeoCoordinate  center  )  [slot]

Set the size of the cache region.

The region is 0.1 x 0.1 deg large and is center is given as paramter

Parameters:
center is the Center of the region
void LocationCache::updateCache (  ) 

Update Cache.

Check whteher the region is correctly set and get APs from WiGLE


The documentation for this class was generated from the following files:
Generated on Thu Jun 24 21:31:43 2010 for PrivL by  doxygen 1.6.3