MapDataStoreAccessSyncing
public protocol MapDataStoreAccessSyncing : AnyObject
Describe an interface of the synchronized access to onboard map data.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Registers an observer so it can be informed about changes in map availability. Caller must register their observer in order to get
onReadOnlyAccessGrantedaccess If the caller does not add an observer read access will not be granted . If the map is already available at the time of calling this,onReadOnlyAccessGrantedwill be called immediately, before this call returns. Caller of this function must not hold the same synchronisation primitive (mutex, lock or similar) which will be held inside callbacks inherited from ‘StoreAccessChangedObserver’. Otherwise, a deadlock may occur!Throws
NDSStoreAccessSync.SyncErrorinvalidObserverErrorupon adding the same observer more than once.Declaration
Swift
func addObserver(_ observer: StoreAccessChangedObserver) throwsParameters
observerobserver to add.
-
Unregisters an observer (if it was previously registered by
addObserver).After this function returns, it is guaranteed that no more callbacks will be received by this observer.
Caller of this function must not hold the same synchronisation primitive (mutex, lock or similar) which will be held inside callbacks inherited from ‘StoreAccessChangedObserver’. Otherwise, a deadlock may occur!
Declaration
Swift
func removeObserver(_ observer: StoreAccessChangedObserver)Parameters
observerobserver to remove.
-
Request to obtain write access (in addition to read access) to the map for the given observer. Upon calling this, all other currently registered observers will be asked to release read-only access (via
onReadOnlyAccessReleaseRequested) and this call will block until they do so or the time runs out (see: ‘timeout’ parameter).Throws
NDSStoreAccessSync.SyncError.InvalidObserverErrorupon attempting to request write access for a observer that wasn’t previously added viaaddObserver.Declaration
Swift
func requestWriteAccess(observer: StoreAccessChangedObserver, timeout: TimeInterval) throws -> WriteAccessStatusParameters
observerObserver which will be granted write access if the call is successful.
timeoutMaximum time to wait.
Return Value
WriteAccessStatus.grantedif the request was successful,.timedOutif the time ran out, or.grantedToAnotherif the request was cancelled because a different observer already has write access. -
Release write access previously obtained by
requestWriteAccess(and return to read-only).Throws
NDSStoreAccessSync.SyncError.InvalidObserverErrorupon attempting to release write access for a observer that wasn’t previously added viaaddObserveror didn’t previously obtain write access viarequestWriteAccess.Declaration
Swift
func releaseWriteAccess(observer: StoreAccessChangedObserver) throwsParameters
observerobserver that currently has write access to the map.
TomTom SDK for iOS (TomTomSDKMapMatchingEngineHybrid 0.38.0-rc01 Docs)
MapDataStoreAccessSyncing