libosmscout  0.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules
osmscout::Router Class Reference

#include <Router.h>

+ Inheritance diagram for osmscout::Router:

Public Slots

void Initialize ()
 
void onRouteRequest (LocationEntryRef start, LocationEntryRef target, QmlRoutingProfileRef profile, int requestId, osmscout::BreakerRef breaker, std::optional< osmscout::Bearing > bearing)
 Start Route computation. More...
 

Signals

void routeCanceled (int requestId)
 
void routeComputed (QtRouteData route, int requestId)
 
void routeFailed (QString reason, int requestId)
 
void routingProgress (int percent, int requestId)
 

Public Member Functions

 Router (QThread *thread, SettingsRef settings, DBThreadRef dbThread)
 
virtual ~Router ()
 

Constructor & Destructor Documentation

◆ Router()

osmscout::Router::Router ( QThread *  thread,
SettingsRef  settings,
DBThreadRef  dbThread 
)

References Initialize().

◆ ~Router()

osmscout::Router::~Router ( )
virtual

Member Function Documentation

◆ Initialize

void osmscout::Router::Initialize ( )
slot

Referenced by Router().

◆ onRouteRequest

void osmscout::Router::onRouteRequest ( LocationEntryRef  start,
LocationEntryRef  target,
QmlRoutingProfileRef  profile,
int  requestId,
osmscout::BreakerRef  breaker,
std::optional< osmscout::Bearing bearing 
)
slot

Start Route computation.

Router emits multiple routingProgress followed by routeComputed or routeFailed with requestId identifier.

User of this function should use Qt::QueuedConnection for invoking this slot, search may generate IO load and may took long time.

Route computation can be long depending on the complexity of the route (the further away the endpoints, the more difficult the routing).

Parameters
start- starting position for route computation
target- end position for route computation
vehicle- used vehicle for route
requestId- id used later in routeComputed/routeFailed signals
breaker- breaker that may be used for cancel routing computation

References osmscout::Log::Debug(), osmscout::log, routeFailed(), osmscout::vehicleStr(), and osmscout::Log::Warn().

Referenced by osmscout::RoutingListModel::RoutingListModel().

◆ routeCanceled

void osmscout::Router::routeCanceled ( int  requestId)
signal

◆ routeComputed

void osmscout::Router::routeComputed ( QtRouteData  route,
int  requestId 
)
signal

◆ routeFailed

void osmscout::Router::routeFailed ( QString  reason,
int  requestId 
)
signal

◆ routingProgress

void osmscout::Router::routingProgress ( int  percent,
int  requestId 
)
signal

The documentation for this class was generated from the following files: