TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

interface IDataCacheObject in Tinman.Core.Caching

Base interface for source data objects that can be cached by a DataCache object.

interface IDataCacheObject  

Methods

CacheEvictPage

A used cache page is about to be evicted from the cache.

method CacheEvictPage (int32 cacheIndex, bool released)
params cacheIndex Index of the cache page that is about to be evicted.
  released Is the cache page being released via Release or SourceIdRelease (true), or is it the least-recently used, non-locked page is being evicted during a call to Access ( false)?

CacheReadPage

Reads data from this source data object and stores it in the given cache page.

method CacheReadPage (int32 cacheIndex, int64 sourceIndex, int32 partially)
params cacheIndex Index of the cache page where to store the data.
  sourceIndex Index of the source page to read from (54-bit).
  partially 0: Load partial page (overwrite given cache page)
1: Load full page (overwrite given cache page)
2: Finish loading of partial page (complete given cache page)

Remarks:

Before this method is called, the DataCache releases the current lock(see End). After this method has returned, the lock is reacquired (see Begin). Access to the cache page at cacheIndex is guaranteed to the thread-safe.

CacheRecyclePage

Checks the given cache page can be reused by this source data object.

method CacheRecyclePage (int32 cacheIndex, bool populatedByMe)
type bool
params cacheIndex Index of the cache page that is to be evicted resp. reused.
  populatedByMe true it the cache page slot has been populated by this data cache object, false if another data cache object has populated it or if it is still empty.
returns true if the data cache object will recycle and reuse the cache slot value, false if it will create a new one (the cache slot will be cleared before CacheReadPage in that case, via ClearPage).

Remarks:

Iff the cache page can be reused (i.e. the method returns true), the cache page content may be modified by this method.

CacheWritePage

A dirty cache page must be written to the source data object.

method CacheWritePage (int32 cacheIndex, int64 sourceIndex, bool partially)
params cacheIndex Index of the cache page that holds the data.
  sourceIndex Index of the source page to write to (54-bit).
  partially Has the source page been loaded partially only?

Remarks:

Before this method is called, the DataCache releases the current lock(see End). After this method has returned, the lock is reacquired (see Begin). Access to the cache page at cacheIndex is guaranteed to the thread-safe.