All Classes Functions Variables Typedefs Friends Pages
Public Member Functions | List of all members
Glympse::IProximityProvider Struct Referenceabstract

The IProximityProvider provides standard interface for geo-fencing. More...

#include <IProximityProvider.h>

Inheritance diagram for Glympse::IProximityProvider:
Inheritance graph
[legend]

Public Member Functions

virtual void setProximityListener (const GProximityListener &proximityListener)=0
 Attaches proximity listener to the provider.
 
virtual void startMonitoring (const GRegion &region)=0
 Starts monitoring the region. More...
 
virtual void startMonitoring (const GArray< GRegion >::ptr &regions)=0
 Starts monitoring the list of regions.
 
virtual void stopMonitoring (const GRegion &region)=0
 Stops monitoring the region.
 
virtual void locationChanged (const GLocation &location)=0
 This method is called, when location manager is notified on new location point by location provider. More...
 
virtual GArray< GRegion >::ptr detachRegions ()=0
 Stops monitoring all regions and returns the list. More...
 
- Public Member Functions inherited from Glympse::ICommon
virtual int32 retain ()=0
 Add a reference to our object in a COM-like way.
 
virtual int32 release ()=0
 Release a reference to our object in a COM-like way.
 
virtual int32 hold ()=0
 Add a reference to our object in a COM-like way.
 
virtual int32 unhold ()=0
 Release a reference to our object in a COM-like way.
 
virtual int32 hashCode ()=0
 Returns an integer hash code for this object.
 
virtual bool equals (const GCommonObj &o)=0
 Compares this instance with the specified object and indicates if they are equal. More...
 
virtual GString toString ()=0
 Returns a string containing a concise, human-readable description of this object. More...
 
virtual void attachObject (const GCommon &obj)=0
 Asociates arbitrary object with the instance.
 
virtual GCommon extractObject ()=0
 Extracts associated object or NULL if no association is established.
 

Additional Inherited Members

- Protected Member Functions inherited from Glympse::ICommon
virtual ~ICommon ()
 Destructor is protected to deny explicit object deallocation. More...
 

Detailed Description

The IProximityProvider provides standard interface for geo-fencing.

The following scenarios are supported:

Proximity provider never stops monitoring regions automatically after delivering notification. Host application is always responsible for registering and unregistering geofences.

Here is how to set external provider. It is only allowed to call IGlympse::getLocationManager() method after starting the platform (by calling IGlympse::start()).

GGlympse glympse = ...;
glympse->start();
glympse->getLocationManager()->setProximityProvider(new CustomProximityProvider());

Member Function Documentation

virtual GArray<GRegion>::ptr Glympse::IProximityProvider::detachRegions ( )
pure virtual

Stops monitoring all regions and returns the list.

Returns
The list of regions monitored by the provider.
virtual void Glympse::IProximityProvider::locationChanged ( const GLocation location)
pure virtual

This method is called, when location manager is notified on new location point by location provider.

Note
This mechanizm should not be treated as trusted, as location manager propagates location updates to proximity provider only, when location provider is started (which is often related to the presence of active outgoing tickets). Proximity provider should rely on another source of location data or consume OS API, if geo-fencing functionality is required, while location manager is stopped.
Parameters
locationNew location object.
virtual void Glympse::IProximityProvider::startMonitoring ( const GRegion region)
pure virtual

Starts monitoring the region.

Note
Some provider implementations require unique identifier to be associated with the region to be able to identify it accross application sessions. IRegion::getId() is provided for this purpose. Make sure that this ID is unique during the entire application lifetime and does not overlap with other regions registered for monitoring.
Parameters
regionRegion object to start monitoring.

The documentation for this struct was generated from the following file: