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

VRP Service. More...

Inheritance diagram for gem::vrp::Service:
Collaboration diagram for gem::vrp::Service:

Public Member Functions

 Service (const Service &)=delete
 Service (Service &&)=default
 Default move constructor noexcept is deduced.
Service & operator= (const Service &)=delete
 Default copy assignment operator.
Service & operator= (Service &&)=default
 Default move assignment operator.
int getRequests (ProgressListener listener, RequestList &requests) noexcept
 Async returns all un-finished requests.
int getRequest (ProgressListener listener, Request &request, LargeInteger requestId) noexcept
 Async returns the request with the requestId.
int cancelRequest (ProgressListener listener, LargeInteger requestId) noexcept
 Async cancels a request.
int addCustomer (ProgressListener listener, Customer &customer) noexcept
 Async saves a customer.
int getCustomers (ProgressListener listener, CustomerList &customers, const String &searchTerm=String()) noexcept
 Async returns all customers.
int getCustomer (ProgressListener listener, Customer &customer, LargeInteger customerId) noexcept
 Async returns customer with the customerId.
int updateCustomer (ProgressListener listener, const Customer &customer) noexcept
 Async saves the updates made to a customer.
int deleteCustomer (ProgressListener listener, const LargeIntList &customersIds) noexcept
 Async removes customers.
int deleteCustomer (ProgressListener listener, Customer &customer) noexcept
 Async removes a customer.
int getCustomerOrdersHistory (ProgressListener listener, CustomerOrderList &history, const Customer &customer) noexcept
 Async returns each order made by the customer and the ids of the optimizations and routes where it was assigned.
int addMiscLocation (ProgressListener listener, MiscLocation &miscLocation) noexcept
 Async saves a miscLocation.
int getMiscLocations (ProgressListener listener, MiscLocationList &miscLocations, const String &searchTerm=String()) noexcept
 Async returns all miscLocations.
int getMiscLocation (ProgressListener listener, MiscLocation &miscLocation, LargeInteger miscLocationId) noexcept
 Async returns miscLocation with the miscLocationId.
int updateMiscLocation (ProgressListener listener, const MiscLocation &miscLocation) noexcept
 Async saves the updates made to a miscLocation.
int deleteMiscLocation (ProgressListener listener, const LargeIntList &miscLocationsIds) noexcept
 Async removes miscLocations.
int deleteMiscLocation (ProgressListener listener, MiscLocation &miscLocation) noexcept
 Async removes a miscLocation.
int addOrder (ProgressListener listener, Order &order, bool autoAssignDepot) noexcept
 Async saves an order.
int getOrders (ProgressListener listener, OrderList &orders, const String &searchTerm=String()) noexcept
 Async returns all the orders.
int getOrder (ProgressListener listener, Order &order, LargeInteger orderId) noexcept
 Async returns order with the orderId.
int updateOrder (ProgressListener listener, Order &order, bool autoAssignDepot) noexcept
 Async saves the updates made to an order.
int deleteOrder (ProgressListener listener, const LargeIntList &ordersIds) noexcept
 Async removes orders.
int deleteOrder (ProgressListener listener, Order &order) noexcept
 Async removes an order.
int addVehicle (ProgressListener listener, Vehicle &vehicle) noexcept
 Async adds a vehicle in the list of vehicles of the API user.
int getVehicles (ProgressListener listener, VehicleList &list, const String &searchTerm=String()) noexcept
 Async returns all the vehicles of the API user.
int getVehicle (ProgressListener listener, Vehicle &vehicle, LargeInteger vehicleId) noexcept
 Async returns a vehicle.
int updateVehicle (ProgressListener listener, const Vehicle &vehicle) noexcept
 Async saves the updates made to a vehicle.
int deleteVehicle (ProgressListener listener, const LargeIntList &vehiclesIds) noexcept
 Async removes vehicles.
int deleteVehicle (ProgressListener listener, Vehicle &vehicle) noexcept
 Async removes a vehicle.
int addTerritory (ProgressListener listener, Territory &territory) noexcept
 Async adds a territory in the list of territories of the API user.
int getTerritories (ProgressListener listener, TerritoryList &list, const String &searchTerm=String()) noexcept
 Async returns all the territories of the API user.
int getTerritory (ProgressListener listener, Territory &territory, LargeInteger territoryId) noexcept
 Async returns a territory.
int updateTerritory (ProgressListener listener, Territory &territory) noexcept
 Async saves the updates made to a territory.
int deleteTerritory (ProgressListener listener, const LargeIntList &territoriesIds) noexcept
 Async removes territories.
int deleteTerritory (ProgressListener listener, Territory &territory) noexcept
 Async removes a territory.
int generateTerritories (ProgressListener listener, TerritoryList &territories, const CoordinatesList &coordinates, int numberOfTerritories, bool autoNumberOfTerritory=false) noexcept
 Asynchronously generates polygon territories by clustering a set of geographical coordinates.
int getTerritoriesOrders (ProgressListener listener, LargeInteger territoryId, IOrderList &list) noexcept
 Async returns all orders that are inside the territory with the ID sent from the user.
int addOptimization (ProgressListener listener, Optimization &optimization, Request &request) noexcept
 Async creates a request for solving the given optimization.
int getOptimizations (ProgressListener listener, OptimizationList &list, const String &searchTerm=String()) noexcept
 Async returns all the optimizations of the API user.
int getOptimization (ProgressListener listener, Optimization &optimization, LargeInteger optimizationId) noexcept
 Async returns the optimization with the given optimizationId.
int updateOptimization (ProgressListener listener, Optimization &optimization, Request &request) noexcept
 Async saves the updates made to an optimization.
int deleteOptimization (ProgressListener listener, const LargeIntList &optimizationsIds) noexcept
 Async removes optimizations.
int deleteOptimization (ProgressListener listener, Optimization &optimization) noexcept
 Async removes an optimization.
int updateRoute (ProgressListener listener, Route &route, Request &request) noexcept
 Async saves the updates made to a route.
int getRoutes (ProgressListener listener, RouteList &list, const String &searchTerm=String()) noexcept
 Async gets all the routes of the API user.
int getRoute (ProgressListener listener, Route &route, LargeInteger routeId) noexcept
 Async returns the route with the given routeId.
int deleteRoute (ProgressListener listener, const LargeIntList &routesIds) noexcept
 Async delete the routes from the list.
int deleteRoute (ProgressListener listener, Route &route) noexcept
 Async delete the route with the routeId.
int mergeRoutes (ProgressListener listener, Route &route, const LargeIntList &routeIds) noexcept
 Async merges a list of routes into one route.
int moveOrderIntoAnotherRoute (ProgressListener listener, const Order &orderToMove, Route &fromRoute, Route &toRoute) noexcept
 Async moves one orders from one route to another.
int addFuelPrices (ProgressListener listener, FuelPrices &prices) noexcept
 Async sets the price for each fuel type.
int getFuelPrices (ProgressListener listener, FuelPricesList &list, const String &searchTerm=String()) noexcept
 Async returns the price for each fuel type and the time when it was added.
int arrangeLandmarks (ProgressListener listener, IntList &result, const LandmarkList &lmks, ERouteTransportMode mode) noexcept
 Async rearrange landmarks in an optimal way according to distance.
int optimize (gem::ProgressListener listener, const std::string &input, Request &request) noexcept
 Async optimizes an input optimization JSON string.
int optimizeSync (gem::ProgressListener listener, const std::string &input, std::shared_ptr< std::string > output) noexcept
 Sync optimizes an input optimization JSON string.
int getSolutionJson (ProgressListener listener, LargeInteger solutionId, std::shared_ptr< std::string > output) noexcept
 Retrieves the JSON representation of a solution and writes it to the provided output string.
int clean (ProgressListener listener) noexcept
 Async deletes all the date saved for an user.
void cancel (ProgressListener listener) noexcept
 Cancel an async operation.
TransferStatisticsRef getTransferStatistics () const noexcept
 Get data transfer statistics for this service.

Detailed Description

VRP Service.

Manages the optimizations, routes, customers, vehicles and territories.

Implements share-read / write Api object over IService.

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

Member Function Documentation

◆ addCustomer()

int gem::vrp::Service::addCustomer ( ProgressListener listener,
Customer & customer )
inlinenoexcept

Async saves a customer.

Each API user has an "agenda" with all the customers.

Parameters
[in,out]customerThe Customer object. If the operation is successful, the customer will have an id assigned; which can be retrieved using the method Customer::getId().
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ addFuelPrices()

int gem::vrp::Service::addFuelPrices ( ProgressListener listener,
FuelPrices & prices )
inlinenoexcept

Async sets the price for each fuel type.

Parameters
[in]pricesThe FuelPrices object. One price for each fuel type. The time will be automatically updated if the operation was done successfully
[in]listenerOperation progress listener . Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ addMiscLocation()

int gem::vrp::Service::addMiscLocation ( ProgressListener listener,
MiscLocation & miscLocation )
inlinenoexcept

Async saves a miscLocation.

Each API user has an "agenda" with all the miscLocations.

Parameters
[in,out]miscLocationThe MiscLocation object. If the operation is successful, the miscLocation will have an id assigned; which can be retrieved using the method MiscLocation::getId().
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ addOptimization()

int gem::vrp::Service::addOptimization ( ProgressListener listener,
Optimization & optimization,
Request & request )
inlinenoexcept

Async creates a request for solving the given optimization.

Parameters
[in]listenerOperation progress listener. Returns:
[out]requestThe request created for this operation. Use the request' id to get the current status of the operation.
[in,out]optimizationThe Optimization object. If the operation is successful, the optimization will have an id assigned; which can be retrieved using the method Optimization::getId().
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ addOrder()

int gem::vrp::Service::addOrder ( ProgressListener listener,
Order & order,
bool autoAssignDepot )
inlinenoexcept

Async saves an order.

This order can be later used in an optimization or in multiple optimizations.

Parameters
[in,out]orderThe Order object. If the operation is successful, the order will have an id assigned; which can be retrieved using the method Order::getId().
[in]listenerOperation progress listener. Returns:
[in]autoAssignDepotIf to the order should be assigned the nearest depot (by time), or not.
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ addTerritory()

int gem::vrp::Service::addTerritory ( ProgressListener listener,
Territory & territory )
inlinenoexcept

Async adds a territory in the list of territories of the API user.

Parameters
[in,out]territoryThe Territory object. If the operation is successful, the territory will have an id assigned; which can be retrieved using the method Territory::getId().
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ addVehicle()

int gem::vrp::Service::addVehicle ( ProgressListener listener,
Vehicle & vehicle )
inlinenoexcept

Async adds a vehicle in the list of vehicles of the API user.

The list of vehicles represents the fleet of the user.

Parameters
[in,out]vehicleThe Vehicle object. If the operation is successful, the vehicle will have an id assigned; which can be retrieved using the method Vehicle::getId().
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ arrangeLandmarks()

int gem::vrp::Service::arrangeLandmarks ( ProgressListener listener,
IntList & result,
const LandmarkList & lmks,
ERouteTransportMode mode )
inlinenoexcept

Async rearrange landmarks in an optimal way according to distance.

Parameters
[out]resultA list of rearranged landmark indexes.
[in]lmksThe list of points on the maps that needs to be rearranged.
[in]modeThe route transport mode.
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ cancel()

void gem::vrp::Service::cancel ( ProgressListener listener)
inlinenoexcept

Cancel an async operation.

Parameters
[in]listenerThe listener associated with the operation

◆ cancelRequest()

int gem::vrp::Service::cancelRequest ( ProgressListener listener,
LargeInteger requestId )
inlinenoexcept

Async cancels a request.

Parameters
[in]requestIdUnique identifier for the request to be canceled
[in]listenerOperation progress listener. Returns: KNoError = Success, error::KInternalAbort = The result parsing failed or server internal error occurred or error::KNotFound = Request not found or finished
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ clean()

int gem::vrp::Service::clean ( ProgressListener listener)
inlinenoexcept

Async deletes all the date saved for an user.

Parameters
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ deleteCustomer() [1/2]

int gem::vrp::Service::deleteCustomer ( ProgressListener listener,
const LargeIntList & customersIds )
inlinenoexcept

Async removes customers.

If the customers have made some orders, they will also be deleted.

Parameters
[in]customersIdsUnique identifier for the customer to be removed
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ deleteCustomer() [2/2]

int gem::vrp::Service::deleteCustomer ( ProgressListener listener,
Customer & customer )
inlinenoexcept

Async removes a customer.

If this customer has made some orders, they will also be deleted.

Parameters
[in]customerThe customer to be removed
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ deleteMiscLocation() [1/2]

int gem::vrp::Service::deleteMiscLocation ( ProgressListener listener,
const LargeIntList & miscLocationsIds )
inlinenoexcept

Async removes miscLocations.

If the miscLocations have made some orders, they will also be deleted.

Parameters
[in]miscLocationsIdsUnique identifier for the miscLocations to be removed
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ deleteMiscLocation() [2/2]

int gem::vrp::Service::deleteMiscLocation ( ProgressListener listener,
MiscLocation & miscLocation )
inlinenoexcept

Async removes a miscLocation.

If this miscLocation has made some orders, they will also be deleted.

Parameters
[in]miscLocationThe miscLocation to be removed
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ deleteOptimization() [1/2]

int gem::vrp::Service::deleteOptimization ( ProgressListener listener,
const LargeIntList & optimizationsIds )
inlinenoexcept

Async removes optimizations.

It also deletes theirs routes.

Parameters
[in]optimizationsIdsThe optimizations ids
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ deleteOptimization() [2/2]

int gem::vrp::Service::deleteOptimization ( ProgressListener listener,
Optimization & optimization )
inlinenoexcept

Async removes an optimization.

It also deletes its routes.

Parameters
[in]optimizationThe optimization
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ deleteOrder() [1/2]

int gem::vrp::Service::deleteOrder ( ProgressListener listener,
const LargeIntList & ordersIds )
inlinenoexcept

Async removes orders.

If the orders have made some orders, they will also be deleted.

Parameters
[in]ordersIdsUnique identifier for the orders to be removed
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ deleteOrder() [2/2]

int gem::vrp::Service::deleteOrder ( ProgressListener listener,
Order & order )
inlinenoexcept

Async removes an order.

If this order has made some orders, they will also be deleted.

Parameters
[in]orderThe order to be removed
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ deleteRoute() [1/2]

int gem::vrp::Service::deleteRoute ( ProgressListener listener,
const LargeIntList & routesIds )
inlinenoexcept

Async delete the routes from the list.

The route's orders will also be deleted from its optimization.

Parameters
[in]routesIdsThe routes ids
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ deleteRoute() [2/2]

int gem::vrp::Service::deleteRoute ( ProgressListener listener,
Route & route )
inlinenoexcept

Async delete the route with the routeId.

The route's orders will also be deleted from its optimization.

Parameters
[in]routeThe route
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ deleteTerritory() [1/2]

int gem::vrp::Service::deleteTerritory ( ProgressListener listener,
const LargeIntList & territoriesIds )
inlinenoexcept

Async removes territories.

Parameters
[in]territoriesIdsThe territories ids
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ deleteTerritory() [2/2]

int gem::vrp::Service::deleteTerritory ( ProgressListener listener,
Territory & territory )
inlinenoexcept

Async removes a territory.

Parameters
[in]territoryThe territory
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ deleteVehicle() [1/2]

int gem::vrp::Service::deleteVehicle ( ProgressListener listener,
const LargeIntList & vehiclesIds )
inlinenoexcept

Async removes vehicles.

Parameters
[in]vehiclesIdsThe vehicles ids
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ deleteVehicle() [2/2]

int gem::vrp::Service::deleteVehicle ( ProgressListener listener,
Vehicle & vehicle )
inlinenoexcept

Async removes a vehicle.

Parameters
[in]vehicleThe vehicle to be deleted
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ generateTerritories()

int gem::vrp::Service::generateTerritories ( ProgressListener listener,
TerritoryList & territories,
const CoordinatesList & coordinates,
int numberOfTerritories,
bool autoNumberOfTerritory = false )
inlinenoexcept

Asynchronously generates polygon territories by clustering a set of geographical coordinates.

Partitions the provided coordinates into numberOfTerritories polygon territories (type ETerritoryType::TT_Polygon). Each generated Territory exposes the orders located within it via Territory::getOrders(). At least 3 * numberOfTerritories coordinates must be provided. Set autoNumberOfTerritory to true to let the algorithm choose the count automatically, in which case numberOfTerritories is ignored.

Parameters
[in]listenerProgress listener. On completion, the error code is one of:
[out]territoriesReceives the generated Territory objects.
[in]coordinatesInput coordinates. Must contain at least 3 * numberOfTerritories entries.
[in]numberOfTerritoriesDesired number of territories. Ignored when autoNumberOfTerritory is true.
[in]autoNumberOfTerritoryWhen true, the algorithm determines the count automatically. Defaults to false.
Returns
KNoError if the operation started successfully; a non-zero error code otherwise. Progress and completion notifications are delivered via listener.
See also
Territory, ETerritoryType, Service::addTerritory(), Service::getTerritories()

◆ getCustomer()

int gem::vrp::Service::getCustomer ( ProgressListener listener,
Customer & customer,
LargeInteger customerId )
inlinenoexcept

Async returns customer with the customerId.

Parameters
[out]customerThe result Customer object
[in]customerIdUnique identifier for the customer
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ getCustomerOrdersHistory()

int gem::vrp::Service::getCustomerOrdersHistory ( ProgressListener listener,
CustomerOrderList & history,
const Customer & customer )
inlinenoexcept

Async returns each order made by the customer and the ids of the optimizations and routes where it was assigned.

Parameters
[out]historyThe orders history of the customer
[in]customerThe Customer object
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ getCustomers()

int gem::vrp::Service::getCustomers ( ProgressListener listener,
CustomerList & customers,
const String & searchTerm = String() )
inlinenoexcept

Async returns all customers.

Parameters
[out]customersCustomer objects list
[in]listenerOperation progress listener. Returns:
[in]searchTermthe parameter for general search across customers.
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ getFuelPrices()

int gem::vrp::Service::getFuelPrices ( ProgressListener listener,
FuelPricesList & list,
const String & searchTerm = String() )
inlinenoexcept

Async returns the price for each fuel type and the time when it was added.

Parameters
[out]listFuelPrices objects list
[in]listenerOperation progress listener. Returns:
[in]searchTermthe parameter for general search across routes.
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ getMiscLocation()

int gem::vrp::Service::getMiscLocation ( ProgressListener listener,
MiscLocation & miscLocation,
LargeInteger miscLocationId )
inlinenoexcept

Async returns miscLocation with the miscLocationId.

Parameters
[out]miscLocationThe result MiscLocation object
[in]miscLocationIdUnique identifier for the miscLocation
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ getMiscLocations()

int gem::vrp::Service::getMiscLocations ( ProgressListener listener,
MiscLocationList & miscLocations,
const String & searchTerm = String() )
inlinenoexcept

Async returns all miscLocations.

Parameters
[out]miscLocationsMiscLocation objects list
[in]listenerOperation progress listener. Returns:
[in]searchTermthe parameter for general search across miscLocations.
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ getOptimization()

int gem::vrp::Service::getOptimization ( ProgressListener listener,
Optimization & optimization,
LargeInteger optimizationId )
inlinenoexcept

Async returns the optimization with the given optimizationId.

Parameters
[out]optimizationThe result Optimization object
[in]optimizationIdThe optimization id
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ getOptimizations()

int gem::vrp::Service::getOptimizations ( ProgressListener listener,
OptimizationList & list,
const String & searchTerm = String() )
inlinenoexcept

Async returns all the optimizations of the API user.

Parameters
[out]listOptimization objects list
[in]listenerOperation progress listener. Returns:
[in]searchTermthe parameter for general search across optimizations.
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ getOrder()

int gem::vrp::Service::getOrder ( ProgressListener listener,
Order & order,
LargeInteger orderId )
inlinenoexcept

Async returns order with the orderId.

Parameters
[out]orderThe result Order object
[in]orderIdUnique identifier for the order
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ getOrders()

int gem::vrp::Service::getOrders ( ProgressListener listener,
OrderList & orders,
const String & searchTerm = String() )
inlinenoexcept

Async returns all the orders.

Parameters
[out]ordersOrder objects list
[in]listenerOperation progress listener. Returns:
[in]searchTermthe parameter for general search across orders.
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ getRequest()

int gem::vrp::Service::getRequest ( ProgressListener listener,
Request & request,
LargeInteger requestId )
inlinenoexcept

Async returns the request with the requestId.

Parameters
[out]requestThe result Request object
[in]requestIdUnique identifier for the request
[in]listenerOperation progress listener. Returns: KNoError = Success, error::KInternalAbort = The result parsing failed or server internal error occurred or error::KNotFound = Request not found
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ getRequests()

int gem::vrp::Service::getRequests ( ProgressListener listener,
RequestList & requests )
inlinenoexcept

Async returns all un-finished requests.

Parameters
[out]requestsRequest objects list
[in]listenerOperation progress listener. Returns: KNoError = Success, error::KInternalAbort = The result parsing failed or server internal error occurred or error::KNotFound = No requests found
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ getRoute()

int gem::vrp::Service::getRoute ( ProgressListener listener,
Route & route,
LargeInteger routeId )
inlinenoexcept

Async returns the route with the given routeId.

Parameters
[out]routeThe result Route object
[in]routeIdThe route id
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ getRoutes()

int gem::vrp::Service::getRoutes ( ProgressListener listener,
RouteList & list,
const String & searchTerm = String() )
inlinenoexcept

Async gets all the routes of the API user.

Parameters
[out]listRoute objects list
[in]listenerOperation progress listener. Returns:
[in]searchTermthe parameter for general search across routes.
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ getSolutionJson()

int gem::vrp::Service::getSolutionJson ( ProgressListener listener,
LargeInteger solutionId,
std::shared_ptr< std::string > output )
inlinenoexcept

Retrieves the JSON representation of a solution and writes it to the provided output string.

Parameters
[out]outputThe string where the solution JSON will be written.
[in]solutionIdThe unique identifier of the solution to retrieve.
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ getTerritories()

int gem::vrp::Service::getTerritories ( ProgressListener listener,
TerritoryList & list,
const String & searchTerm = String() )
inlinenoexcept

Async returns all the territories of the API user.

Parameters
[out]listTerritory objects list
[in]listenerOperation progress listener. Returns:
[in]searchTermthe parameter for general search across territories.
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ getTerritoriesOrders()

int gem::vrp::Service::getTerritoriesOrders ( ProgressListener listener,
LargeInteger territoryId,
IOrderList & list )
inlinenoexcept

Async returns all orders that are inside the territory with the ID sent from the user.

Parameters
[out]listorders objects list
[in]territoryIdThe territory id
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ getTerritory()

int gem::vrp::Service::getTerritory ( ProgressListener listener,
Territory & territory,
LargeInteger territoryId )
inlinenoexcept

Async returns a territory.

Parameters
[out]territoryThe result Territory object
[in]territoryIdThe territory id
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ getTransferStatistics()

TransferStatisticsRef gem::vrp::Service::getTransferStatistics ( ) const
inlinenoexcept

Get data transfer statistics for this service.

Returns
A reference to the TransferStatistics object containing data transfer information for the this service.

◆ getVehicle()

int gem::vrp::Service::getVehicle ( ProgressListener listener,
Vehicle & vehicle,
LargeInteger vehicleId )
inlinenoexcept

Async returns a vehicle.

Parameters
[out]vehicleThe result Vehicle object
[in]vehicleIdThe vehicle id
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ getVehicles()

int gem::vrp::Service::getVehicles ( ProgressListener listener,
VehicleList & list,
const String & searchTerm = String() )
inlinenoexcept

Async returns all the vehicles of the API user.

Parameters
[out]listVehicle objects list
[in]listenerOperation progress listener. Returns:
[in]searchTermthe parameter for general search across vehicles.
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ mergeRoutes()

int gem::vrp::Service::mergeRoutes ( ProgressListener listener,
Route & route,
const LargeIntList & routeIds )
inlinenoexcept

Async merges a list of routes into one route.

A new optimization will be created for the merged route. The optimization will have the same fields as the first route in the routeIds list (exception: the field ignoreTimewindow will be true). Routes must not have matrices build type set to EMatrixBuildType::MBT_Set!

Parameters
[out]routeThe result Route object
[in]routeIdsThe route ids to be merged
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener
See also
EMatrixBuildType

◆ moveOrderIntoAnotherRoute()

int gem::vrp::Service::moveOrderIntoAnotherRoute ( ProgressListener listener,
const Order & orderToMove,
Route & fromRoute,
Route & toRoute )
inlinenoexcept

Async moves one orders from one route to another.

If the routes are not in the same optimization, the order will also be moved from the fromRoute's optimization into the toRoute's optimization. The order will be added in toRoute at the optimal position. This method cannot be used if one of the routes or their optimizations have matrixBuildType = Set. The order must not be the depot of fromRoute or of its optimization.

Parameters
[in]orderToMoveThe order that will be moved
[in,out]fromRouteThe Route from which the order is moved
[in,out]toRouteThe Route to which the order is moved
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ operator=() [1/2]

Service & gem::vrp::Service::operator= ( const Service & )
delete

Default copy assignment operator.

Replaces the contents of this object with a copy of another Service object.

Returns
A reference to the current object.

◆ operator=() [2/2]

Service & gem::vrp::Service::operator= ( Service && )
default

Default move assignment operator.

Moves the contents of another Service object into this one.

Returns
A reference to the current object.

◆ optimize()

int gem::vrp::Service::optimize ( gem::ProgressListener listener,
const std::string & input,
Request & request )
inlinenoexcept

Async optimizes an input optimization JSON string.

Parameters
[out]requestThe request created for this operation. Use the request'id to get the current status of the operation.
[in]inputThe optimization input as JSON string.
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ optimizeSync()

int gem::vrp::Service::optimizeSync ( gem::ProgressListener listener,
const std::string & input,
std::shared_ptr< std::string > output )
inlinenoexcept

Sync optimizes an input optimization JSON string.

Parameters
[out]outputThe string where the solution JSON will be written.
[in]inputThe optimization input as JSON string.
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ updateCustomer()

int gem::vrp::Service::updateCustomer ( ProgressListener listener,
const Customer & customer )
inlinenoexcept

Async saves the updates made to a customer.

Parameters
[in]customerThe new Customer object
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ updateMiscLocation()

int gem::vrp::Service::updateMiscLocation ( ProgressListener listener,
const MiscLocation & miscLocation )
inlinenoexcept

Async saves the updates made to a miscLocation.

Parameters
[in]miscLocationThe new MiscLocation object
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ updateOptimization()

int gem::vrp::Service::updateOptimization ( ProgressListener listener,
Optimization & optimization,
Request & request )
inlinenoexcept

Async saves the updates made to an optimization.

The optimization will be reoptimized

The optimization's orders cannot be updated using this method (for orders update use the methods: Optimization::addOrders(), Optimization::updateOrder(), Optimization::deleteOrder()).

Parameters
[in]listenerOperation progress listener. Returns:
[in]optimizationThe updated Optimization object
[out]requestThe request created for this operation. Use the request'id to get the current status of the operation.
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ updateOrder()

int gem::vrp::Service::updateOrder ( ProgressListener listener,
Order & order,
bool autoAssignDepot )
inlinenoexcept

Async saves the updates made to an order.

If this order is scheduled in an optimization, the location and address cannot be changed.

Parameters
[in]orderThe new Order object
[in]listenerOperation progress listener. Returns:
[in]autoAssignDepotIf to the order should be assigned the nearest depot (by time), or not.
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ updateRoute()

int gem::vrp::Service::updateRoute ( ProgressListener listener,
Route & route,
Request & request )
inlinenoexcept

Async saves the updates made to a route.

The updates will not be applied on the route's optimization as well.

The orders of the route cannot be updated using this method (for orders update use the methods: Route::addOrders(), Route::deleteOrder(), Optimization::updateOrder()).

Parameters
[in]listenerOperation progress listener. Returns:
[in,out]routeThe updated Route object
[out]requestThe request created for this operation. Use the request'id to get the current status of the operation.
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ updateTerritory()

int gem::vrp::Service::updateTerritory ( ProgressListener listener,
Territory & territory )
inlinenoexcept

Async saves the updates made to a territory.

Parameters
[in,out]territoryThe Territory object
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener

◆ updateVehicle()

int gem::vrp::Service::updateVehicle ( ProgressListener listener,
const Vehicle & vehicle )
inlinenoexcept

Async saves the updates made to a vehicle.

Parameters
[in]vehicleThe Vehicle object
[in]listenerOperation progress listener. Returns:
Returns
Error code if the operation couldn't start. If operation successfully started the progress and completion notifications will come via the listener