![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
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) | |
TSLPooledMapDataLayer * | assignLayer () |
const TSLMapDataLayer * | masterLayer () const |
void * | operator new (size_t size) TSL_NO_THROW |
Allocation redirection for API. | |
void * | operator new (size_t size, char *filename, int line) |
![]() | |
void | destroy () |
bool | isValid () const |
void | returnLayer (TSLPooledMapDataLayer *layer) |
Additional Inherited Members | |
![]() | |
TSLPooledMapDataLayerManagerBase () | |
~TSLPooledMapDataLayerManagerBase () | |
TSLPooledMapDataLayerManager::TSLPooledMapDataLayerManager | ( | int | count, |
const char * | mapLocation, | ||
TSLPathList * | pthList, | ||
unsigned int | peakSize ) |
Constructs a new pooled layer manager for the given map.
count | Total number of threaded data layers to create in the pool. This number may not be subsequently changed. |
mapLocation | Path to the map to be used. |
pthList | Optional pathlist to use in conjunction with the TSLMapDataLayer. |
peakSize | Nominal maximum size of the shared data layer cache in kilobytes. The manager will attempt to keep memory usage to within this value. |
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.
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.
void * TSLPooledMapDataLayerManager::operator new | ( | size_t | size | ) |
Allocation redirection for API.
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.