25 static const ossimTrace traceDebug(
"ossimAppFixedTileCache:debug");
28 std::map<ossimAppFixedTileCache::ossimAppFixedCacheId, ossimFixedTileCache*>::const_iterator iter = rhs.
theAppCacheMap.begin();
33 <<
"***** APP CACHE EMPTY *****" << endl;
39 out <<
"Cache id = "<< (*iter).first <<
" size = " << (*iter).second->getCacheSize() << endl;
65 std::vector<ossimString> splitString;
66 tempString = tempString.
trim();
67 tempString.
split(splitString,
" ");
68 if(splitString.size() > 1)
90 <<
"DEBUG: cache tile size = " <<
theTileSize << std::endl
91 <<
"Cache size = " << cacheSize <<
" bytes" << std::endl;
97 <<
"ossimAppFixedTileCache::ossimAppFixedTileCache() DEBUG: leaving ..." << std::endl;
121 std::lock_guard<std::mutex> lock(
theMutex);
129 std::lock_guard<std::mutex> lock(
theMutex);
130 std::map<ossimAppFixedCacheId, ossimFixedTileCache*>::iterator currentIter =
theAppCacheMap.begin();
134 (*currentIter).second->flush();
142 std::lock_guard<std::mutex> lock(
theMutex);
155 std::lock_guard<std::mutex> lock(
theMutex);
158 std::map<ossimAppFixedCacheId, ossimFixedTileCache*>::iterator iter =
theAppCacheMap.find(cacheId);
172 std::lock_guard<std::mutex> lock(
theMutex);
175 if(tileSize.
x == 0 ||
179 newCache->
setRect(tileBoundaryRect,
184 newCache->
setRect(tileBoundaryRect, tileSize);
195 std::lock_guard<std::mutex> lock(
theMutex);
212 std::lock_guard<std::mutex> lock(
theMutex);
219 cache->
setRect(boundaryTileRect,
228 std::lock_guard<std::mutex> lock(
theMutex);
243 std::lock_guard<std::mutex> lock(
theMutex);
248 result = cache->
getTile(origin);
260 std::lock_guard<std::mutex> lock(
theMutex);
287 result = aCache->
addTile(data, duplicateData);
297 std::lock_guard<std::mutex> lock(
theMutex);
306 std::lock_guard<std::mutex> lock(
theMutex);
323 std::lock_guard<std::mutex> lock(
theMutex);
336 std::map<ossimAppFixedCacheId, ossimFixedTileCache*>::const_iterator
342 result = (*currentIter).second;
358 std::map<ossimAppFixedCacheId, ossimFixedTileCache*>::iterator iter =
theAppCacheMap.begin();
394 if(cacheSize <= byteCount)
422 std::lock_guard<std::mutex> lock(
theMutex);
virtual void deleteCache(ossimAppFixedCacheId cacheId)
ossimRefPtr< ossimImageData > removeTile(ossimAppFixedCacheId cacheId, const ossimIpt &origin)
virtual ossimRefPtr< ossimImageData > getTile(ossim_int32 id)
virtual const ossimIpt & getTileSize() const
virtual const ossimIrect & getTileBoundaryRect() const
virtual void deleteTile(const ossimIpt &origin)
virtual ~ossimAppFixedTileCache()
virtual void setTileSize(ossimAppFixedCacheId cacheId, const ossimIpt &tileSize)
const ossimIpt & getTileSize(ossimAppFixedCacheId cacheId)
void deleteTile(ossimAppFixedCacheId cacheId, const ossimIpt &origin)
ossim_uint32 theMaxGlobalCacheSize
void split(std::vector< ossimString > &result, const ossimString &separatorList, bool skipBlankFields=false) const
Splits this string into a vector of strings (fields) using the delimiter list specified.
ossim_uint32 toUInt32() const
ossimAppFixedCacheId newTileCache()
static ossimAppFixedTileCache * instance(ossim_uint32 maxSize=0)
ossimFixedTileCache * getCache(ossimAppFixedCacheId cacheId)
ossimRefPtr< ossimImageData > getTile(ossimAppFixedCacheId cacheId, const ossimIpt &origin)
virtual ossim_uint32 getCacheSize() const
ossim_uint32 theMaxCacheSize
const char * findPreference(const char *key) const
virtual void setRect(const ossimIrect &rect)
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
static ossimAppFixedCacheId theUniqueAppIdCounter
void shrinkGlobalCacheSize(ossim_int32 byteCount)
static ossimPreferences * instance()
ossim_int32 ossimAppFixedCacheId
void shrinkCacheSize(ossimAppFixedCacheId id, ossim_int32 byteCount)
std::ostream & operator<<(std::ostream &out, const ossimAppFixedTileCache &rhs)
std::map< ossimAppFixedCacheId, ossimFixedTileCache * > theAppCacheMap
ossim_uint32 theCurrentCacheSize
virtual void setRect(ossimAppFixedCacheId cacheId, const ossimIrect &boundaryTileRect)
static ossimAppFixedTileCache * theInstance
virtual void setMaxCacheSize(ossim_uint32 cacheSize)
virtual ossim_uint32 getDataSizeInBytes() const
virtual ossimRefPtr< ossimImageData > removeTile(const ossimIpt &origin)
static const ossim_uint32 DEFAULT_SIZE
virtual ossimRefPtr< ossimImageData > addTile(ossimRefPtr< ossimImageData > imageData, bool duplicateData=true)
ossimRefPtr< ossimImageData > addTile(ossimAppFixedCacheId cacheId, ossimRefPtr< ossimImageData > data, bool duplicateData=true)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
std::basic_ostream< char > ostream
Base class for char output streams.