7#ifndef PXR_EXEC_VDF_DATA_MANAGER_VECTOR_H
8#define PXR_EXEC_VDF_DATA_MANAGER_VECTOR_H
14#include "pxr/exec/vdf/api.h"
19PXR_NAMESPACE_OPEN_SCOPE
38template<VdfDataManagerDeallocationMode DeallocationMode>
41class VdfExecutorInvalidationData;
52template<VdfDataManagerDeallocationMode Mode>
93template<VdfDataManagerDeallocationMode DeallocationMode>
237 _data->
Touch(handle);
274template<VdfDataManagerDeallocationMode DeallocationMode>
278 Vdf_DataManagerVectorDeallocateNow(_data);
280 Vdf_DataManagerVectorDeallocateLater(_data);
284template<VdfDataManagerDeallocationMode DeallocationMode>
295 _data->Resize(network);
299template<VdfDataManagerDeallocationMode DeallocationMode>
302 const VdfId outputId)
306 const DataHandle dataHandle = _data->GetDataHandle(outputId);
307 if (IsValidDataHandle(dataHandle)) {
308 _data->Reset(dataHandle, outputId);
313template<VdfDataManagerDeallocationMode DeallocationMode>
323PXR_NAMESPACE_CLOSE_SCOPE
A vector-like container for executor data used by the VdfDataManagerVector.
size_t GetNumData() const
Returns the number of outputs that have data associated with them.
VdfExecutorBufferData * GetBufferData(const DataHandle handle)
Returns the VdfExecutorBufferData associated with the given handle.
VdfInvalidationTimestamp GetInvalidationTimestamp(const DataHandle handle) const
Returns the VdfInvalidationTimestamp associated with the given handle.
VdfExecutorInvalidationData * GetInvalidationData(const DataHandle handle)
Returns the VdfExecutorInvalidationData associated with the given handle.
VdfSMBLData * GetOrCreateSMBLData(const DataHandle handle)
Returns an existing VdfSMBLData associated with the given handle or creates a new one of none exists.
size_t DataHandle
The data handle type is an index into the internal data vectors.
static const size_t InvalidHandle
This sentinel index denotes an invalid handle.
VdfSMBLData * GetSMBLData(const DataHandle handle) const
Returns an existing VdfSMBLData associated with the given handle.
void Touch(const DataHandle handle)
Marks the data at the given handle as having been touched by evaluation.
bool Untouch(const DataHandle handle)
Marks the data at the given handle as not having been touched by evaluation.
DataHandle GetDataHandle(const VdfId outputId) const
Returns an existing data handle for the given output.
void SetInvalidationTimestamp(const DataHandle &handle, VdfInvalidationTimestamp ts)
Sets the invalidation timestamp for the give data handle.
bool IsTouched(const DataHandle handle)
Returns true if the data at the given handle has been touched by evaluation.
DataHandle GetOrCreateDataHandle(const VdfId outputId)
Returns an existing data handle, or creates a new one for the given output.
This is a data manager for executors that uses data stored in a vector indexed by output ids.
bool IsTouched(const DataHandle handle) const
Returns true if the data at the given handle has been touched by evaluation.
Vdf_ExecutorDataManagerTraits< VdfDataManagerVector >::DataHandle DataHandle
The data handle type from the type traits class.
bool IsValidDataHandle(const DataHandle handle) const
Returns true if the given data handle is valid, i.e.
VdfInvalidationTimestamp GetInvalidationTimestamp(const DataHandle handle) const
Returns the VdfInvalidationTimestamp associated with the given handle.
VdfExecutorBufferData * GetBufferData(const DataHandle handle) const
Returns the VdfExecutorBufferData associated with the given handle.
VdfExecutorInvalidationData * GetInvalidationData(const DataHandle handle) const
Returns the VdfExecutorInvalidationData associated with the given handle.
void SetInvalidationTimestamp(const DataHandle handle, VdfInvalidationTimestamp timestamp)
Sets the invalidation timestamp for the give data handle.
void ClearDataForOutput(const VdfId outputId)
Clears the executor data for a specific output.
VdfSMBLData * GetSMBLData(const DataHandle handle) const
Returns an existing VdfSMBLData associated with the given handle.
DataHandle GetOrCreateDataHandle(const VdfId outputId) const
Returns an existing data handle, or creates a new one for the given outputId.
bool IsEmpty() const
Returns true if this data manager is empty.
void Resize(const VdfNetwork &network)
Resize the data manager to accommodate the given network.
DataHandle GetDataHandle(const VdfId outputId) const
Returns an existing data handle for the given outputId.
void Clear()
Clears all the data from this manager.
bool Untouch(const DataHandle handle)
Marks the data at the given handle as not having been touched by evaluation.
VdfDataManagerVector()
Constructor.
VdfExecutorDataManager< VdfDataManagerVector > Base
The base class.
VdfSMBLData * GetOrCreateSMBLData(const DataHandle handle) const
Returns an existing VdfSMBLData associated with the given handle or creates a new one of none exists.
void Touch(const DataHandle handle) const
Marks the data at the given handle as having been touched by evaluation.
~VdfDataManagerVector()
Destructor.
This object is responsible for storing the executor buffer data, comprised of the executor cache vect...
This class provides functionality to manage the executor specific data associated with each output in...
VdfInvalidationTimestamp GetInvalidationTimestamp() const
Returns the current invalidation timestamp on this executor.
A VdfNetwork is a collection of VdfNodes and their connections.
A VdfOutput represents an output on a node.
VdfSMBLData holds per-output data that is meant to be consumed by the executor.
VdfDataManagerDeallocationMode
Enum representing the deallocation strategy for the data manager.
@ Immediate
Deallocate immediately.
@ Background
Deallocate in the background.
VDF_API Vdf_ExecutorDataVector * Vdf_DataManagerVectorAllocate(const VdfNetwork &network)
Private functions for memory management strategies.
uint64_t VdfId
The unique identifier type for Vdf objects.
unsigned int VdfInvalidationTimestamp
Type of the timestamp that identifies the most recent round of invalidation.
Forward definition of the traits class, which will be specialized by the derived data manager impleme...