ArcGIS Procedural Runtime
3.2.10650
|
#include <Cache.h>
Public Types | |
enum | PersistentBlobType { CACHE_TYPE_IMAGE_METADATA, CACHE_TYPE_PIXELDATA } |
Public Member Functions | |
virtual void | flushAll ()=0 |
virtual void | flushContentType (ContentType type)=0 |
virtual void | flushEntry (ContentType type, const wchar_t *key)=0 |
virtual const void * | getPersistentBlob (PersistentBlobType type, const wchar_t *key, size_t *size) const =0 |
virtual const void * | getTransientBlob (ContentType type, const wchar_t *key) const =0 |
virtual const void * | insertAndGetTransientBlob (ContentType type, const wchar_t *key, const void *ptr)=0 |
virtual void | insertPersistentBlobAndLock (PersistentBlobType type, const wchar_t *key, const void *data, size_t size)=0 |
virtual void | releasePersistentBlob (PersistentBlobType type, const wchar_t *key)=0 |
virtual void | releaseTransientBlob (ContentType type, const wchar_t *key)=0 |
virtual bool | tryLockPersistentBlobs (ContentType type, const wchar_t *key)=0 |
virtual void | unlockPersistentBlob (PersistentBlobType type, const wchar_t *key)=0 |
Static Protected Member Functions | |
static void | deleteTransientBlob (const void *ptr) |
The Cache interface is a callback interface which can be implemented by the client.
Procedural Runtime's internal databackend, which resolves URIs to texture/geometry/cgb/material resources, uses this interface to insert and lookup resolved resources.
A cache entry is identified with a unique string (key), typically an URI. There are two major types of cache entries:
Currently, persistent blobs are only implemented for textures. Persistent blobs can be locked and reserved: Locked means the Cache knows the content (and it's guaranteed that a call to getPersistentBlob() succeeds). Reserved means the Cache has the content in memory (and a pointer associated to it).
A number of cache implementations is provided in CacheObject.
Types of persistent blobs.
|
staticprotected |
|
pure virtual |
Releases all transient blobs stored in the cache. If a transient blob is not still referenced anywhere else in the Procedural Runtime and references permanent blobs in the cache, the permanent blobs are released from the cache. Is typically called from the client and must be thread-safe.
|
pure virtual |
Releases all transient blobs of a certain ContentType. If a transient blob is not still referenced anywhere else in the Procedural Runtime and references permanent blobs in the cache, the permanent blobs are released from the cache. Is typically called from the client and must be thread-safe.
type | Type of the resource. |
|
pure virtual |
Releases one specific transient blob from the cache. If a transient blob is not still referenced anywhere else in the Procedural Runtime and references permanent blobs in the cache, the permanent blobs are released from the cache. Is typically called from the client and must be thread-safe.
type | Type of the resource. |
key | Unique string to identify the resource. |
|
pure virtual |
Gets the pointer to a (locked) persistent blob plus its size. The pointer is guaranteed to stay valid ("reserved") until releasePersistentBlob() is called.
If (type, key) does not refer to a previously locked blob the behaviour is undefined.
type | Type of the resource. | |
key | Unique string to identify the resource. | |
[out] | size | Pointer to return the blob size in bytes. |
|
pure virtual |
If a pointer is returned: is guaranteed to stay valid until releaseTransientBlob() is called. releaseTransientBlob() must be called when the pointer is not used anymore.
type | Type of the resource. |
key | Unique string to identify the resource. |
|
pure virtual |
Inserts a transient blob and returns an equivalent transient blob. This can, but doesn't need to, be the inserted blob. The returned blob is guaranteed to stay valid until releaseTransientBlob() is called. releaseTransientBlob() must be called when the returned pointer is not used anymore. If the return value is different than the passed-in ptr, ptr was not inserted into and will not be used by the cache.
type | Type of the resource. |
key | Unique string to identify the resource. |
ptr | Pointer to a transient resource, |
|
pure virtual |
Inserts a persistent data blob connected to a key and locks it.
type | Type of the resource. |
key | Unique string to identify the resource. |
data | Pointer to data to insert. |
size | Size of data to insert in bytes. |
|
pure virtual |
Releases the pointer assigned to a persistent blob.
type | Type of the resource. |
key | Unique string to identify the resource. |
|
pure virtual |
Releases a previously locked transient blob.
type | Type of the resource. |
key | Unique string to identify the resource. |
|
pure virtual |
Tries to lock all persistent blobs associated with a (transient) key. If the layout + the permanent blobs are known to the cache, they are locked (i.e. prevented from being deleted from permanent storage).
type | Type of the resource. |
key | Unique string to identify the resource. |
|
pure virtual |
Unlocks a persistent blob. Unlocked blobs can be deleted from persistent storage, reserved pointers stay valid however.
type | Type of the resource. |
key | Unique string to identify the resource. |