16#ifndef vtkOSPRayCache_h
17#define vtkOSPRayCache_h
19#include "vtkRenderingRayTracingModule.h"
26VTK_ABI_NAMESPACE_BEGIN
38 void Set(
double tstep, std::shared_ptr<T> payload)
40 if (this->Contents.size() >= this->Size)
44 this->Contents[tstep] = payload;
51 std::shared_ptr<T>
Get(
double tstep)
53 auto ret = this->Contents.find(tstep);
54 if (ret != this->Contents.end())
84 bool Contains(
double tstep) {
return this->Get(tstep) !=
nullptr; }
89 bool HasRoom() {
return this->Contents.size() < this->Size; }
95 this->Contents.clear();
101 std::map<double, std::shared_ptr<T>> Contents;
~vtkOSPRayCacheItemObject()
vtkOSPRayCacheItemObject(RTW::Backend *be, OSPObject obj)
temporal cache ospray structures to speed flipbooks
void SetSize(size_t sz)
Set/Get the number of slots available in the cache.
std::shared_ptr< T > Get(double tstep)
Obtain an object from the cache.
bool Contains(double tstep)
Query whether cache contains tstep.
size_t GetSize()
Set/Get the number of slots available in the cache.
bool HasRoom()
Check if the cache has space left.
void Set(double tstep, std::shared_ptr< T > payload)
Insert a new object into the cache.