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

RoutingService object. More...

Inheritance diagram for gem::RoutingService:
Collaboration diagram for gem::RoutingService:

Public Member Functions

 RoutingService ()=default
 default constructor
 RoutingService (const RoutingService &routingService)=delete
 Default copy constructor.
 RoutingService (RoutingService &&routingService)=default
 Default move constructor noexcept is deduced.
RoutingServiceoperator= (const RoutingService &routingService)=delete
 Default copy assignment.
RoutingServiceoperator= (RoutingService &&routingService)=default
 Default move assignment noexcept is deduced.
int calculateRoute (RouteList &possibleRoutes, LandmarkList const &waypoints, RoutePreferences const &routePreferences, ProgressListener progressListener)
 Calculate a route between the specified waypoints.
void cancelRoute (ProgressListener progressListener) noexcept
 Cancel the route calculation associated with the specified listener.
bool isCalculationRunning (ProgressListener progressListener) noexcept
 Check if there is route calculation in progress associated with the specified listener.
int setRouteRoadBlock (RouteInstructionBase const &instruction)
 Set a user road block from the provided route instruction.
void resetRouteRoadBlocks () noexcept
 Reset the user road blocks.
ERouteStatus getRouteStatus (ProgressListener listener) const noexcept
 Get the status for the route monitored by the given listener.
EVCarModelList getEVCarModels () const noexcept
 Get the available EV car models list.
std::pair< EVCarModel, int > getEVCarModel (int id) const noexcept
 Get the EV car models by id.
TransferStatisticsRef getTransferStatistics () const noexcept
 Get data transfer statistics for this service.

Detailed Description

RoutingService object.

It provides the support for route calculation.

To access the route calculation service we need to first create a session to it. This can be done using the default constructor. The method calculateRoute() can be used to initiate a route calculation.
The list of waypoints, route calculation preferences and the progress events listener are required to start the operation. The preferences for route calculation include route type, transport mode and avoid specific road types. One route is made of one or more route segments. One route segment is the path between two consecutive waypoints. If the route has only two waypoints then the route will have only one route segment.
Each route segment contains one or more route instructions that guide the user from the first waypoint to the second. One route instruction contains information about the turn to be taken, the road to follow, available signpost and lane information, traffic events that affect the route, etc.

Implements share-read / write Api object over IRoutingService.

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

Constructor & Destructor Documentation

◆ RoutingService() [1/2]

gem::RoutingService::RoutingService ( const RoutingService & routingService)
delete

Default copy constructor.

Parameters
[in]routingServiceThe RoutingService object to be copied.

◆ RoutingService() [2/2]

gem::RoutingService::RoutingService ( RoutingService && routingService)
default

Default move constructor noexcept is deduced.

Parameters
[in]routingServiceThe RoutingService object to be moved.

Member Function Documentation

◆ calculateRoute()

int gem::RoutingService::calculateRoute ( RouteList & possibleRoutes,
LandmarkList const & waypoints,
RoutePreferences const & routePreferences,
ProgressListener progressListener )
inline

Calculate a route between the specified waypoints.

Parameters
[in,out]possibleRoutesThe list of possible routes between the specified waypoints
[in]waypointsThe list of waypoints for the route.
[in]routePreferencesThe preferences for the route calculation.
[in]progressListenerThe listener for the route calculation progress notifications.
Returns
KNoError if the route calculation was successfully started
error::KNotSupported if the provided routing preferences contains an unsupported configuration
error::KInvalidInput if the calculation input contains invalid data, e.g. waypoints.size() < 2 for path result or waypoints.size() < 1 for range result type

Possible error codes returned in IProgressListener::notifyComplete

Returns
KNoError if the route calculation was successfully completed
error::KCancel if the route calculation was canceled by the user
error::KWaypointAccess if a route couldn't be find using the provided routing preferences
error::KConnectionRequired if the routing preferences getAllowOnlineCalculation() = false and the calculation cannot be done on client side due to missing necessary data
error::KExpired if the calculation cannot be done on client side due to missing necessary data and the client world map data version is no longer supported by the online routing service
error::KRouteTooLong if the routing 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::KInvalidated if the offline map data changed ( offline map downloaded, erased, updated ) during the calculation
error::KNoMemory if the routing engine couldn't allocate the necessary memory for the calculation
error::KMissingCapability if the current map version is missing some capabilities required for the calculation

◆ cancelRoute()

void gem::RoutingService::cancelRoute ( ProgressListener progressListener)
inlinenoexcept

Cancel the route calculation associated with the specified listener.

Parameters
[in]progressListenerThe listener associated with the route calculation to be canceled.

◆ getEVCarModel()

std::pair< EVCarModel, int > gem::RoutingService::getEVCarModel ( int id) const
inlinenoexcept

Get the EV car models by id.

Parameters
[in]idThe id of the EV car model
Returns
The EV car model and error code

◆ getEVCarModels()

EVCarModelList gem::RoutingService::getEVCarModels ( ) const
inlinenoexcept

Get the available EV car models list.

Returns
The list of available EV car models

◆ getRouteStatus()

ERouteStatus gem::RoutingService::getRouteStatus ( ProgressListener listener) const
inlinenoexcept

Get the status for the route monitored by the given listener.

Parameters
[in]listenerThe listener monitoring the route
Returns
The status of the route calculation

◆ getTransferStatistics()

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

Get data transfer statistics for this service.

Returns
The transfer statistics object.

◆ isCalculationRunning()

bool gem::RoutingService::isCalculationRunning ( ProgressListener progressListener)
inlinenoexcept

Check if there is route calculation in progress associated with the specified listener.

Parameters
[in]progressListenerThe listener associated with the route calculation.
Returns
True if the route calculation is in progress, false otherwise.

◆ operator=() [1/2]

RoutingService & gem::RoutingService::operator= ( const RoutingService & routingService)
delete

Default copy assignment.

Parameters
[in]routingServiceThe RoutingService object to be copied.
Returns
The RoutingService object.

◆ operator=() [2/2]

RoutingService & gem::RoutingService::operator= ( RoutingService && routingService)
default

Default move assignment noexcept is deduced.

Parameters
[in]routingServiceThe RoutingService object to be moved.
Returns
The RoutingService object.

◆ resetRouteRoadBlocks()

void gem::RoutingService::resetRouteRoadBlocks ( )
inlinenoexcept

Reset the user road blocks.

This will remove all the user road blocks set by the user.

◆ setRouteRoadBlock()

int gem::RoutingService::setRouteRoadBlock ( RouteInstructionBase const & instruction)
inline

Set a user road block from the provided route instruction.

Parameters
[in]instructionThe route instruction containing the road block information.
Returns
0 if the road block was successfully set.