MCPcopy Create free account
hub / github.com/Kitware/VTK / GetCacheDataAs

Function GetCacheDataAs

Common/DataModel/vtkCellGridResponders.h:204–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 ///

Callers

nothing calls this directly

Calls 3

GetCacheDataMethod · 0.80
NewFunction · 0.50
GetPointerMethod · 0.45

Tested by

no test coverage detected