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

RouteCollection object. More...

Inheritance diagram for gem::RouteCollection:
Collaboration diagram for gem::RouteCollection:

Public Member Functions

int size () const noexcept
 Get number of routes in this collection.
const RouteRef getRoute (int index) const noexcept
 Get route specified by index.
int indexOf (const Route &route) const noexcept
 Get index of the specified route - return < 0 for error.
bool isMainRoute (const Route &route) const noexcept
 Check if the route is the main route in the collection.
const RouteRef getMainRoute () const noexcept
 Get the current main route.
RouteCollectionsetMainRoute (const Route &route) noexcept
 Set the route as main route in the collection.
RouteCollectionadd (const Route &route, bool bMainRoute) noexcept
 Add a route in the collection.
RouteCollectionremove (const Route &route) noexcept
 Remove the route specified by Route.
bool contains (const Route &route) const noexcept
 Check if a route object is in collection.
void clear () noexcept
 Remove all routes.
template<typename TCollector>
bool iterateRoutes (TCollector collector) const
 Iterate all routes in the collection.

Detailed Description

RouteCollection object.

Implements share-read / write Api object over IRouteCollection.

Member Function Documentation

◆ add()

RouteCollection & gem::RouteCollection::add ( const Route & route,
bool bMainRoute )
inlinenoexcept

Add a route in the collection.

Parameters
[in]routeThe route to be added.
[in]bMainRouteTrue if the route is the main route, false if alternative route
Returns
RouteCollection object

◆ contains()

bool gem::RouteCollection::contains ( const Route & route) const
inlinenoexcept

Check if a route object is in collection.

Parameters
[in]routeThe route to be checked
Returns
True if the route is in the collection

◆ getMainRoute()

const RouteRef gem::RouteCollection::getMainRoute ( ) const
inlinenoexcept

Get the current main route.

Returns
The main route in the collection

◆ getRoute()

const RouteRef gem::RouteCollection::getRoute ( int index) const
inlinenoexcept

Get route specified by index.

Parameters
[in]indexThe index of the route in the collection
Returns
The route object

◆ indexOf()

int gem::RouteCollection::indexOf ( const Route & route) const
inlinenoexcept

Get index of the specified route - return < 0 for error.

Parameters
[in]routeThe route to be found
Returns
The index of the route in the collection

◆ isMainRoute()

bool gem::RouteCollection::isMainRoute ( const Route & route) const
inlinenoexcept

Check if the route is the main route in the collection.

Parameters
[in]routeThe route to be checked
Returns
True if the route is the main route in the collection

◆ iterateRoutes()

template<typename TCollector>
bool gem::RouteCollection::iterateRoutes ( TCollector collector) const
inline

Iterate all routes in the collection.

Collector should return true if iteration should continue and false if iteration should stop

Parameters
[in]collectorThe collector function
Returns
true if all routes were iterated, false if iteration was stopped

◆ remove()

RouteCollection & gem::RouteCollection::remove ( const Route & route)
inlinenoexcept

Remove the route specified by Route.

Parameters
[in]routeroute in the collection
Returns
RouteCollection object

◆ setMainRoute()

RouteCollection & gem::RouteCollection::setMainRoute ( const Route & route)
inlinenoexcept

Set the route as main route in the collection.

Parameters
[in]routeThe route to be set as main route
Returns
RouteCollection object

◆ size()

int gem::RouteCollection::size ( ) const
inlinenoexcept

Get number of routes in this collection.

Returns
The number of routes in the collection.