executorDataManagerInterface.h
Go to the documentation of this file.
1 //
2 // Copyright 2025 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_EXEC_VDF_EXECUTOR_DATA_MANAGER_INTERFACE_H
8 #define PXR_EXEC_VDF_EXECUTOR_DATA_MANAGER_INTERFACE_H
9 
11 
12 #include "pxr/pxr.h"
13 
14 #include "pxr/exec/vdf/types.h"
15 
16 PXR_NAMESPACE_OPEN_SCOPE
17 
19 class VdfExecutorInvalidationData;
20 class VdfNetwork;
21 class VdfOutput;
22 class VdfSMBLData;
23 
31 
32 template <typename DerivedClass, typename DataHandle>
34 {
35 protected:
36 
40 
44 
48  void _Resize(const VdfNetwork &network) {
49  _Self()->Resize(network);
50  }
51 
58  bool _IsValidDataHandle(const DataHandle handle) const {
59  return _Self()->IsValidDataHandle(handle);
60  }
61 
67  DataHandle _GetOrCreateDataHandle(const VdfId outputId) const {
68  return _Self()->GetOrCreateDataHandle(outputId);
69  }
70 
75  DataHandle _GetDataHandle(const VdfId outputId) const {
76  return _Self()->GetDataHandle(outputId);
77  }
78 
84  VdfExecutorBufferData * _GetBufferData(const DataHandle handle) const {
85  return _Self()->GetBufferData(handle);
86  }
87 
94  VdfExecutorInvalidationData * _GetInvalidationData(
95  const DataHandle handle) const {
96  return _Self()->GetInvalidationData(handle);
97  }
98 
106  const DataHandle handle) const {
107  return _Self()->GetInvalidationTimestamp(handle);
108  }
109 
116  const DataHandle handle,
118  _Self()->SetInvalidationTimestamp(handle, ts);
119  }
120 
128  VdfSMBLData * _GetSMBLData(const DataHandle handle) const {
129  return _Self()->GetSMBLData(handle);
130  }
131 
137  VdfSMBLData * _GetOrCreateSMBLData(const DataHandle handle) const {
138  return _Self()->GetOrCreateSMBLData(handle);
139  }
140 
147  bool _IsTouched(const DataHandle handle) const {
148  return _Self()->IsTouched(handle);
149  }
150 
157  void _Touch(const DataHandle handle) const {
158  _Self()->Touch(handle);
159  }
160 
167  bool _Untouch(const DataHandle handle) {
168  return _Self()->Untouch(handle);
169  }
170 
173  void _ClearDataForOutput(const VdfOutput &output) {
174  return _Self()->ClearDataForOutput(output);
175  }
176 
177 private:
178 
179  // Returns the constant this pointer to the derived class.
180  const DerivedClass * _Self() const {
181  return static_cast<const DerivedClass *>(this);
182  }
183 
184 
185  // Returns the mutable this pointer to the derived class.
186  DerivedClass * _Self() {
187  return static_cast<DerivedClass *>(this);
188  }
189 
190 };
191 
192 PXR_NAMESPACE_CLOSE_SCOPE
193 
194 #endif
A VdfNetwork is a collection of VdfNodes and their connections.
Definition: network.h:59
void _ClearDataForOutput(const VdfOutput &output)
Clears the buffer data for a specific output.
void _SetInvalidationTimestamp(const DataHandle handle, VdfInvalidationTimestamp ts)
Sets the invalidation timestamp for the give data handle.
VdfSMBLData * _GetOrCreateSMBLData(const DataHandle handle) const
Returns an existing VdfSMBLData associated with the given handle or creates a new one of none exists.
VdfInvalidationTimestamp _GetInvalidationTimestamp(const DataHandle handle) const
Returns the VdfInvalidationTimestamp associated with the given handle.
void _Resize(const VdfNetwork &network)
Resize the data manager to accommodate all the outputs in the given network.
void _Touch(const DataHandle handle) const
Marks the data at the given handle as having been touched by evaluation.
~Vdf_ExecutorDataManagerInterface()=default
Prevent destruction via base class pointers (static polymorphism only).
Vdf_ExecutorDataManagerInterface()=default
Allow construction via derived classes, only.
bool _IsValidDataHandle(const DataHandle handle) const
Returns true if the given data handle is valid, i.e.
DataHandle _GetDataHandle(const VdfId outputId) const
Returns an existing data handle for the given outputId.
VdfSMBLData holds per-output data that is meant to be consumed by the executor.
Definition: smblData.h:30
DataHandle _GetOrCreateDataHandle(const VdfId outputId) const
Returns an existing data handle, or creates a new one for the given outputId.
This object is responsible for storing the executor buffer data, comprised of the executor cache vect...
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.
A VdfOutput represents an output on a node.
Definition: output.h:31
The interface contract for the static polymorphism used by executor data manager implementations.
unsigned int VdfInvalidationTimestamp
Type of the timestamp that identifies the most recent round of invalidation.
Definition: types.h:74
VdfSMBLData * _GetSMBLData(const DataHandle handle) const
Returns an existing VdfSMBLData associated with the given handle.
bool _IsTouched(const DataHandle handle) const
Returns true if the data at the given handle has been touched by evaluation.
bool _Untouch(const DataHandle handle)
Marks the data at the given handle as not having been touched by evaluation.
uint64_t VdfId
The unique identifier type for Vdf objects.
Definition: types.h:107