/usr/include/ossim/imaging/ossimFixedTileCache.h is in libossim-dev 1.8.16-3+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | //******************************************************************
// Copyright (C) 2000 ImageLinks Inc.
//
// License: LGPL
//
// See LICENSE.txt file in the top level directory for more details.
//
// Author: Garrett Potts
//
// Description: This file contains the Application cache algorithm
//
//***********************************
// $Id: ossimFixedTileCache.h 16276 2010-01-06 01:54:47Z gpotts $
#ifndef ossimFixedTileCache_HEADER
#define ossimFixedTileCache_HEADER
#include <map>
#include <list>
#include <ossim/base/ossimIpt.h>
#include <ossim/base/ossimReferenced.h>
#include <ossim/base/ossimRefPtr.h>
#include <ossim/imaging/ossimImageData.h>
#include <OpenThreads/Mutex>
class ossimFixedTileCacheInfo
{
public:
ossimFixedTileCacheInfo(ossimRefPtr<ossimImageData>& tile,
ossim_int32 tileId=-1)
:theTile(tile),
theTileId(tileId)
{
}
bool operator <(const ossimFixedTileCacheInfo& rhs)const
{
return (theTileId < rhs.theTileId);
}
bool operator <(ossim_int32 tileId)const
{
return (theTileId < tileId);
}
bool operator >(const ossimFixedTileCacheInfo& rhs)const
{
return (theTileId > rhs.theTileId);
}
bool operator >(ossim_int32 tileId)const
{
return (theTileId > tileId);
}
bool operator ==(const ossimFixedTileCacheInfo& rhs)const
{
return (theTileId == rhs.theTileId);
}
bool operator ==(ossim_int32 tileId)const
{
return (theTileId == tileId);
}
ossimRefPtr<ossimImageData> theTile;
ossim_int32 theTileId;
};
class ossimFixedTileCache : public ossimReferenced
{
public:
ossimFixedTileCache();
virtual void setRect(const ossimIrect& rect);
virtual void setRect(const ossimIrect& rect,
const ossimIpt& tileSize);
void keepTilesWithinRect(const ossimIrect& rect);
virtual ossimRefPtr<ossimImageData> addTile(ossimRefPtr<ossimImageData> imageData,
bool duplicateData=true);
virtual ossimRefPtr<ossimImageData> getTile(ossim_int32 id);
virtual ossimRefPtr<ossimImageData> getTile(const ossimIpt& origin)
{
return getTile(computeId(origin));
}
virtual void setUseLruFlag(bool flag)
{
theUseLruFlag = flag;
}
virtual bool getUseLruFlag()const
{
return theUseLruFlag;
}
virtual void flush();
virtual void deleteTile(const ossimIpt& origin)
{
deleteTile(computeId(origin));
}
virtual void deleteTile(ossim_int32 tileId);
virtual ossimRefPtr<ossimImageData> removeTile(const ossimIpt& origin)
{
return removeTile(computeId(origin));
}
virtual ossimRefPtr<ossimImageData> removeTile(ossim_int32 tileId);
virtual const ossimIrect& getTileBoundaryRect()const
{
return theTileBoundaryRect;
}
virtual ossim_uint32 getNumberOfTiles()const
{
return (ossim_uint32)theTileMap.size();
}
virtual const ossimIpt& getTileSize()const
{
return theTileSize;
}
virtual ossim_uint32 getCacheSize()const
{
return theCacheSize;
}
virtual void deleteTile();
virtual ossimRefPtr<ossimImageData> removeTile();
virtual void setMaxCacheSize(ossim_uint32 cacheSize)
{
theMaxCacheSize = cacheSize;
}
ossim_uint32 getMaxCacheSize()const
{
return theMaxCacheSize;
}
virtual ossimIpt getTileOrigin(ossim_int32 tileId);
virtual ossim_int32 computeId(const ossimIpt& tileOrigin)const;
virtual void setTileSize(const ossimIpt& tileSize);
protected:
virtual ~ossimFixedTileCache();
OpenThreads::Mutex theMutex;
ossimIrect theTileBoundaryRect;
ossimIpt theTileSize;
ossimIpt theBoundaryWidthHeight;
ossim_uint32 theTilesHorizontal;
ossim_uint32 theTilesVertical;
ossim_uint32 theCacheSize;
ossim_uint32 theMaxCacheSize;
std::map<ossim_int32, ossimFixedTileCacheInfo> theTileMap;
std::list<ossim_int32> theLruQueue;
bool theUseLruFlag;
virtual void eraseFromLru(ossim_int32 id);
void adjustLru(ossim_int32 id);
};
#endif
|