![]() |
|
A sampled data source which maintains a cache of values from the upstream sampled data source, with values persisting until all handles to the data source are released. More...
#include <cachingSampledDataSource.h>
Inheritance diagram for HdCachingSampledDataSource:Public Types | |
| using | Time = HdSampledDataSource::Time |
| using | TimeValueMap = tbb::concurrent_hash_map<Time, VtValue> |
Public Types inherited from HdSampledDataSource | |
| using | Time = float |
Public Member Functions | |
| HD_DECLARE_DATASOURCE (HdCachingSampledDataSource) | |
| VtValue | GetValue (Time shutterOffset) override |
Returns the value of this data source at frame-relative time shutterOffset. | |
| bool | GetContributingSampleTimesForInterval (Time startTime, Time endTime, std::vector< Time > *outSampleTimes) override |
Given a shutter window of interest (startTime and endTime relative to the current frame), return a list of sample times for the caller to query with GetValue such that the caller can reconstruct the signal over the shutter window. | |
Public Member Functions inherited from HdSampledDataSource | |
| HD_DECLARE_DATASOURCE_ABSTRACT (HdSampledDataSource) | |
Public Member Functions inherited from HdDataSourceBase | |
Protected Member Functions | |
| HdCachingSampledDataSource (const HdSampledDataSourceHandle &input) | |
Protected Member Functions inherited from HdSampledDataSource | |
| virtual HD_API VtValue | _GetDefaultValue () |
Protected Attributes | |
| const HdSampledDataSourceHandle | _input |
| TimeValueMap | _cache |
A sampled data source which maintains a cache of values from the upstream sampled data source, with values persisting until all handles to the data source are released.
For a given data source (or copies of that data source) GetValue for a shutter offset will receive answers drawn from the upstream data source, but subsequent calls at that shutter offset against the same handle will receive a cached value. Data source caching is useful when the value is large, costly to pull from the upstream source, and will be queried multiple times by the same consumer for the same shutterOffset, with the memory consumed by the cache being freed when the consumer releases the data source handle.
Definition at line 37 of file cachingSampledDataSource.h.
| using Time = HdSampledDataSource::Time |
Definition at line 41 of file cachingSampledDataSource.h.
| using TimeValueMap = tbb::concurrent_hash_map<Time, VtValue> |
Definition at line 42 of file cachingSampledDataSource.h.
|
inlineprotected |
Definition at line 80 of file cachingSampledDataSource.h.
|
inlineoverridevirtual |
Given a shutter window of interest (startTime and endTime relative to the current frame), return a list of sample times for the caller to query with GetValue such that the caller can reconstruct the signal over the shutter window.
For a sample-based attribute, this might be a list of times when samples are defined. For a procedural scene, this might be a generated distribution. Note that the returned samples don't need to be within startTime and endTime; if a boundary sample is outside of the window, implementers can return it, and callers should expect it and interpolate to startTime or endTime accordingly. If this call returns true, the caller is expected to pass the list of outSampleTimes to GetValue. If this call returns false, this value is uniform across the shutter window and the caller should call GetValue(0) to get that uniform value.
Implements HdSampledDataSource.
Definition at line 65 of file cachingSampledDataSource.h.
|
inlineoverridevirtual |
Returns the value of this data source at frame-relative time shutterOffset.
The caller does not track the frame; the scene index producing this datasource is responsible for that, if applicable. Note that, although this call returns a VtValue for each shutter offset, the type of the held value is expected to be the same across all shutter offsets. This call is expected to be threadsafe.
Implements HdSampledDataSource.
Definition at line 45 of file cachingSampledDataSource.h.
|
protected |
Definition at line 84 of file cachingSampledDataSource.h.
|
protected |
Definition at line 83 of file cachingSampledDataSource.h.