ElectronicHorizonDataLoader
public class ElectronicHorizonDataLoader
extension ElectronicHorizonDataLoader: NativeBase
extension ElectronicHorizonDataLoader: Hashable
Loads map data for segments that belong to the ElectronicHorizonEngine paths.
Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.
Offline availability: This property is available online and offline.
-
Creates a new instance of
ElectronicHorizonDataLoader. The constructor accepts options to configure the data loader. For more information, seeSegmentDataLoaderOptions. The cache size limits the number of segments that the loader can keep in memory at the same time.Declaration
Swift
public init(sdkEngine: SDKNativeEngine, options: SegmentDataLoaderOptions, segmentDataCacheSize: Int32) throwsParameters
sdkEngineThe
SDKNativeEngineinstance that provides shared services, such as networking and map data.optionsThe
SegmentDataLoaderOptionsinstance that configures how segment data is requested.segmentDataCacheSizeThe maximum number of segments that the loader can cache.
-
Requests data for all added segments and removes cached data for segments that are not part of the horizon anymore.
Declaration
Swift
public func loadData(electronicHorizonUpdate: ElectronicHorizonUpdate)Parameters
electronicHorizonUpdateThe update that contains the segments to add to the cache and the segments to remove from the cache.
-
Returns loaded data for the given segment identifier. The result contains either the loaded data or an error code.
Declaration
Swift
public func getSegment(segmentId: DirectedOCMSegmentId) -> ElectronicHorizonDataLoaderResultParameters
segmentIdThe segment identifier for which to return the loaded data from the cache.
Return Value
The result object that contains either the loaded segment data or an error code.
-
Adds an
ElectronicHorizonDataLoaderStatusDelegateto the subscription list.Declaration
Swift
public func addElectronicHorizonDataLoaderStatusListener(electronicHorizonListener: ElectronicHorizonDataLoaderStatusDelegate)Parameters
electronicHorizonListenerThe listener that receives data loader status updates.
-
Removes an
ElectronicHorizonDataLoaderStatusDelegatefrom the subscription list.Declaration
Swift
public func removeElectronicHorizonDataLoaderStatusListener(electronicHorizonListener: ElectronicHorizonDataLoaderStatusDelegate)Parameters
electronicHorizonListenerThe listener that should no longer receive data loader status updates.