OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
#include <ossimAppTileCache.h>
Classes | |
struct | ossimAppCacheTileInfo |
Public Types | |
typedef ossim_int32 | ossimAppCacheId |
typedef ossim_int32 | ossimTileId |
typedef map< ossimAppCacheId, ossimTileCache * >::iterator | AppIdIterator |
Public Member Functions | |
~ossimAppTileCache () | |
ossimAppCacheId | newTileCache (ossim_uint32 bucketSize=DEFAULT_BUCKET_SIZE) |
ossimDataObject * | get (ossimAppCacheId id, const ossimDpt3d &origin, ossim_uint32 resLevel=0) |
ossimRefPtr< ossimDataObject > | removeTile (ossimAppCacheId id, const ossimDpt3d &origin, unsigned long resLevel) |
ossimRefPtr< ossimDataObject > | insert (ossimAppCacheId id, const ossimDpt3d &origin, const ossimDataObject *data, ossim_uint32 resLevel=0) |
void | deleteCache (ossimAppCacheId appId) |
Static Public Member Functions | |
static ossimAppTileCache * | instance (ossim_uint32 maxSize=0) |
Static Public Attributes | |
static const ossim_uint32 | DEFAULT_SIZE = 80*1024*1024 |
static const ossim_uint32 | DEFAULT_BUCKET_SIZE = 293 |
Protected Member Functions | |
ossimAppTileCache (ossim_uint32 maxSize=DEFAULT_SIZE) | |
void | deleteAll () |
ossimTileCache * | get (ossimAppCacheId id) |
void | deleteAppCacheFromQueue (ossimAppCacheId appId) |
void | removeTileFromQueue (ossimAppCacheId appId, const ossimDpt3d &origin, ossim_uint32 resLevel) |
void | adjustQueue (ossimAppCacheId id, const ossimDpt3d &origin, ossim_uint32 resLevel) |
ossimRefPtr< ossimDataObject > | removeTile () |
Protected Attributes | |
map< ossimAppCacheId, ossimTileCache * > | theAppCache |
ossim_uint32 | theMaxGlobalCacheSize |
ossim_uint32 | theMaxCacheSize |
ossim_uint32 | theCurrentCacheSize |
list< ossimAppCacheTileInfo > | theUsedQueue |
Static Protected Attributes | |
static ossimAppTileCache * | theInstance = 0 |
static ossimAppCacheId | theUniqueAppIdCounter = 1 |
Definition at line 27 of file ossimAppTileCache.h.
typedef map<ossimAppCacheId, ossimTileCache*>::iterator ossimAppTileCache::AppIdIterator |
Definition at line 36 of file ossimAppTileCache.h.
Definition at line 34 of file ossimAppTileCache.h.
Definition at line 35 of file ossimAppTileCache.h.
ossimAppTileCache::~ossimAppTileCache | ( | ) |
|
inlineprotected |
Definition at line 104 of file ossimAppTileCache.h.
Referenced by instance().
|
protected |
Definition at line 284 of file ossimAppTileCache.cpp.
References theUsedQueue.
Referenced by get().
|
protected |
Definition at line 210 of file ossimAppTileCache.cpp.
References theAppCache.
Referenced by ~ossimAppTileCache().
|
protected |
will remove all occurances of the appId from the queue
Definition at line 246 of file ossimAppTileCache.cpp.
References theUsedQueue.
Referenced by deleteCache().
void ossimAppTileCache::deleteCache | ( | ossimAppCacheId | appId | ) |
This will delete the specified cache. The LRU queue will be updated accordingly
Definition at line 192 of file ossimAppTileCache.cpp.
References deleteAppCacheFromQueue(), ossimTileCache::sizeInBytes(), theAppCache, and theCurrentCacheSize.
ossimDataObject * ossimAppTileCache::get | ( | ossimAppCacheId | id, |
const ossimDpt3d & | origin, | ||
ossim_uint32 | resLevel = 0 |
||
) |
Will retrieve a tile from the cache. Will return NULL if not found.
Will retrieve a tile from the cache.
Definition at line 77 of file ossimAppTileCache.cpp.
References adjustQueue(), and ossimTileCache::get().
|
protected |
Used to get access to the App cache.
Definition at line 178 of file ossimAppTileCache.cpp.
References theAppCache.
ossimRefPtr< ossimDataObject > ossimAppTileCache::insert | ( | ossimAppCacheId | id, |
const ossimDpt3d & | origin, | ||
const ossimDataObject * | data, | ||
ossim_uint32 | resLevel = 0 |
||
) |
Will insert a tile into the cache.
Definition at line 124 of file ossimAppTileCache.cpp.
References ossimObject::dup(), ossimRefPtr< T >::get(), ossimDataObject::getDataSizeInBytes(), ossimTileCache::insert(), ossimNotify(), ossimNotifyLevel_WARN, removeTile(), theCurrentCacheSize, theMaxCacheSize, and theUsedQueue.
|
static |
We will force a singleton on this class.
Definition at line 28 of file ossimAppTileCache.cpp.
References DEFAULT_SIZE, ossimPreferences::findPreference(), ossimPreferences::instance(), ossimAppTileCache(), ossimNotify(), ossimNotifyLevel_NOTICE, theInstance, and ossimString::toUInt32().
ossimAppTileCache::ossimAppCacheId ossimAppTileCache::newTileCache | ( | ossim_uint32 | bucketSize = DEFAULT_BUCKET_SIZE | ) |
Will create a new Tile cache for this application. Will return 0 if not successful.
Definition at line 57 of file ossimAppTileCache.cpp.
References theAppCache, and theUniqueAppIdCounter.
ossimRefPtr< ossimDataObject > ossimAppTileCache::removeTile | ( | ossimAppCacheId | id, |
const ossimDpt3d & | origin, | ||
unsigned long | resLevel | ||
) |
Will remove a tile completly from the cache. The returned tile is no longer owned by the cache.
Definition at line 99 of file ossimAppTileCache.cpp.
References ossimDataObject::getDataSizeInBytes(), ossimTileCache::remove(), removeTileFromQueue(), theCurrentCacheSize, and ossimRefPtr< T >::valid().
|
protected |
will pop the queue and remove that tile from its cache and return it to the caller. This is used by the insert when the max cache size is exceeded.
Definition at line 264 of file ossimAppTileCache.cpp.
References ossimDataObject::getDataSizeInBytes(), ossimTileCache::remove(), ossimAppTileCache::ossimAppCacheTileInfo::theAppCacheId, theCurrentCacheSize, ossimAppTileCache::ossimAppCacheTileInfo::theOrigin, ossimAppTileCache::ossimAppCacheTileInfo::theResLevel, and theUsedQueue.
Referenced by insert().
|
protected |
Will remove a single instance of a tile from the queue.
Definition at line 223 of file ossimAppTileCache.cpp.
References theUsedQueue.
Referenced by removeTile().
|
static |
Definition at line 32 of file ossimAppTileCache.h.
|
static |
Definition at line 30 of file ossimAppTileCache.h.
Referenced by instance().
|
protected |
Will hold the list of application caches
Definition at line 148 of file ossimAppTileCache.h.
Referenced by deleteAll(), deleteCache(), get(), and newTileCache().
|
protected |
This holds the current cache size.
Definition at line 160 of file ossimAppTileCache.h.
Referenced by deleteCache(), insert(), and removeTile().
|
staticprotected |
Definition at line 140 of file ossimAppTileCache.h.
Referenced by instance().
|
protected |
Definition at line 154 of file ossimAppTileCache.h.
Referenced by insert().
|
protected |
Is the maximum size of the cache.
Definition at line 153 of file ossimAppTileCache.h.
|
staticprotected |
Will hold the current unique Application id.
Definition at line 144 of file ossimAppTileCache.h.
Referenced by newTileCache().
|
protected |
Is used in an Least recently used algorithm
Definition at line 166 of file ossimAppTileCache.h.
Referenced by adjustQueue(), deleteAppCacheFromQueue(), insert(), removeTile(), and removeTileFromQueue().