MapImageCacheManager

Since: BlackBerry 10.2.0

#include <bb/cascades/maps/MapImageCacheManager>

To link against this class, add the following line to your .pro file: LIBS += -lbbcascadesmaps

Provides management actions on a cache of static map images.

Caching of map images occurs when using MapImageGenerator. The management functions within this manager (for example setCacheEnable(bool enable), setTotalDataLimit(int newLimit)) work globally on a single shared cache. Thus, even if multiple instances of this manager are created, they all manage a single shared cache instance. Also, there is no reference counting on enabling/disabling of cache.

By default, the cache is enabled. By default, the amount of space that map image content can take up is 2 megabytes.

The total limit size can be modified but it cannot go beyond the maximum value of 10 megabytes.


Overview

Public Functions Index

Public Functions

MapImageCacheManager ()

Default Constructor.

Since:

BlackBerry 10.2.0

~MapImageCacheManager ()

Destructor.

Since:

BlackBerry 10.2.0

bool clearCache ()

Clears the cache contents.

Return:

true if clearing operation completed with no errors, false otherwise.

Since:

BlackBerry 10.2.0

bool isCacheEnabled ()

Specifies whether this cache is currently enabled or not.

Return:

true if cache is enabled.

Since:

BlackBerry 10.2.0

void resetCacheEnabled ()

Resets the enabling capability on this cache, to the default value.

The default value is to enable this cache.

Since:

BlackBerry 10.2.0

void resetTotalDataLimit ()

Resets the amount of space that map image data can take to the default value.

Since:

BlackBerry 10.2.0

void setCacheEnabled (
  • boolenable)

Enables (or disables) the cache.

Parameters
enable

true if cache should be enabled, false otherwise.

Since:

BlackBerry 10.2.0

void setTotalDataLimit (
  • intnewLimit)

Sets the new limit on how much space local files can occupy on disk.

Setting a new limit may affect contents of the cache.

For example, when the new limit value is less than current cache cost, then deletion of existing cache entries will happen automatically.

Setting the limit to a value larger than the maximum possible value of 10 megabytes will result in a data limit of 10 megabytes.

Parameters
newLimit

The new limit (in bytes) for the total size of all data image files on disk.

Since:

BlackBerry 10.2.0

int totalDataLimit ()

Returns the amount of space (in bytes) that map image data can take on disk.

Return:

The current limit size (in bytes).

Since:

BlackBerry 10.2.0

Last modified: 2014-03-13

comments powered by Disqus