| 202 | |
| 203 | template <typename CacheType> |
| 204 | vtkSmartPointer<CacheType> GetCacheDataAs(std::size_t key, bool createIfAbsent = false) |
| 205 | { |
| 206 | vtkSmartPointer<CacheType> castCache; |
| 207 | auto rawCache = this->GetCacheData(key); |
| 208 | if (!rawCache) |
| 209 | { |
| 210 | if (createIfAbsent) |
| 211 | { |
| 212 | castCache = vtkSmartPointer<CacheType>::New(); |
| 213 | this->Caches[key] = castCache; |
| 214 | } |
| 215 | return castCache; |
| 216 | } |
| 217 | castCache = dynamic_cast<CacheType*>(rawCache.GetPointer()); |
| 218 | return castCache; |
| 219 | } |
| 220 | |
| 221 | /// Add a cache entry mapping \a key to \a value. |
| 222 | /// |
nothing calls this directly
no test coverage detected