< Summary

Class:Itinero.Data.Usage.IDataUseListener
Assembly:Itinero
File(s):/home/runner/work/routing2/routing2/src/Itinero/Data/Usage/IDataUseListener.cs
Covered lines:0
Uncovered lines:3
Coverable lines:3
Total lines:50
Line coverage:0% (0 of 3)
Covered branches:0
Total branches:0
Tag:251_23667616543

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
IsVertexDataReady(...)100%10%

File(s)

/home/runner/work/routing2/routing2/src/Itinero/Data/Usage/IDataUseListener.cs

#LineLine coverage
 1using System.Threading;
 2using System.Threading.Tasks;
 3using Itinero.Network;
 4
 5namespace Itinero.Data.Usage;
 6
 7/// <summary>
 8/// Abstract definition of a data use listener.
 9/// </summary>
 10public interface IDataUseListener
 11{
 12    /// <summary>
 13    /// Clones this data use listener for a new network, if possible.
 14    /// </summary>
 15    /// <param name="routingNetwork">The routing network.</param>
 16    /// <returns>A new data use listener or null if not needed or possible.</returns>
 17    IDataUseListener? CloneForNewNetwork(RoutingNetwork routingNetwork);
 18
 19    /// <summary>
 20    /// Returns true if the data for the given vertex is ready and no async loading is needed.
 21    /// This is the fast path — called synchronously on every vertex during routing.
 22    /// When this returns true, <see cref="VertexTouched"/> will not be called for this vertex.
 23    /// </summary>
 24    /// <param name="network">The network.</param>
 25    /// <param name="vertex">The vertex being touched.</param>
 26    /// <returns>True if the vertex data is already available, false if async loading may be needed.</returns>
 27    bool IsVertexDataReady(RoutingNetwork network, VertexId vertex)
 028    {
 029        return false;
 030    }
 31
 32    /// <summary>
 33    /// Called when a vertex is touched and <see cref="IsVertexDataReady"/> returned false.
 34    /// </summary>
 35    /// <param name="network">The network.</param>
 36    /// <param name="vertex">The vertex that was touched.</param>
 37    /// <param name="cancellationToken">The cancellation token.</param>
 38    Task VertexTouched(RoutingNetwork network, VertexId vertex, CancellationToken cancellationToken = default);
 39
 40    /// <summary>
 41    /// Called when an area in general is going to be touched.
 42    /// </summary>
 43    /// <param name="network"></param>
 44    /// <param name="box"></param>
 45    /// <param name="cancellationToken">The cancellation token.</param>
 46    /// <returns></returns>
 47    Task BoxTouched(RoutingNetwork network,
 48        ((double longitude, double latitude, float? e) topLeft, (double longitude, double latitude, float? e)
 49            bottomRight) box, CancellationToken cancellationToken = default);
 50}

Methods/Properties

IsVertexDataReady(...)