![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
Persistent cache class.
Holds settings used to initialise the persistent cache of a TSLMapDataLayer.
Use the 'loadFromIniFile' method to load settings from an existing persistent cache ini file.
Public Member Functions | |
TSLPersistentCacheData () | |
bool | checkValidityDuringIdle () const |
void | checkValidityDuringIdle (bool newVal) |
void | destroy () |
const char * | directory () const |
void | directory (const char *newVal) |
bool | flushDuringIdle () const |
void | flushDuringIdle (bool newVal) |
int | garbagePercentage () const |
void | garbagePercentage (int newVal) |
bool | indexEveryUpdate () const |
void | indexEveryUpdate (bool newVal) |
bool | loadFromIniFile (const char *fileName, const char *section) |
bool | maxCompression () const |
void | maxCompression (bool newVal) |
int | maxSizeMB () const |
void | maxSizeMB (int newVal) |
const char * | sortOrder () const |
void | sortOrder (const char *newVal) |
TSLTMC | tmcUnit () const |
void | tmcUnit (TSLTMC newVal) |
void * | operator new (size_t size) TSL_NO_THROW |
void * | operator new (size_t size, char *filename, int line) |
TSLPersistentCacheData::TSLPersistentCacheData | ( | ) |
bool TSLPersistentCacheData::checkValidityDuringIdle | ( | ) | const |
Returns the checkValidityDuringIdle flag.
If this flag is true, then during idle processing, tiles that are in the cache but have not been used this session are checked for validity in case they are needed.
void TSLPersistentCacheData::checkValidityDuringIdle | ( | bool | newVal | ) |
Sets the checkValidityDuringIdle flag.
If this flag is true, then during idle processing, tiles that are in the cache but have not been used this session are checked for validity in case they are needed.
newVal | value required for the checkValidityDuringIdle flag |
void TSLPersistentCacheData::destroy | ( | ) |
Destroy method. This should be called rather than deleting the persistent cache object, since the calls are redirected internally to MapLink.
const char * TSLPersistentCacheData::directory | ( | ) | const |
Returns the directory where the persistent tiles should be stored. Any environment variables specified in this path are expanded.
void TSLPersistentCacheData::directory | ( | const char * | newVal | ) |
Sets the directory where the persistent tiles should be stored. Any environment variables specified in this path are expanded.
newVal | value for the directory |
bool TSLPersistentCacheData::flushDuringIdle | ( | ) | const |
Returns the flush during idle flag.
If this flag is true, then the persistent cache is flushed during idle processing.
void TSLPersistentCacheData::flushDuringIdle | ( | bool | newVal | ) |
Sets the flush during idle flag.
If this flag is true, then the persistent cache is flushed during idle processing.
newVal | value required for the flushDuringIdle flag. |
int TSLPersistentCacheData::garbagePercentage | ( | ) | const |
Returns the percentage of the cache that is freed during a flush.
For example, if this value was 10, then the cache would be reduced to 90% of its maximum size when flushed. The tiles would be deleted based upon the priority sort order.
void TSLPersistentCacheData::garbagePercentage | ( | int | newVal | ) |
Sets the percentage of the cache that is freed during a flush.
For example, if this value was 10, then the cache would be reduced to 90% of its maximum size when flushed. The tiles would be deleted based upon the priority sortOrder specified above.
newVal | the value required |
bool TSLPersistentCacheData::indexEveryUpdate | ( | ) | const |
Returns the indexEveryUpdate flag.
This flag indicates whether the cache index should be written whenever it needs updating. This will affect performance when the cache is large, or the file system slow, but may be necessary if the system cannot be closed cleanly. The index is usually written when the TSLMapDataLayer is deleted.
void TSLPersistentCacheData::indexEveryUpdate | ( | bool | newVal | ) |
Sets the indexEveryUpdate flag.
This flag indicates whether the cache index should be written whenever it needs updating. This will affect performance when the cache is large, or the file system slow, but may be necessary if the system cannot be closed cleanly. The index is usually written when the TSLMapDataLayer is deleted.
newVal | required value for the indexEveryUpdate flag |
bool TSLPersistentCacheData::loadFromIniFile | ( | const char * | fileName, |
const char * | section ) |
Loads the persistent cache settings from an existing persistent cache ini file.
The configuration file should be of the form:
The entries in the configuration file are:
fileName | This is the name of configuration file. The file must be local, not remote. The filename may be absolute, or the file may be found in the system path or maplink path search directories. |
section | This is the section within the configuration file. In the example above, this is "persistent cache". |
bool TSLPersistentCacheData::maxCompression | ( | ) | const |
Returns the maxCompression flag.
If this flag is true, then the tiles are stored in the cache as if the 'optimise for size' flag was set in the processing tool. Note that this only has an effect if the tile was optimised when created, although this can be applied if optimised for speed.
void TSLPersistentCacheData::maxCompression | ( | bool | newVal | ) |
Sets the maxCompression flag.
If this flag is true, then the tiles are stored in the cache as if the 'optimise for size' flag was set in the processing tool. Note that this only has an effect if the tile was optimised when created, although this can be applied if optimised for speed.
newVal | value required for the maxCompression flag |
int TSLPersistentCacheData::maxSizeMB | ( | ) | const |
Returns the maximum size of the persistent cache, in MB.
void TSLPersistentCacheData::maxSizeMB | ( | int | newVal | ) |
Sets the maximum size of the persistent cache, in MB.
newVal | required size in MB. |
void * TSLPersistentCacheData::operator new | ( | size_t | size | ) |
Allocation override for API redirection
void * TSLPersistentCacheData::operator new | ( | size_t | size, |
char * | filename, | ||
int | line ) |
When included in an MFC application 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 user's application may be in debug mode.
const char * TSLPersistentCacheData::sortOrder | ( | ) | const |
Returns the string defining the priority order for sorting tiles.
When flushing the cache, tiles of a lower priority will be flushed first. Each letter in the string represents a boolean condition used when sorting. 'V' is whether the tile has been validated or not. 'A' is the last access time - more recent is a higher priority. 'C' is the number of times the tile has been accessed whilst in the cache. 'S' is the size of the tile - larger is considered more important to cache. The order of these letters in the string indicates the relative priority of these conditions. The example 'VACS' sorts first by tile validity, then by last access time, then by access count and finally by tile size.
void TSLPersistentCacheData::sortOrder | ( | const char * | newVal | ) |
Sets the string defining the priority order for sort tiles.
When flushing the cache, tiles of a lower priority will be flushed first. Each letter in the string represents a boolean condition used when sorting. 'V' is whether the tile has been validated or not. 'A' is the last access time - more recent is a higher priority. 'C' is the number of times the tile has been accessed whilst in the cache. 'S' is the size of the tile - larger is considered more important to cache. The order of these letters in the string indicates the relative priority of these conditions. The example 'VACS' sorts first by tile validity, then by last access time, then by access count and finally by tile size.
newVal | the required priority order. |
TSLTMC TSLPersistentCacheData::tmcUnit | ( | ) | const |
Returns the optimisation scale factor.
This value is used when the maxCompression flag is true. It represents the 'Optimisation scale factor' which would be entered in the MapLink Processing tool.
void TSLPersistentCacheData::tmcUnit | ( | TSLTMC | newVal | ) |
Sets the optimisation scale factor.
newVal | new scale factor. |
This value is used when the maxCompression flag is true. It represents the 'Optimisation scale factor' which would be entered in the MapLink Processing tool.