![]() |
![]() |
![]() |
libchamplain Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
ChamplainCache; ChamplainCacheClass; ChamplainCache* champlain_cache_dup_default (void); gboolean champlain_cache_fill_tile (ChamplainCache *self, ChamplainTile *tile); guint champlain_cache_get_size_limit (ChamplainCache *self); void champlain_cache_purge (ChamplainCache *self); void champlain_cache_purge_on_idle (ChamplainCache *self); void champlain_cache_set_size_limit (ChamplainCache *self, guint size_limit); gboolean champlain_cache_tile_is_expired (ChamplainCache *self, ChamplainTile *tile); void champlain_cache_update_tile (ChamplainCache *self, ChamplainTile *tile, guint filesize);
ChamplainCache is an object to interogate the cache for previously downloaded tiles. ChamplainCache is a singleton, there should be only one instance shared by all map sources.
Tiles most frequently asked gain in "popularity". This popularity will be taken into account when purging the cache.
Unless you are implementing your own ChamplainMapSource, the only function you should need are champlain_cache_purge and champlain_cache_purge_on_idle.
ChamplainCache* champlain_cache_dup_default (void);
Returns : |
the ChamplainCache singleton, use g_object_unref when not neeeded anymore. |
Since 0.4
gboolean champlain_cache_fill_tile (ChamplainCache *self, ChamplainTile *tile);
Loads data from disk for the given tile
|
the ChamplainCache |
|
the ChamplainTile to fill |
Returns : |
TRUE if the tile was in cache, false if it needs to be loaded from network |
Since 0.4
guint champlain_cache_get_size_limit (ChamplainCache *self);
|
the ChamplainCache |
Returns : |
the cache size limit in bytes |
Since 0.4
void champlain_cache_purge (ChamplainCache *self);
Purge the cache from the less popular tiles until cache's size limit is reached.
|
the ChamplainCache |
Since 0.4
void champlain_cache_purge_on_idle (ChamplainCache *self);
Purge the cache from the less popular tiles until cache's size limit is reached. This is a non blocking call as the purge will happen when the application is idle
|
the ChamplainCache |
Since 0.4
void champlain_cache_set_size_limit (ChamplainCache *self, guint size_limit);
Sets the cache size limit in bytes
|
the ChamplainCache |
|
the cache limit in bytes |
Since 0.4
gboolean champlain_cache_tile_is_expired (ChamplainCache *self, ChamplainTile *tile);
|
the ChamplainCache |
|
the ChamplainTile to fill |
Returns : |
TRUE if the tile should be reloaded from network, FALSE otherwize. |
Since 0.4
void champlain_cache_update_tile (ChamplainCache *self, ChamplainTile *tile, guint filesize);
Update the tile's information in the cache such as Etag and filesize. Also increase the tile's popularity.
|
the ChamplainCache |
|
the ChamplainTile to fill |
|
the filesize on the disk |
Since 0.4
"size-limit"
property"size-limit" guint : Read / Write
The cache size limit in bytes.
Note: this new value will not be applied until you call champlain_cache_purge
Allowed values: [1,G_MAXINT]
Default value: 100000000
Since 0.4