28#ifndef vtkOSPRayCache_h
29#define vtkOSPRayCache_h
31#include "vtkRenderingRayTracingModule.h"
49 void Set(
double tstep, std::shared_ptr<T> payload)
51 if (this->Contents.size() >= this->Size)
55 this->Contents[tstep] = payload;
62 std::shared_ptr<T>
Get(
double tstep)
64 auto ret = this->Contents.find(tstep);
65 if (ret != this->Contents.end())
95 bool Contains(
double tstep) {
return this->Get(tstep) !=
nullptr; }
100 bool HasRoom() {
return this->Contents.size() < this->Size; }
106 this->Contents.clear();
112 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.