ChamplainTileCache

ChamplainTileCache — A base class of tile caches

Synopsis

                    ChamplainTileCache;
gboolean            champlain_tile_cache_get_persistent (ChamplainTileCache *tile_cache);
void                champlain_tile_cache_store_tile     (ChamplainTileCache *tile_cache,
                                                         ChamplainTile *tile,
                                                         const gchar *contents,
                                                         gsize size);
void                champlain_tile_cache_refresh_tile_time
                                                        (ChamplainTileCache *tile_cache,
                                                         ChamplainTile *tile);
void                champlain_tile_cache_on_tile_filled (ChamplainTileCache *tile_cache,
                                                         ChamplainTile *tile);
void                champlain_tile_cache_clean          (ChamplainTileCache *tile_cache);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----ChamplainMapSource
               +----ChamplainTileCache
                     +----ChamplainFileCache

Properties

  "persistent-cache"         gboolean              : Read / Write / Construct Only

Description

This class defines properties and methods common to all caches (that is, map sources that permit storage and retrieval of tiles). Tiles are typically stored by ChamplainTileSource objects.

Details

ChamplainTileCache

typedef struct _ChamplainTileCache ChamplainTileCache;


champlain_tile_cache_get_persistent ()

gboolean            champlain_tile_cache_get_persistent (ChamplainTileCache *tile_cache);

Gets cache persistency information.

tile_cache :

a ChamplainTileCache

Returns :

TRUE when the cache is persistent; FALSE otherwise.

Since 0.6


champlain_tile_cache_store_tile ()

void                champlain_tile_cache_store_tile     (ChamplainTileCache *tile_cache,
                                                         ChamplainTile *tile,
                                                         const gchar *contents,
                                                         gsize size);

Stores the tile including the metadata into the cache.

tile_cache :

a ChamplainTileCache

tile :

a ChamplainTile

contents :

the tile contents that should be stored

size :

size of the contents in bytes

Since 0.6


champlain_tile_cache_refresh_tile_time ()

void                champlain_tile_cache_refresh_tile_time
                                                        (ChamplainTileCache *tile_cache,
                                                         ChamplainTile *tile);

Refreshes the tile access time in the cache.

tile_cache :

a ChamplainTileCache

tile :

a ChamplainTile

Since 0.6


champlain_tile_cache_on_tile_filled ()

void                champlain_tile_cache_on_tile_filled (ChamplainTileCache *tile_cache,
                                                         ChamplainTile *tile);

When a cache fills a tile and the next source in the chain is a tile cache, it should call this function on the next source. This way all the caches preceding a tile source in the chain get informed that the tile was used and can modify their metadata accordingly in the implementation of this function. In addition, the call of this function should be chained so within the implementation of this function it should be called on the next source in the chain when next source is a tile cache.

tile_cache :

a ChamplainTileCache

tile :

a ChamplainTile

Since 0.6


champlain_tile_cache_clean ()

void                champlain_tile_cache_clean          (ChamplainTileCache *tile_cache);

Erases the contents of the cache. This function will fail when the cache is not temporary.

tile_cache :

a ChamplainTileCache

Since 0.6

Property Details

The "persistent-cache" property

  "persistent-cache"         gboolean              : Read / Write / Construct Only

Determines whether the cache is persistent or temporary (cleaned upon destruction)

Default value: TRUE

Since 0.6