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

SocialOverlay object. More...

Inheritance diagram for gem::SocialOverlay:
Collaboration diagram for gem::SocialOverlay:

Public Member Functions

 SocialOverlay (const SocialOverlay &)=delete
 SocialOverlay (SocialOverlay &&social)=default
 Default move constructor noexcept is deduced.
SocialOverlay & operator= (const SocialOverlay &)=delete
SocialOverlay & operator= (SocialOverlay &&social)=default
 Default move assignment noexcept is deduced.
const SocialReportsOverlayInfoRef getReportsOverlayInfo () const noexcept
 Get social reports overlay info.
const SocialLabelsOverlayInfoRef getLabelsOverlayInfo () const noexcept
 Get social labels overlay info.
int prepareReporting (const Coordinates &coords, int categId=0) noexcept
 Prepare reporting.
int prepareReporting (sense::DataSourcePtr positionSource=PositionService().getDataSource(), int categId=0) noexcept
 Prepare reporting.
int report (int prepareId, int categId, const String &description, const Image &snapshot, const ParameterList &params, ProgressListener listener) noexcept
 Report an social event.
int confirmReport (const OverlayItem &item, ProgressListener listener) noexcept
 Confirm an existing report as in effect.
int denyReport (const OverlayItem &item, ProgressListener listener) noexcept
 Denied an existing report as not in effect anymore.
int updateReport (const OverlayItem &item, const ParameterList &params, ProgressListener listener) noexcept
 Update an existing report parameters.
int deleteReport (const OverlayItem &item, ProgressListener listener) noexcept
 Delete an owned report.
int addComment (const OverlayItem &item, const String &comment, ProgressListener listener)
 Add a comment to report.
int getReportSnapshot (const OverlayItem &item, Image &image, ProgressListener listener) noexcept
 Get report snapshot.
int registerReportListener (const OverlayItem &report, SocialReportListener listener) noexcept
 Register the given listener for the given report item.
int unregisterReportListener (const OverlayItem &report, SocialReportListener listener) noexcept
 Unregister the given listener for the given report item.
void registerOverlayItemListener (const OverlayItem &overlayItem, SocialReportListener listener) noexcept
void unregisterOverlayItemListener (const OverlayItem &overlayItem, SocialReportListener listener) noexcept
int addLabel (OverlayItem *result, const Coordinates &coords, const String &image, const String &name, const DataBuffer &details, int validitySec, ProgressListener listener, int labelCategoryId=-1) noexcept
 Add a social label.
int collectLabel (const Coordinates &coords, const String &image, const String &name, const DataBuffer &details, int validitySec, int labelCategoryId=-1) noexcept
 Collect a social label without confirmation ( the operation is not guaranteed to complete successfully ).
int deleteLabel (LargeInteger id, ProgressListener listener, int labelCategoryId=-1) noexcept
 Delete a label by id.
int deleteLabel (const DataBuffer &details, ProgressListener listener, int labelCategoryId=-1) noexcept
 Delete one or more labels by user details.
int registerLabelsListener (SocialLabelListener listener, int labelCategoryId=-1) noexcept
 Register the label overlay listener.
void cancel (ProgressListener listener) noexcept
 Cancel the operation identified by progress listener.
TransferStatisticsRef getTransferStatistics () const noexcept
 Get data transfer statistics for this service.
String dumpLocalCache () noexcept
 DEBUG.
String executeLocalCacheSQL (const String &sql) noexcept
 Execute SQL on local cache data.

Detailed Description

SocialOverlay object.

Implements share-read / write Api object over ISocialOverlay.

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

Constructor & Destructor Documentation

◆ SocialOverlay()

gem::SocialOverlay::SocialOverlay ( SocialOverlay && social)
default

Default move constructor noexcept is deduced.

Parameters
[in]socialThe object to move

Member Function Documentation

◆ addComment()

int gem::SocialOverlay::addComment ( const OverlayItem & item,
const String & comment,
ProgressListener listener )
inline

Add a comment to report.

Parameters
[in]itemThe report overlay item
[in]commentThe comment text
[in]listenerOperation progress listener
Returns
The operation error code

error::KInvalidInput - invalid item ( not a social report overlay item )

error::KConnectionRequired - no internet connection available

error::KBusy - another add comment operation is in progress

◆ addLabel()

int gem::SocialOverlay::addLabel ( OverlayItem * result,
const Coordinates & coords,
const String & image,
const String & name,
const DataBuffer & details,
int validitySec,
ProgressListener listener,
int labelCategoryId = -1 )
inlinenoexcept

Add a social label.

Parameters
[in]resultThe optional overlay item containing new label data after oprtaion succesfully completes
[in]coordsThe label coordinates
[in]imageThe label image id ( API user identifier ). SDK will call back the API user for an image via ISocialLabelListener::getLabelIcon
[in]nameThe label name
[in]detailsThe label details ( API user own format / data )
[in]validitySecThe label validity in seconds. 0 means never expires
[in]listenerOperation listener
[in]labelCategoryIdLabel category id where to add. -1 means default label category ( if only one label category exists )
Returns
The operation error code

◆ cancel()

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

Cancel the operation identified by progress listener.

Parameters
[in]listenerThe operation progress listener

◆ collectLabel()

int gem::SocialOverlay::collectLabel ( const Coordinates & coords,
const String & image,
const String & name,
const DataBuffer & details,
int validitySec,
int labelCategoryId = -1 )
inlinenoexcept

Collect a social label without confirmation ( the operation is not guaranteed to complete successfully ).

Parameters
[in]coordsThe label coordinates
[in]imageThe label image id ( API user identifier ). SDK will call back the API user for an image via ISocialLabelListener::getLabelIcon
[in]nameThe label name
[in]detailsThe label details ( API user own format / data )
[in]validitySecThe label validity in seconds. 0 means never expires
[in]labelCategoryIdLabel category id where to add. -1 means default label category ( if only one label category exists )
Returns
The operation error code

◆ confirmReport()

int gem::SocialOverlay::confirmReport ( const OverlayItem & item,
ProgressListener listener )
inlinenoexcept

Confirm an existing report as in effect.

Parameters
[in]itemThe report overlay item
[in]listenerOperation progress listener
Returns
The operation error code

error::KInvalidInput - invalid item ( not a social report overlay item ) or item is not a result of alarm notification

error::KAccessDenied - already confirmed or denied

error::KScheduled - operation will proceed later, when internet connection is available. Not an error

◆ deleteLabel() [1/2]

int gem::SocialOverlay::deleteLabel ( const DataBuffer & details,
ProgressListener listener,
int labelCategoryId = -1 )
inlinenoexcept

Delete one or more labels by user details.

Parameters
[in]detailsThe label details ( API user own format / data )
[in]listenerOperation listener
[in]labelCategoryIdLabel category id where to add. -1 means default label category ( if only one label category exists )
Returns
The operation error code

◆ deleteLabel() [2/2]

int gem::SocialOverlay::deleteLabel ( LargeInteger id,
ProgressListener listener,
int labelCategoryId = -1 )
inlinenoexcept

Delete a label by id.

Parameters
[in]idThe label overlay id
[in]listenerOperation listener
[in]labelCategoryIdLabel category id where to add. -1 means default label category ( if only one label category exists )
Returns
The operation error code

◆ deleteReport()

int gem::SocialOverlay::deleteReport ( const OverlayItem & item,
ProgressListener listener )
inlinenoexcept

Delete an owned report.

Parameters
[in]itemThe report overlay item
[in]listenerOperation progress listener
Returns
The operation error code

error::KInvalidInput - invalid item ( not a social report overlay item )

error::KAccessDenied - not an owned report

error::KScheduled - operation will proceed later, when internet connection is available. Not an error

◆ denyReport()

int gem::SocialOverlay::denyReport ( const OverlayItem & item,
ProgressListener listener )
inlinenoexcept

Denied an existing report as not in effect anymore.

Parameters
[in]itemThe report overlay item
[in]listenerOperation progress listener
Returns
The operation error code

error::KInvalidInput - invalid item ( not a social report overlay item ) or item is not a result of alarm notification

error::KAccessDenied - already confirmed or denied

error::KScheduled - operation will proceed later, when internet connection is available. Not an error

◆ dumpLocalCache()

String gem::SocialOverlay::dumpLocalCache ( )
inlinenoexcept

DEBUG.

Dump local cache as text data

Returns
The dump text

◆ executeLocalCacheSQL()

String gem::SocialOverlay::executeLocalCacheSQL ( const String & sql)
inlinenoexcept

Execute SQL on local cache data.

Parameters
[in]sqlThe SQL command
Returns
The SQL result

◆ getLabelsOverlayInfo()

const SocialLabelsOverlayInfoRef gem::SocialOverlay::getLabelsOverlayInfo ( ) const
inlinenoexcept

Get social labels overlay info.

Returns
The labels overlay info

◆ getReportSnapshot()

int gem::SocialOverlay::getReportSnapshot ( const OverlayItem & item,
Image & image,
ProgressListener listener )
inlinenoexcept

Get report snapshot.

Parameters
[in]itemThe report overlay item
[out]imageThe image where the snapshot will be stored
[in]listenerOperation progress listener
Returns
The operation error code

error::KInvalidInput - invalid item ( not a social report overlay item )

error::KConnectionRequired - no internet connection available

◆ getReportsOverlayInfo()

const SocialReportsOverlayInfoRef gem::SocialOverlay::getReportsOverlayInfo ( ) const
inlinenoexcept

Get social reports overlay info.

Returns
The reports overlay info

◆ getTransferStatistics()

TransferStatisticsRef gem::SocialOverlay::getTransferStatistics ( ) const
inlinenoexcept

Get data transfer statistics for this service.

Returns
The transfer statistics

◆ operator=()

SocialOverlay & gem::SocialOverlay::operator= ( SocialOverlay && social)
default

Default move assignment noexcept is deduced.

Parameters
[in]socialThe object to move
Returns
The moved object

◆ prepareReporting() [1/2]

int gem::SocialOverlay::prepareReporting ( const Coordinates & coords,
int categId = 0 )
inlinenoexcept

Prepare reporting.

Parameters
[in]coordsReport coordinates.
[in]categIdReport category id, default = 0. If != 0, a dry run test is performed to check if the given category id can be reported
Returns
If in dry run mode ( category id != 0 ), will check if reporting is possible and return the error code:

error::KSuspended - report rate limit exceeded

error::KInvalidInput - categId id not a valid social report category id

error::KAccessDenied - social report overlay category doesn't allow custom coordinates reporting, call prepareReporting with sense::DataSourcePtr instead

Returns
If in preparing mode ( category id = 0 ):

error::KSuspended - report rate limit exceeded

value > 0 - the prepared operation id

◆ prepareReporting() [2/2]

int gem::SocialOverlay::prepareReporting ( sense::DataSourcePtr positionSource = PositionService().getDataSource(),
int categId = 0 )
inlinenoexcept

Prepare reporting.

Parameters
[in]positionSourceThe sense::IDataSource ref from which the report position is set. Default is the current position service data source
[in]categIdReport category id, default = 0. If != 0, a dry run test is performed to check if the given category id can be reported
Returns
If in dry run mode ( category id != 0 ), will check if reporting is possible and return the error code:

error::KSuspended - report rate limit exceeded

error::KInvalidInput - categId id not a valid social report category id

error::KNotFound - no valid data source position for reporting

error::KRequired - no valid data source type for reporting, must be EDataSourceType::Live

Returns
If in preparing mode ( category id = 0 ):

error::KSuspended - report rate limit exceeded

error::KNotFound - invalid data source position for reporting

value > 0 - the prepared operation id

◆ registerLabelsListener()

int gem::SocialOverlay::registerLabelsListener ( SocialLabelListener listener,
int labelCategoryId = -1 )
inlinenoexcept

Register the label overlay listener.

Parameters
[in]listenerThe label listener
[in]labelCategoryIdThe label category id for which teh listener is registered. -1 means default label category ( if only one label category exists )
Returns
The operation error code

◆ registerOverlayItemListener()

void gem::SocialOverlay::registerOverlayItemListener ( const OverlayItem & overlayItem,
SocialReportListener listener )
inlinenoexcept
Deprecated
Use registerReportListener instead
Parameters
overlayItemThe overlay item
listenerThe listener

◆ registerReportListener()

int gem::SocialOverlay::registerReportListener ( const OverlayItem & report,
SocialReportListener listener )
inlinenoexcept

Register the given listener for the given report item.

Parameters
[in]reportThe report item
[in]listenerThe listener
Returns
The operation error code.

error::KInvalidInput if report doesn't belong to OID_SocialReports overlay

error::KExist if listener is already registered for the report

◆ report()

int gem::SocialOverlay::report ( int prepareId,
int categId,
const String & description,
const Image & snapshot,
const ParameterList & params,
ProgressListener listener )
inlinenoexcept

Report an social event.

Parameters
[in]prepareIdPrepare operation id ( returned by a call to prepareReporting )
[in]categIdThe report category id
[in]descriptionThe report description text ( optional )
[in]snapshotThe report snapshot ( optional )
[in]paramsThe report parameters ( optional ). They must follow the structure returned by SocialReportsOverlayCategory::getParameters().find<SearchableParameterList>( kKeyVals )
[in]listenerOperation progress listener
Returns
The operation error code

error::KInvalidInput - categId is not a valid social report category id / params are ill-formed / snapshot is an invalid image

error::KSuspended - report rate limit exceeded

error::KExpired - prepared report id not found or is expired ( too old )

error::KNotFound - no accurate sense data source position to complete

error::KScheduled - operation will proceed later, when internet connection is available. Not an error

◆ unregisterOverlayItemListener()

void gem::SocialOverlay::unregisterOverlayItemListener ( const OverlayItem & overlayItem,
SocialReportListener listener )
inlinenoexcept
Deprecated
Use unregisterReportListener instead
Parameters
overlayItemThe overlay item
listenerThe listener

◆ unregisterReportListener()

int gem::SocialOverlay::unregisterReportListener ( const OverlayItem & report,
SocialReportListener listener )
inlinenoexcept

Unregister the given listener for the given report item.

Parameters
[in]reportThe report item
[in]listenerThe listener
Returns
The operation error code.

error::KInvalidInput if report doesn't belong to OID_SocialReports overlay

error::KNotFound if report doesn't have the listener registered to it

◆ updateReport()

int gem::SocialOverlay::updateReport ( const OverlayItem & item,
const ParameterList & params,
ProgressListener listener )
inlinenoexcept

Update an existing report parameters.

Parameters
[in]itemThe report overlay item
[in]paramsReport parameters ( optional ). They must follow the structure returned by SocialReportsOverlayCategory::getParameters().find<SearchableParameterList>( kKeyVals )
[in]listenerOperation progress listener
Returns
The operation error code

error::KInvalidInput - invalid item ( not a social report overlay item ) / params are ill-formed

error::KScheduled - operation will proceed later, when internet connection is available. Not an error