MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLPooledMapDataLayer Class Reference
Inheritance diagram for TSLPooledMapDataLayer:

Detailed Description

This class provides a subset of the functionality available from a TSLMapDataLayer. The primary difference between this class and the TSLMapDataLayer is that all TSLPooledMapDataLayers assigned from a single TSLPooledMapDataLayerManager share a single tile cache. This allows for improved efficiency when performing heavily threaded access to a MapLink map.

Pooled map data layers are not thread safe. You should request one layer per thread from the manager.

Do not pass this layer to any MapLink API functions not explicitly listed here as the results of doing so are undefined.

The only supported uses where this layer can be used with MapLink functions that accept a TSLDataLayer are as follows:

  • Adding to a drawing surface for drawing as part of a normal draw
  • TSLDataLayer::findEntity provided acquireCacheToken() is called beforehand. Ensure you hold on to the cache token for the smallest amount of time possible. Releasing the token invalidates any objects returned from findEntity().

All other treatment of this class as a normal TSLDataLayer is not supported and may result in undefined behaviour or application crashes.

Public Member Functions

bool acquireCacheToken ()
 
TSLEntityfindEntityID (TSLEntityID entityID, TSLSLMEntityRefHandler *handler)
 
const char * layerName () const
 Each layer is assigned a unique random name. This method queries that name.
 
void releaseCacheToken ()
 
TSLThreadedMapQuerythreadedQuery (TSLTMC x1, TSLTMC y1, TSLTMC x2, TSLTMC y2, int depth=-1, const char *featureName=NULL, int drawingSurfaceID=-1) const
 
TSLThreadedMapQuerythreadedQuery (TSLTMC x1, TSLTMC y1, TSLTMC x2, TSLTMC y2, TSLSelector *selector, int drawingSurfaceID=-1) const
 
- Public Member Functions inherited from TSLDataLayer
void addDrawingCallback (TSLDataLayerDrawingCallback *drawingCallback)
 
bool addFeatureRendering (const char *featureName, TSLFeatureID featureID)
 
bool addLoader (TSLFileLoader *loader, TSLLoaderAppCallback callback, void *arg, TSLAllLoadedCallback allLoadedCallback=0, void *arg2=0)
 
bool addPathList (const TSLPathList *path_list)
 
void cancelFlashback ()
 
bool clearFeatureRendering (const char *featureName, TSLFeatureID featureID)
 
TSLDataHandlercreateDataHandler (const char *config_file=0)
 
TSLHistoryVersion currentVersion () const
 
TSLDataHandlerdataHandler ()
 
const TSLDataHandlerdataHandler () const
 
void destroy ()
 
bool entityIsVisible (const TSLEntity *entity, const TSLDrawingSurface *drawingSurface) const
 
const TSLFeatureClassListfeatureList () const
 
const TSLFeatureClassListfeatureList (const char *detailLayerName) const
 
bool fileModificationTime (const char *filename, TSLTimeType &lastModificationTime)
 
TSLEntityfindEntity (TSLTMC x, TSLTMC y, TSLTMC aperture, int depth, const char *featureName=0, int drawingSurfaceID=-1)
 
bool findFile (const char *filename, TSLSimpleString &foundPath) const
 
void flashbackToTimestamp (TSLHistoryTimestamp timestamp, TSLLayerArchiveCallback archiveCallback, void *arg=0)
 
void flashbackToTimestamp (TSLHistoryTimestamp timestamp, TSLLayerArchiveTileCallback archiveTileCallback, void *arg=0)
 
void flashbackToVersion (TSLHistoryVersion version, TSLLayerArchiveCallback archiveCallback, void *arg=0)
 
void flashbackToVersion (TSLHistoryVersion version, TSLLayerArchiveTileCallback archiveTileCallback, void *arg=0)
 
bool getActiveLayerName (const TSLEnvelope &extent, double screenResolution, TSLSimpleString &activeLayerName) const
 
TSLEntityIteratorgetEntityIterator (const char *detailLayer, TSLSelector *selector=NULL, TSLEnvelope *extent=NULL, bool splitOptimisedPrimitives=true)
 
bool getFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeInt attribute, int *result) const
 
bool getFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeDouble attribute, double *result) const
 
bool getFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeBool attribute, bool *result) const
 
bool getFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributes *result) const
 
TSLFileLoadergetLoader ()
 
bool getMUExtent (double *x1, double *y1, double *x2, double *y2, int drawingSurfaceID=-1) const
 
bool getTMCExtent (TSLTMC *x1, TSLTMC *y1, TSLTMC *x2, TSLTMC *y2, int drawingSurfaceID=-1) const
 
bool getUUExtent (double *x1, double *y1, double *x2, double *y2, const TSLDrawingSurface *drawingSurface) const
 
bool importHistory (TSLHistoryVersion mapVersion, TSLHistoryTimestamp timestamp, TSLHistoryImportSet *historySet)
 
bool latLongToTMC (double latitude, double longitude, TSLTMC *x, TSLTMC *y, bool local=false) const
 
bool latLongToTMC (int num, double *latitudes, double *longitudes, TSLTMC *xs, TSLTMC *ys, bool local=false) const
 
TSLDataLayerTypeEnum layerType () const
 
bool loadData (const char *filename)
 
bool loadRendering (const char *filename)
 
void notifyChanged (bool changed=true)
 
TSLMapQueryquery (TSLTMC x1, TSLTMC y1, TSLTMC x2, TSLTMC y2, int depth=-1, const char *featureName=NULL, int drawingSurfaceID=-1) const
 
TSLMapQueryquery (TSLTMC x1, TSLTMC y1, TSLTMC x2, TSLTMC y2, TSLSelector *selector, int drawingSurfaceID=-1) const
 
const TSLCoordinateSystemgetCoordinateSystem () const
 
bool queryVersionHistory (const TSLEnvelope &extent, TSLVersionHistorySet &history)
 
void refreshFlashback ()
 
bool removeData ()
 
void releaseResources (int surfaceID)
 
bool saveRendering (const char *filename, TSLMapLinkVersion ver=TSL_CURRENT_MAPLINK_VERSION)
 
bool setCoordinateSystem (const TSLCoordinateSystem *coordinateSystem)
 
bool setFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeInt attribute, int value)
 
bool setFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeDouble attribute, double value)
 
bool setFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributeBool attribute, bool value)
 
bool setFeatureRendering (const char *featureName, TSLFeatureID featureID, TSLRenderingAttributes *value)
 
bool TMCToLatLong (TSLTMC x, TSLTMC y, double *latitude, double *longitude, bool local=false, bool boundCheck=true) const
 
bool TMCToLatLong (int num, TSLTMC *xs, TSLTMC *ys, double *latitudes, double *longitudes, bool local=false) const
 
const TSLVersionHistorySetversionHistory () const
 

Member Function Documentation

◆ acquireCacheToken()

bool TSLPooledMapDataLayer::acquireCacheToken ( )

Assigns a cache token internally to the map layer. A layer can only have one cache token.

Calling this enables the following functions to be used on this layer:

As long as the cache token is held by the layer any pointers returned from the above functions will remain valid.

Any map tiles accessed during these functions will remain locked in memory until the cache token is released. Applications should therefore ensure the cache token is held for the smallest amount of time possible in order to avoid excessive memory use in multithreaded scenarios.

◆ findEntityID()

TSLEntity * TSLPooledMapDataLayer::findEntityID ( TSLEntityID entityID,
TSLSLMEntityRefHandler * handler )

An application must call acquireCacheToken on the layer before this function may be used.

Provides a thread-safe equivalent to TSLMapDataLayer::findEntityID. The returned pointer will remain valid until releaseCacheToken is called on the layer.

Note: This function is only thread safe if the provided TSLSLMEntityRefHandler is thread safe. Use a TSLThreadedSLMEntityRefHandlerFile in preference to a TSLSLMEntityRefHandlerFile.

◆ layerName()

const char * TSLPooledMapDataLayer::layerName ( ) const

Each layer is assigned a unique random name. This method queries that name.

◆ releaseCacheToken()

void TSLPooledMapDataLayer::releaseCacheToken ( )

Releases the internal cache token from the data layer (if any). Calling this automatically invalidates anything retrieved from the data layer by any of the methods listed in the documentation for acquireCacheToken().

◆ threadedQuery() [1/2]

TSLThreadedMapQuery * TSLPooledMapDataLayer::threadedQuery ( TSLTMC x1,
TSLTMC y1,
TSLTMC x2,
TSLTMC y2,
int depth = -1,
const char * featureName = NULL,
int drawingSurfaceID = -1 ) const

Thread-safe cache backed version of TSLDataLayer::query().

See the documentation for TSLDataLayer::query() for a list of argument descriptions.

Returned geometry will be held resident in memory for as long as the returned TSLThreadedMapQuery exists. Ensure that you delete this class as soon as possible in order to allow the map tiles to be released from memory.

This method will return NULL if the data layer has acquired a cache token through calling acquireCacheToken() that it has yet to release.

◆ threadedQuery() [2/2]

TSLThreadedMapQuery * TSLPooledMapDataLayer::threadedQuery ( TSLTMC x1,
TSLTMC y1,
TSLTMC x2,
TSLTMC y2,
TSLSelector * selector,
int drawingSurfaceID = -1 ) const

Thread-safe cache backed version of TSLDataLayer::query().

See the documentation for TSLDataLayer::query() for a list of argument descriptions.

Returned geometry will be held resident in memory for as long as the returned TSLThreadedMapQuery exists. Ensure that you delete this class as soon as possible in order to allow the map tiles to be released from memory.

This method will return NULL if the data layer has acquired a cache token through calling acquireCacheToken() that it has yet to release.