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

Detailed Description

Manager class that allows limited multithreaded use of a single TSLMapDataLayer. The manager contains a pool of data layers that may be used in different threads. All data layers share a single cache.

An application's thread should request a TSLPooledMapDataLayer from the manager when needed, and return it to the manager when the layer is no longer required. Each thread should request a seperate TSLPooledMapDataLayer.

Applications using this class must enable threaded rendering support in MapLink by calling TSLUtilityFunctions::setThreadedOptions() with the argument TSLThreadedOptionsRenderingSupport before creating the manager.

NOTE: Only methods explicity marked as thread safe are thread safe.

Public Member Functions

 TSLPooledMapDataLayerManager (int count, const char *mapLocation, TSLPathList *pthList, unsigned int peakSize)
 
TSLPooledMapDataLayerassignLayer ()
 
const TSLMapDataLayermasterLayer () const
 
void * operator new (size_t size) TSL_NO_THROW
 Allocation redirection for API.
 
void * operator new (size_t size, char *filename, int line)
 
- Public Member Functions inherited from TSLPooledMapDataLayerManagerBase
void destroy ()
 
bool isValid () const
 
void returnLayer (TSLPooledMapDataLayer *layer)
 

Additional Inherited Members

- Protected Member Functions inherited from TSLPooledMapDataLayerManagerBase
 TSLPooledMapDataLayerManagerBase ()
 
 ~TSLPooledMapDataLayerManagerBase ()
 

Constructor & Destructor Documentation

◆ TSLPooledMapDataLayerManager()

TSLPooledMapDataLayerManager::TSLPooledMapDataLayerManager ( int count,
const char * mapLocation,
TSLPathList * pthList,
unsigned int peakSize )

Constructs a new pooled layer manager for the given map.

Parameters
countTotal number of threaded data layers to create in the pool. This number may not be subsequently changed.
mapLocationPath to the map to be used.
pthListOptional pathlist to use in conjunction with the TSLMapDataLayer.
peakSizeNominal maximum size of the shared data layer cache in kilobytes. The manager will attempt to keep memory usage to within this value.

Member Function Documentation

◆ assignLayer()

TSLPooledMapDataLayer * TSLPooledMapDataLayerManager::assignLayer ( )

Assigns a threaded map data layer from the pool of available layers. Returns NULL if no layer is available. These layers are not in themselves thread safe, you should request one layer from the manager per thread.

The threaded map data layer must be returned to the manager through the returnLayer method on TSLPooledMapDataLayerManagerBase once it is no longer required.

This method is thread-safe.

◆ masterLayer()

const TSLMapDataLayer * TSLPooledMapDataLayerManager::masterLayer ( ) const

Returns the master map data layer that the threaded layers are impersonating.

The returned layer must not be used in a multi-threaded context under any circumstances.

◆ operator new() [1/2]

void * TSLPooledMapDataLayerManager::operator new ( size_t size)

Allocation redirection for API.

◆ operator new() [2/2]

void * TSLPooledMapDataLayerManager::operator new ( size_t size,
char * filename,
int line )

When included in an MFC applicaton in debug mode, the debug new expects this to be here. Override it and return the same as the normal one. The library must include it when compiled in release mode, since the users application may be in debug mode.