Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::Geofence Class Reference

Geofence object. More...

Inheritance diagram for gem::Geofence:
Collaboration diagram for gem::Geofence:

Public Member Functions

 Geofence (const Geofence &)=delete
 Geofence (Geofence &&)=default
 Default move constructor noexcept is deduced.
Geofence & operator= (const Geofence &)=delete
Geofence & operator= (Geofence &&navService)=default
 Default move assignment noexcept is deduced.
int addArea (const GeographicArea &area, const String &id, const ParameterList &meta, ProgressListener listener) noexcept
 Add a geographic area to the geofence.
int addAreas (const GeofenceAreaList &areas, ProgressListener listener) noexcept
 Add list of geographic areas to the geofence.
int getAreas (GeofenceAreaList &areas, const StringList &ids, ProgressListener listener, const ParameterList &meta={}) noexcept
 Get the geographic areas list filtered by id and meta data.
int removeAreas (const StringList &ids, ProgressListener listener, const ParameterList &meta={}) noexcept
 Remove a geographic area, identified by id, from the geofence.
int getProximityAreas (GeofenceProximityAreaList &proxAreas, const Coordinates &coords, int radius, ProgressListener listener, int details=0) noexcept
 Get geofence proximity areas for the given coordinates & radius.
void cancel (ProgressListener listener) noexcept
 Cancel an asynchronous operation.
int startMonitoring (GeofenceListener listener, const StringList &ids=StringList()) noexcept
 Start the monitoring for the given areas.
int startMonitoring (GeofenceListener listener, LargeInteger userId) noexcept
 Start the monitoring for the given user.
int stopMonitoring (GeofenceListener listener) noexcept
 Stop the monitoring for the given areas.

Detailed Description

Geofence object.

Implements share-read / write Api object over IGeofence.

This behaves like a singleton, i.e. all instances are shared behind the same API interface

Member Function Documentation

◆ addArea()

int gem::Geofence::addArea ( const GeographicArea & area,
const String & id,
const ParameterList & meta,
ProgressListener listener )
inlinenoexcept

Add a geographic area to the geofence.

Parameters
[in]areaThe geographic area to be monitored
[in]idThe area unique identifier. Must be unique in the geofence areas collection
[in]metaA list of parameters which compose the metadata.
[in]listenerThe operation progress listener
Returns
The operation error code

◆ addAreas()

int gem::Geofence::addAreas ( const GeofenceAreaList & areas,
ProgressListener listener )
inlinenoexcept

Add list of geographic areas to the geofence.

Parameters
[in]areasThe geofence area list to be monitored
[in]listenerThe operation progress listener
Returns
The operation error code

◆ cancel()

void gem::Geofence::cancel ( ProgressListener listener)
inlinenoexcept

Cancel an asynchronous operation.

Parameters
[in]listenerThe observer used to start the operation

◆ getAreas()

int gem::Geofence::getAreas ( GeofenceAreaList & areas,
const StringList & ids,
ProgressListener listener,
const ParameterList & meta = {} )
inlinenoexcept

Get the geographic areas list filtered by id and meta data.

Parameters
[in]areasThe areas list result, will be fully populated on IProgressListener::notifyComplete
[in]listenerThe operation progress listener
[in]idsThe unique identifiers of the areas to filter. If empty, no ids filter is applied
[in]metaThe meta data to filter the search.

A result will match if filter meta data key = geofence meta data key and filter meta data value = geofence meta data value

If empty, no meta data filter is applied

Returns
The operation error code

◆ getProximityAreas()

int gem::Geofence::getProximityAreas ( GeofenceProximityAreaList & proxAreas,
const Coordinates & coords,
int radius,
ProgressListener listener,
int details = 0 )
inlinenoexcept

Get geofence proximity areas for the given coordinates & radius.

Parameters
[in]proxAreasThe proximity areas list result, will be fully populated on IProgressListener::notifyComplete
[in]coordsThe coordinates reference for search
[in]radiusThe search radius around the reference coordinates
[in]listenerThe operation progress listener
[in]detailsThe GeofenceArea result details. A combination of ProximityAreaDetails options, default = 0 meaning only GeofenceArea::id will be available in the result
Returns
The operation error code

◆ operator=()

Geofence & gem::Geofence::operator= ( Geofence && navService)
default

Default move assignment noexcept is deduced.

Returns
A reference to this object
Parameters
[in]navServiceThe object to be moved

◆ removeAreas()

int gem::Geofence::removeAreas ( const StringList & ids,
ProgressListener listener,
const ParameterList & meta = {} )
inlinenoexcept

Remove a geographic area, identified by id, from the geofence.

Parameters
[in]idsThe areas unique identifiers. If empty, all areas will be delete from the geofence
[in]listenerThe operation progress listener
[in]metaThe meta data to filter the search.
Returns
The operation error code

◆ startMonitoring() [1/2]

int gem::Geofence::startMonitoring ( GeofenceListener listener,
const StringList & ids = StringList() )
inlinenoexcept

Start the monitoring for the given areas.

Parameters
[in]listenerThe geofence type listener which will receive the monitor events
[in]idsThe monitored area ids list. If empty, the listener will monitor all geofence areas

If the listener is already monitoring, the monitored filters will be updated

Returns
The operation error code

◆ startMonitoring() [2/2]

int gem::Geofence::startMonitoring ( GeofenceListener listener,
LargeInteger userId )
inlinenoexcept

Start the monitoring for the given user.

Parameters
[in]listenerThe geofence type listener which will receive the monitor events
[in]userIdThe monitored user id

If the listener is already monitoring, the monitored filters will be updated

Returns
The operation error code

◆ stopMonitoring()

int gem::Geofence::stopMonitoring ( GeofenceListener listener)
inlinenoexcept

Stop the monitoring for the given areas.

Parameters
[in]listenerThe geofence listener for which to stop the monitoring
Returns
The operation error code