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

SearchService object. More...

Inheritance diagram for gem::SearchService:
Collaboration diagram for gem::SearchService:

Public Member Functions

 SearchService (const SearchService &)=delete
 SearchService (SearchService &&)=default
 Default move constructor noexcept is deduced.
SearchService & operator= (const SearchService &)=delete
SearchService & operator= (SearchService &&ss)=default
 Default move assignment noexcept is deduced.
int search (LandmarkList &results, ProgressListener listener, const AddressInfo &addressInfo, const Coordinates &referenceCoordinates, const SearchPreferences &preferences=SearchPreferences(), const GeographicArea &locationHint=RectangleGeographicArea()) noexcept
 Search using address and geographic area as discriminants.
int search (LandmarkList &results, ProgressListener listener, const String &textFilter, const Coordinates &referenceCoordinates, const SearchPreferences &preferences=SearchPreferences(), const GeographicArea &locationHint=RectangleGeographicArea()) noexcept
 Search using text and geographic area as discriminants.
int searchAlongRoute (LandmarkList &results, ProgressListener listener, const Route &route, const String &textFilter=String(), const SearchPreferences &preferences=SearchPreferences()) noexcept
 Search for landmarks along the specified route.
int searchAlongPath (LandmarkList &results, ProgressListener listener, const Path &path, const String &textFilter=String(), const SearchPreferences &preferences=SearchPreferences()) noexcept
 Search for landmarks along the specified path.
int searchAroundPosition (LandmarkList &results, ProgressListener listener, const Coordinates &position, const String &textFilter=String(), const SearchPreferences &preferences=SearchPreferences()) noexcept
 Get list of landmarks for specific coordinates.
int searchInArea (LandmarkList &results, ProgressListener listener, const GeographicArea &area, const Coordinates &referenceCoordinates, const String &textFilter=String(), const SearchPreferences &preferences=SearchPreferences()) noexcept
 Get list of landmarks in the given geographic area.
int searchLandmarkDetails (ILandmarkList &results, ProgressListener listener) noexcept
 Get details for the given landmark list.
void cancelSearch (ProgressListener progressListener) noexcept
 Cancel specific request identified by the progress listener.
TransferStatisticsRef getTransferStatistics () const noexcept
 Get data transfer statistics for this service.

Detailed Description

SearchService object.

It provides the support for map search, landmark search, search along route, and search around position.

Implements share-read / write Api object over ISearchService.

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

Member Function Documentation

◆ cancelSearch()

void gem::SearchService::cancelSearch ( ProgressListener progressListener)
inlinenoexcept

Cancel specific request identified by the progress listener.

Parameters
[in]progressListenerThe progress listener associated with the request to be canceled

◆ getTransferStatistics()

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

Get data transfer statistics for this service.

Returns
The transfer statistics object

◆ operator=()

SearchService & gem::SearchService::operator= ( SearchService && ss)
default

Default move assignment noexcept is deduced.

Returns
reference to this SearchService
Parameters
ssSearchService

◆ search() [1/2]

int gem::SearchService::search ( LandmarkList & results,
ProgressListener listener,
const AddressInfo & addressInfo,
const Coordinates & referenceCoordinates,
const SearchPreferences & preferences = SearchPreferences(),
const GeographicArea & locationHint = RectangleGeographicArea() )
inlinenoexcept

Search using address and geographic area as discriminants.

Parameters
[in]resultsThe landmark list where to store the result.
[in]listenerThe listener for the operation.
[in]addressInfoThe searched address info.
[in]referenceCoordinatesResults will be relevant to this position.
[in]preferencesThe search preferences. Optional, if not defined the default preferences are used
[in]locationHintThe location hint. The search will be restricted to the provided geographic area. Optional.
Returns
KNoError if the search was successfully started
error::KInvalidInput if the search input is invalid, e.g. referenceCoordinates are invalids

If online search service is available and no restriction set via SdkSettings().getOnlineServiceRestriction( MapDataService ) == 0 ) and SearchPreferences::getSearchOnlyOnboard is false, the search is performed online

Possible error codes returned in IProgressListener::notifyComplete

Returns
KNoError if the search was successfully completed
error::KCancel if the search was canceled by the user
error::KNoMemory if the search engine couldn't allocate the necessary memory for the operation
error::KOperationTimeout if the search was executed on the online service and the operation took too much time to complete ( usually more than 1 min, depending on the server overload state )
error::KNetworkFailed if the search was executed on the online service and the operation failed due to bad network connection
error::KActivation if the SDK is offline and not activated or the application token is expired/not set

◆ search() [2/2]

int gem::SearchService::search ( LandmarkList & results,
ProgressListener listener,
const String & textFilter,
const Coordinates & referenceCoordinates,
const SearchPreferences & preferences = SearchPreferences(),
const GeographicArea & locationHint = RectangleGeographicArea() )
inlinenoexcept

Search using text and geographic area as discriminants.

Parameters
[out]resultslandmark list.
[in]listenerThe listener for the operation.
[in]textFilterThe text filter.
[in]referenceCoordinatesThe reference position. Results will be relevant to this position.
[in]preferencesThe search preferences. Optional, if not defined the default preferences are used.
[in]locationHintThe location hint. The search will be restricted to the provided geographic area. Optional.
Returns
KNoError if the search was successfully started
error::KInvalidInput if the search input is invalid, e.g. referenceCoordinates are invalids

If online search service is available and no restriction set via SdkSettings().getOnlineServiceRestriction( MapDataService ) == 0 ) and SearchPreferences::getSearchOnlyOnboard is false, the search is performed online

Possible error codes returned in IProgressListener::notifyComplete

Returns
KNoError if the search was successfully completed
error::KCancel if the search was canceled by the user
error::KNotFound if the search was performed offline due to missing connection and no offline maps were found on the client ( were to search in )
error::KNoMemory if the search engine couldn't allocate the necessary memory for the operation
error::KOperationTimeout if the search was executed on the online service and the operation took too much time to complete ( usually more than 1 min, depending on the server overload state )
error::KNetworkFailed if the search was executed on the online service and the operation failed due to bad network connection
error::KActivation if the SDK is offline and not activated or the application token is expired/not set

◆ searchAlongPath()

int gem::SearchService::searchAlongPath ( LandmarkList & results,
ProgressListener listener,
const Path & path,
const String & textFilter = String(),
const SearchPreferences & preferences = SearchPreferences() )
inlinenoexcept

Search for landmarks along the specified path.

Parameters
[in]resultsThe landmark list where to store the result.
[in]listenerThe listener for the operation.
[in]pathThe target path.
[in]textFilterThe text filter. Optional.
[in]preferencesThe search preferences. Optional, if not defined the default preferences are used.
Returns
KNoError if the search was successfully started
error::KInvalidInput if the search input is invalid, e.g. path is invalid

If online search service is available and no restriction set via SdkSettings().getOnlineServiceRestriction( MapDataService ) == 0 ) and SearchPreferences::getSearchOnlyOnboard is false, the search is performed online

Possible error codes returned in IProgressListener::notifyComplete

Returns
KNoError if the search was successfully completed
error::KCancel if the search was canceled by the user
error::KNoMemory if the search engine couldn't allocate the necessary memory for the operation
error::KOperationTimeout if the search was executed on the online service and the operation took too much time to complete ( usually more than 1 min, depending on the server overload state )
error::KNetworkFailed if the search was executed on the online service and the operation failed due to bad network connection
error::KActivation if the SDK is offline and not activated or the application token is expired/not set

◆ searchAlongRoute()

int gem::SearchService::searchAlongRoute ( LandmarkList & results,
ProgressListener listener,
const Route & route,
const String & textFilter = String(),
const SearchPreferences & preferences = SearchPreferences() )
inlinenoexcept

Search for landmarks along the specified route.

Parameters
[in]resultsThe landmark list where to store the result.
[in]listenerThe listener for the operation.
[in]routeThe target route.

If route.getRouteResultType() == ERouteResultType::RRT_Path, the search is performed along the route path

If route.getRouteResultType() == ERouteResultType::RRT_Range, the search is performed within the route range polygon

Parameters
[in]textFilterThe text filter. Optional.
[in]preferencesThe search preferences. Optional, if not defined the default preferences are used.
Returns
KNoError if the search was successfully started
error::KInvalidInput if the search input is invalid, e.g. route is invalid

If online search service is available and no restriction set via SdkSettings().getOnlineServiceRestriction( MapDataService ) == 0 ) and SearchPreferences::getSearchOnlyOnboard is false, the search is performed online

Possible error codes returned in IProgressListener::notifyComplete

Returns
KNoError if the search was successfully completed
error::KCancel if the search was canceled by the user
error::KNoMemory if the search engine couldn't allocate the necessary memory for the operation
error::KOperationTimeout if the search was executed on the online service and the operation took too much time to complete ( usually more than 1 min, depending on the server overload state )
error::KNetworkFailed if the search was executed on the online service and the operation failed due to bad network connection
error::KActivation if the SDK is offline and not activated or the application token is expired/not set

◆ searchAroundPosition()

int gem::SearchService::searchAroundPosition ( LandmarkList & results,
ProgressListener listener,
const Coordinates & position,
const String & textFilter = String(),
const SearchPreferences & preferences = SearchPreferences() )
inlinenoexcept

Get list of landmarks for specific coordinates.

Parameters
[in]resultsThe landmark list where to store the result.
[in]listenerThe listener for the operation.
[in]positionThe position.
[in]textFilterThe optional text filter. Optional.
[in]preferencesThe search preferences. Optional, if not defined the default preferences are used.
Returns
KNoError if the search was successfully started
error::KInvalidInput if the search input is invalid, e.g. referenceCoordinates are invalids

If online search service is available and no restriction set via SdkSettings().getOnlineServiceRestriction( MapDataService ) == 0 ) and SearchPreferences::getSearchOnlyOnboard is false, the search is performed online

Possible error codes returned in IProgressListener::notifyComplete

Returns
KNoError if the search was successfully completed
error::KCancel if the search was canceled by the user
error::KNoMemory if the search engine couldn't allocate the necessary memory for the operation
error::KOperationTimeout if the search was executed on the online service and the operation took too much time to complete ( usually more than 1 min, depending on the server overload state )
error::KNetworkFailed if the search was executed on the online service and the operation failed due to bad network connection
error::KActivation if the SDK is offline and not activated or the application token is expired/not set

◆ searchInArea()

int gem::SearchService::searchInArea ( LandmarkList & results,
ProgressListener listener,
const GeographicArea & area,
const Coordinates & referenceCoordinates,
const String & textFilter = String(),
const SearchPreferences & preferences = SearchPreferences() )
inlinenoexcept

Get list of landmarks in the given geographic area.

Parameters
[in]resultsThe landmark list where to store the result.
[in]listenerThe listener for the operation.
[in]areaThe search target area
[in]referenceCoordinatesThe reference position. Results will be relevant to this position.
[in]textFilterThe optional text filter. Optional.
[in]preferencesThe search preferences. Optional, if not defined the default preferences are used.
Returns
KNoError if the search was successfully started
error::KInvalidInput if the search input is invalid, e.g. referenceCoordinates are invalids

If online search service is available and no restriction set via SdkSettings().getOnlineServiceRestriction( MapDataService ) == 0 ) and SearchPreferences::getSearchOnlyOnboard is false, the search is performed online

Possible error codes returned in IProgressListener::notifyComplete

Returns
KNoError if the search was successfully completed
error::KCancel if the search was canceled by the user
error::KNoMemory if the search engine couldn't allocate the necessary memory for the operation
error::KOperationTimeout if the search was executed on the online service and the operation took too much time to complete ( usually more than 1 min, depending on the server overload state )
error::KNetworkFailed if the search was executed on the online service and the operation failed due to bad network connection
error::KActivation if the SDK is offline and not activated or the application token is expired/not set

◆ searchLandmarkDetails()

int gem::SearchService::searchLandmarkDetails ( ILandmarkList & results,
ProgressListener listener )
inlinenoexcept

Get details for the given landmark list.

Parameters
[in]resultsThe landmark list to be populated with details
[in]listenerThe listener for the operation.

If the landmarks in the list already have the details populated, the function will return error::KUpToDate

Returns
KNoError if the search was successfully started
error::KInvalidInput if the search input is invalid

If online search service is available and no restriction set via SdkSettings().getOnlineServiceRestriction( MapDataService ) == 0 ) and SearchPreferences::getSearchOnlyOnboard is false, the search is performed online

Possible error codes returned in IProgressListener::notifyComplete

Returns
KNoError if the search was successfully completed
error::KCancel if the search was canceled by the user
error::KNoMemory if the search engine couldn't allocate the necessary memory for the operation
error::KOperationTimeout if the search was executed on the online service and the operation took too much time to complete ( usually more than 1 min, depending on the server overload state )
error::KNetworkFailed if the search was executed on the online service and the operation failed due to bad network connection