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

TrafficService object. More...

Inheritance diagram for gem::TrafficService:
Collaboration diagram for gem::TrafficService:

Public Member Functions

 TrafficService ()=default
 Default constructor.
 TrafficService (const TrafficService &traffic)=delete
 Default copy constructor.
 TrafficService (TrafficService &&traffic)=default
 Default move constructor noexcept is deduced.
TrafficServiceoperator= (const TrafficService &traffic)=delete
 Default copy assignment.
TrafficServiceoperator= (TrafficService &&traffic)=default
 Default move assignment noexcept is deduced.
TrafficPreferencesRef preferences () noexcept
 Get access to the traffic service preferences.
int getOnlineServiceRestrictions (const Coordinates &position) const noexcept
 Get the online traffic service restrictions for the given position.
TransferStatisticsRef getTransferStatistics () const
 Get data transfer statistics for this service.
std::pair< TrafficEvent, int > addPersistentRoadblock (const CoordinatesList &coords, const Time &startUTC, const Time &expireUTC, int transportMode, const String &id=String()) noexcept
 Add an user persistent roadblock to collection ( path impact zone type ).
std::pair< TrafficEvent, int > addPersistentAntiRoadblock (const GeographicArea &area, const Time &startUTC, const Time &expireUTC, int transportMode, const String &id=String()) noexcept
 Add an user persistent anti-area roadblock to collection.
std::pair< TrafficEvent, int > addPersistentRoadblock (const GeographicArea &area, const Time &startUTC, const Time &expireUTC, int transportMode, const String &id=String()) noexcept
 Add an user persistent roadblock to collection ( area impact zone type ).
int removePersistentRoadblock (const String &id) noexcept
 Remove an user persistent roadblock identified by id.
int removePersistentRoadblock (const Coordinates &coords) noexcept
 Remove an user persistent roadblock identified by a reference coordinate ( for path impact zone type ).
TrafficEvent getPersistentRoadblock (const String &id) noexcept
 Get an user persistent roadblock identified by id.
TrafficServiceremoveAllPersistentRoadblocks () noexcept
 Remove all user persistent roadblock.
RouteTrafficEventList getPersistentRoadblocks () const noexcept
 Get all persistent user roadblocks.
TrafficServiceremoveUserRoadblock (const TrafficEvent &ev) noexcept
 Remove an user roadblock ( persistent or non-persistent ).
std::tuple< CoordinatesList, UserRoadblockPathPreviewCoordinate, int > getPersistentRoadblockPathPreview (const UserRoadblockPathPreviewCoordinate &from, const Coordinates &to, int transportMode) const noexcept
 Get persistent roadblock path preview.
TrafficServicesetPersistentRoadblockListener (PersistentRoadblockListener listener) noexcept
 Set persistent roadblocks listener.

Detailed Description

TrafficService object.

Adds support to update traffic information.

Implements share-read / write Api object over ITraffic.

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

Constructor & Destructor Documentation

◆ TrafficService() [1/2]

gem::TrafficService::TrafficService ( const TrafficService & traffic)
delete

Default copy constructor.

Parameters
trafficThe traffic object to copy

◆ TrafficService() [2/2]

gem::TrafficService::TrafficService ( TrafficService && traffic)
default

Default move constructor noexcept is deduced.

Parameters
trafficThe traffic object to move

Member Function Documentation

◆ addPersistentAntiRoadblock()

std::pair< TrafficEvent, int > gem::TrafficService::addPersistentAntiRoadblock ( const GeographicArea & area,
const Time & startUTC,
const Time & expireUTC,
int transportMode,
const String & id = String() )
inlinenoexcept

Add an user persistent anti-area roadblock to collection.

Parameters
[in]areaThe geographic area not affected by the roadblock, i.e. the anti-area ( world wide - area ) is the roadblock
[in]startUTCThe roadblock start time in Coordinated Universal Time
[in]expireUTCThe roadblock expire time in Coordinated Universal Time
[in]transportModeThe transport mode for which the roadblock applies. See gem::ERouteTransportMode.
[in]idThe user roadblock id. Can be used to get / delete a defined roadblock
Returns
The new defined roadblock together with the error code error::kExist means the roadblock already exist error::kInUse means the roadblock id is already in use

◆ addPersistentRoadblock() [1/2]

std::pair< TrafficEvent, int > gem::TrafficService::addPersistentRoadblock ( const CoordinatesList & coords,
const Time & startUTC,
const Time & expireUTC,
int transportMode,
const String & id = String() )
inlinenoexcept

Add an user persistent roadblock to collection ( path impact zone type ).

Parameters
[in]coordsThe roadblock coordinates list
[in]startUTCThe roadblock start time in Coordinated Universal Time
[in]expireUTCThe roadblock expire time in Coordinated Universal Time
[in]transportModeThe transport mode for which the roadblock applies. See gem::ERouteTransportMode.
[in]idThe user roadblock id. Can be used to get / delete a defined roadblock

if coords size == 1, a point located roadblock is defined - this may result in 2 real roadblocks for matched road both ways

if coords size > 1, a path located roadblock is defined - this will result in 1 map roadblock in start -> end way

Returns
The new defined roadblock together with the error code. error::kExist means the roadblock already exist error::kInUse means the roadblock id is already in use error::kNooRoute means the roadblock cannot be defined using the input coordinates

◆ addPersistentRoadblock() [2/2]

std::pair< TrafficEvent, int > gem::TrafficService::addPersistentRoadblock ( const GeographicArea & area,
const Time & startUTC,
const Time & expireUTC,
int transportMode,
const String & id = String() )
inlinenoexcept

Add an user persistent roadblock to collection ( area impact zone type ).

Parameters
[in]areaThe geographic area affected by the roadblock
[in]startUTCThe roadblock start time in Coordinated Universal Time
[in]expireUTCThe roadblock expire time in Coordinated Universal Time
[in]transportModeThe transport mode for which the roadblock applies. See gem::ERouteTransportMode.
[in]idThe user roadblock id. Can be used to get / delete a defined roadblock
Returns
The new defined roadblock together with the error code error::kExist means the roadblock already exist error::kInUse means the roadblock id is already in use

◆ getOnlineServiceRestrictions()

int gem::TrafficService::getOnlineServiceRestrictions ( const Coordinates & position) const
inlinenoexcept

Get the online traffic service restrictions for the given position.

Parameters
[in]positionThe check position
Returns
traffic restriction check ETrafficOnlineRestrictions for possible values

◆ getPersistentRoadblock()

TrafficEvent gem::TrafficService::getPersistentRoadblock ( const String & id)
inlinenoexcept

Get an user persistent roadblock identified by id.

Parameters
[in]idThe roadblock id as it was provided in addPersistentRoadblock function
Returns
The roadblock if id exist otherwise a default event object

◆ getPersistentRoadblockPathPreview()

std::tuple< CoordinatesList, UserRoadblockPathPreviewCoordinate, int > gem::TrafficService::getPersistentRoadblockPathPreview ( const UserRoadblockPathPreviewCoordinate & from,
const Coordinates & to,
int transportMode ) const
inlinenoexcept

Get persistent roadblock path preview.

Parameters
[in]fromThe previous defined coordinates in roadblock path from where to start the preview
[in]toThe movable coordinate in roadblock path to where the preview ends
[in]transportModeThe transport mode. See gem::ERouteTransportMode.
Returns
The coordinates list preview of the roadblock path in from -> last order + next roadblock point match suggestion

◆ getPersistentRoadblocks()

RouteTrafficEventList gem::TrafficService::getPersistentRoadblocks ( ) const
inlinenoexcept

Get all persistent user roadblocks.

Returns
The list of persistent roadblocks

◆ getTransferStatistics()

TransferStatisticsRef gem::TrafficService::getTransferStatistics ( ) const
inline

Get data transfer statistics for this service.

Returns
The transfer statistics

◆ operator=() [1/2]

TrafficService & gem::TrafficService::operator= ( const TrafficService & traffic)
delete

Default copy assignment.

Parameters
trafficThe traffic object to copy
Returns
The copied traffic object

◆ operator=() [2/2]

TrafficService & gem::TrafficService::operator= ( TrafficService && traffic)
default

Default move assignment noexcept is deduced.

Parameters
trafficThe traffic object to move
Returns
The moved traffic object

◆ preferences()

TrafficPreferencesRef gem::TrafficService::preferences ( )
inlinenoexcept

Get access to the traffic service preferences.

Returns
The traffic service preferences

◆ removeAllPersistentRoadblocks()

TrafficService & gem::TrafficService::removeAllPersistentRoadblocks ( )
inlinenoexcept

Remove all user persistent roadblock.

Returns
reference to this object

◆ removePersistentRoadblock() [1/2]

int gem::TrafficService::removePersistentRoadblock ( const Coordinates & coords)
inlinenoexcept

Remove an user persistent roadblock identified by a reference coordinate ( for path impact zone type ).

Parameters
[in]coordsThe roadblock start coordinates

coords must be equal with first coordinate in coords list provided when the roadblock was defined

Returns
The error code

◆ removePersistentRoadblock() [2/2]

int gem::TrafficService::removePersistentRoadblock ( const String & id)
inlinenoexcept

Remove an user persistent roadblock identified by id.

Parameters
[in]idThe roadblock id as it was provided in addPersistentRoadblock function
Returns
The error code

◆ removeUserRoadblock()

TrafficService & gem::TrafficService::removeUserRoadblock ( const TrafficEvent & ev)
inlinenoexcept

Remove an user roadblock ( persistent or non-persistent ).

Parameters
[in]evThe roadblock to remove
Returns
reference to this object

◆ setPersistentRoadblockListener()

TrafficService & gem::TrafficService::setPersistentRoadblockListener ( PersistentRoadblockListener listener)
inlinenoexcept

Set persistent roadblocks listener.

Parameters
[in]listenerThe listener to set
Returns
reference to this object