Class Router
A router implementation encapsulating basic routing functionalities.
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public sealed class Router : RouterBase
Constructors
Router(RouterDb)
Properties
CreateCustomResolver
Gets or sets the delegate to create a custom resolver.
Declaration
public IResolveExtensions.CreateResolver CreateCustomResolver { get; set; }
Property Value
IResolveExtensions.CreateResolver
|
CustomRouteBuilder
Gets or sets the custom route builder.
Declaration
public IRouteBuilder CustomRouteBuilder { get; set; }
Property Value
IRouteBuilder
|
Db
Gets the db.
Declaration
public override sealed RouterDb Db { get; }
Property Value
RouterDb
|
Overrides
ResolverCache
Gets or sets the resolver cache.
Declaration
public IResolverCache ResolverCache { get; set; }
Property Value
IResolverCache
|
Methods
BuildRoute<T>(IProfileInstance, WeightHandler<T>, RouterPoint, RouterPoint, EdgePath<T>, CancellationToken)
Builds a route.
Declaration
public override sealed Result<Route> BuildRoute<T>(IProfileInstance profileInstance, WeightHandler<T> weightHandler, RouterPoint source, RouterPoint target, EdgePath<T> path, CancellationToken cancellationToken)where T : struct
Parameters
IProfileInstance
profileInstance
|
WeightHandler<T>
weightHandler
|
RouterPoint
source
|
RouterPoint
target
|
EdgePath<T>
path
|
CancellationToken
cancellationToken
|
Returns
Result<Route>
|
Type Parameters
T
|
Overrides
TryCalculateRaw<T>(IProfileInstance, WeightHandler<T>, RouterPoint, RouterPoint, RoutingSettings<T>, CancellationToken)
Calculates a route between the two locations.
Declaration
public override sealed Result<EdgePath<T>> TryCalculateRaw<T>(IProfileInstance profileInstance, WeightHandler<T> weightHandler, RouterPoint source, RouterPoint target, RoutingSettings<T> settings, CancellationToken cancellationToken)where T : struct
Parameters
IProfileInstance
profileInstance
|
WeightHandler<T>
weightHandler
|
RouterPoint
source
|
RouterPoint
target
|
RoutingSettings<T>
settings
|
CancellationToken
cancellationToken
|
Returns
Result<EdgePath<T>>
|
Type Parameters
T
|
Overrides
TryCalculateRaw<T>(IProfileInstance, WeightHandler<T>, RouterPoint, Nullable<Boolean>, RouterPoint, Nullable<Boolean>, RoutingSettings<T>, CancellationToken)
Calculates a route between the two directed edges. The route starts in the direction of the edge and ends with an arrive in the direction of the target edge.
Declaration
public override sealed Result<EdgePath<T>> TryCalculateRaw<T>(IProfileInstance profileInstance, WeightHandler<T> weightHandler, RouterPoint source, bool ? sourceForward, RouterPoint target, bool ? targetForward, RoutingSettings<T> settings, CancellationToken cancellationToken)where T : struct
Parameters
IProfileInstance
profileInstance
|
WeightHandler<T>
weightHandler
|
RouterPoint
source
|
System.Nullable<System.Boolean>
sourceForward
|
RouterPoint
target
|
System.Nullable<System.Boolean>
targetForward
|
RoutingSettings<T>
settings
|
CancellationToken
cancellationToken
|
Returns
Result<EdgePath<T>>
|
Type Parameters
T
|
Overrides
TryCalculateRaw<T>(IProfileInstance, WeightHandler<T>, RouterPoint[], RouterPoint[], RoutingSettings<T>, CancellationToken)
Calculates all routes between all sources and all targets.
Declaration
public override sealed Result<EdgePath<T>[][]> TryCalculateRaw<T>(IProfileInstance profileInstance, WeightHandler<T> weightHandler, RouterPoint[] sources, RouterPoint[] targets, RoutingSettings<T> settings, CancellationToken cancellationToken)where T : struct
Parameters
IProfileInstance
profileInstance
|
WeightHandler<T>
weightHandler
|
RouterPoint[]
sources
|
RouterPoint[]
targets
|
RoutingSettings<T>
settings
|
CancellationToken
cancellationToken
|
Returns
Result<EdgePath<T>[][]>
|
Type Parameters
T
|
Overrides
TryCalculateRaw<T>(IProfileInstance, WeightHandler<T>, Int64, Int64, RoutingSettings<T>, CancellationToken)
Calculates a route between the two directed edges. The route starts in the direction of the edge and ends with an arrive in the direction of the target edge.
Declaration
public override sealed Result<EdgePath<T>> TryCalculateRaw<T>(IProfileInstance profileInstance, WeightHandler<T> weightHandler, long sourceDirectedEdge, long targetDirectedEdge, RoutingSettings<T> settings, CancellationToken cancellationToken)where T : struct
Parameters
IProfileInstance
profileInstance
|
WeightHandler<T>
weightHandler
|
System.Int64
sourceDirectedEdge
|
System.Int64
targetDirectedEdge
|
RoutingSettings<T>
settings
|
CancellationToken
cancellationToken
|
Returns
Result<EdgePath<T>>
|
Type Parameters
T
|
Overrides
TryCalculateWeight<T>(IProfileInstance, WeightHandler<T>, RouterPoint[], RouterPoint[], ISet<Int32>, ISet<Int32>, RoutingSettings<T>, CancellationToken)
Calculates all routes between all sources and all targets.
Declaration
public override sealed Result<T[][]> TryCalculateWeight<T>(IProfileInstance profileInstance, WeightHandler<T> weightHandler, RouterPoint[] sources, RouterPoint[] targets, ISet<int> invalidSources, ISet<int> invalidTargets, RoutingSettings<T> settings, CancellationToken cancellationToken)where T : struct
Parameters
IProfileInstance
profileInstance
|
WeightHandler<T>
weightHandler
|
RouterPoint[]
sources
|
RouterPoint[]
targets
|
ISet<System.Int32>
invalidSources
|
ISet<System.Int32>
invalidTargets
|
RoutingSettings<T>
settings
|
CancellationToken
cancellationToken
|
Returns
Result<T[][]>
|
Type Parameters
T
|
Overrides
TryCheckConnectivity(IProfileInstance, RouterPoint, Single, Nullable<Boolean>, CancellationToken)
Checks if the given point is connected to the rest of the network. Use this to detect points on routing islands.
Declaration
public override sealed Result<bool> TryCheckConnectivity(IProfileInstance profileInstance, RouterPoint point, float radiusInMeter, bool ? forward, CancellationToken cancellationToken)
Parameters
IProfileInstance
profileInstance
|
RouterPoint
point
|
System.Single
radiusInMeter
The radius metric, that's always a distance in meters. |
System.Nullable<System.Boolean>
forward
|
CancellationToken
cancellationToken
|
Returns
Result<System.Boolean>
|
Overrides
TryResolve(IProfileInstance[], Single, Single, Func<RoutingEdge, Boolean>, Single, ResolveSettings, CancellationToken)
Searches for the closest point on the routing network that's routable for the given profiles.
Declaration
public override sealed Result<RouterPoint> TryResolve(IProfileInstance[] profileInstances, float latitude, float longitude, Func<RoutingEdge, bool> isBetter, float maxSearchDistance, ResolveSettings settings, CancellationToken cancellationToken)
Parameters
IProfileInstance[]
profileInstances
|
System.Single
latitude
|
System.Single
longitude
|
Func<RoutingEdge, System.Boolean>
isBetter
|
System.Single
maxSearchDistance
|
ResolveSettings
settings
|
CancellationToken
cancellationToken
|
Returns
Result<RouterPoint>
|