◆ TileCache()
100 {
101 this.source = source;
102 this.capacity = capacity;
103 this.cache = new LruCache<TileInformation, byte[]>(capacity);
104 }
◆ AddTile()
151 {
152 LruCache<TileInformation, byte[]>.Info inf = new LruCache<TileInformation, byte[]>.Info();
153 inf.Coordinate = tileId.Coordinate;
154 inf.Index = tileId.Index;
155 if (cache == null)
156 cache = new LruCache<TileInformation, byte[]>(capacity);
157 cache.Add(inf, tile);
158 }
◆ Dispose()
| void BioLib.TileCache.Dispose |
( |
| ) |
|
172 {
173 cache.Dispose();
174 }
◆ DisposeTile() [1/2]
| void BioLib.TileCache.DisposeTile |
( |
TileInfo | info | ) |
|
127 {
128 for (int i = 0; i < cache.Count; i++)
129 {
130 var inf = new LruCache<TileInformation, byte[]>.Info();
131 cache.RemoveTile(inf);
132 }
133 }
◆ DisposeTile() [2/2]
119 {
120 for (int i = 0; i < cache.Count; i++)
121 {
122 var inf = new LruCache<TileInformation, byte[]>.Info();
123 cache.RemoveTile(inf);
124 }
125 }
◆ GetTile()
135 {
136 LruCache<TileInformation, byte[]>.Info inf = new LruCache<TileInformation, byte[]>.Info();
137 inf.Coordinate = info.Coordinate;
138 inf.Index = info.Index;
139 byte[] data = cache.Get(inf);
140 if (data != null)
141 {
142 return data;
143 }
144 byte[] tile = await LoadTile(info);
145 if (tile != null)
146 AddTile(info, tile);
147 return tile;
148 }
◆ HasTile()
106 {
107 LruCache<TileInformation, byte[]>.Info inf = new LruCache<TileInformation, byte[]>.Info();
108 inf.Coordinate = info.Coordinate;
109 inf.Index = info.Index;
110 byte[] data = cache.Get(inf);
111 if (data == null)
112 {
113 return false;
114 }
115 else
116 return true;
117 }
The documentation for this class was generated from the following file:
- BioLib/Source/Bio/ISlideSource.cs