ElectronicHorizonDataLoader
public class ElectronicHorizonDataLoader
extension ElectronicHorizonDataLoader: NativeBase
extension ElectronicHorizonDataLoader: Hashable
Class that is responsible to load data for the ElectronicHorizon provided segments.
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.
-
The constructor accepts mapdata options to configure the data loader. See
SegmentDataLoaderOptionsfor details. The cache size can be specified to limit the number of segments that can be cached.Throws
InstantiationErrorIndicates what went wrong when the instantiation was attempted.Declaration
Swift
public init(sdkEngine: SDKNativeEngine, options: SegmentDataLoaderOptions, segmentDataCacheSize: Int32) throwsParameters
sdkEngineA SDKEngine instance.
optionsRequest options.
segmentDataCacheSizeNumber of segments that can be cached.
-
Request data for all added segments and remove cached data for segments which are not part of the horizon anymore.
Declaration
Swift
public func loadData(electronicHorizonUpdate: ElectronicHorizonUpdate)Parameters
electronicHorizonUpdateList of segments to add and to remove from cache.
-
This method will return loaded data for the given segment ID. Returned object contains either the loaded data or an error code.
Declaration
Swift
public func getSegment(segmentId: OCMSegmentId) -> ElectronicHorizonDataLoaderResultParameters
segmentIdThe segment id to load from cache.
Return Value
Returned object contains either the loaded data or an error code.
-
Adds the
ElectronicHorizonDataLoaderStatusDelegateto the subscribtion list.Declaration
Swift
public func addElectronicHorizonDataLoaderStatusListener(electronicHorizonListener: ElectronicHorizonDataLoaderStatusDelegate)Parameters
electronicHorizonListenerListener to be added to the electronic horizon data loader status updates.
-
Removes the
ElectronicHorizonDataLoaderStatusDelegatefrom the subscribtion list.Declaration
Swift
public func removeElectronicHorizonDataLoaderStatusListener(electronicHorizonListener: ElectronicHorizonDataLoaderStatusDelegate)Parameters
electronicHorizonListenerListener to be removed from the electronic horizon data loader status updates.