HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
datalessExecutor.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_DATALESS_EXECUTOR_H
8 #define PXR_EXEC_VDF_DATALESS_EXECUTOR_H
9 
10 ///\file
11 
12 #include "pxr/pxr.h"
13 
14 #include "pxr/exec/vdf/api.h"
16 
18 
19 class VdfOutput;
20 class VdfVector;
21 
22 ///////////////////////////////////////////////////////////////////////////////
23 ///
24 /// \class VdfDatalessExecutor
25 ///
26 /// \brief An abstract base class for executors, which do not store any data
27 /// at all. This class mainly serves the purpose of abstracting away error
28 /// handling on dataless executors, when methods that are supposed to mutate
29 /// data are called.
30 ///
31 
33 {
34 public:
35 
36  /// Destructor
37  ///
38  VDF_API
39  virtual ~VdfDatalessExecutor();
40 
41  /// Sets the cached value for a given \p output.
42  ///
43  /// This is not supported on this type of executor.
44  ///
45  VDF_API
46  virtual void SetOutputValue(
47  const VdfOutput &output,
48  const VdfVector &value,
49  const VdfMask &mask) override;
50 
51  /// Transfers ownership of \p value to the given \p output.
52  ///
53  /// This is not supported on this type of executor.
54  ///
55  VDF_API
56  virtual bool TakeOutputValue(
57  const VdfOutput &output,
58  VdfVector *value,
59  const VdfMask &mask) override;
60 
61  /// Returns \c true of the data manager is empty.
62  ///
63  /// This type of executor is always considered empty, since it does not
64  /// hold any data.
65  ///
66  virtual bool IsEmpty() const override {
67  return true;
68  }
69 
70 protected:
71 
72  /// Protected default constructor
73  ///
74  VDF_API
76 
77  /// Returns a value for the cache that flows across \p connection.
78  ///
79  virtual const VdfVector *_GetInputValue(
80  const VdfConnection &connection,
81  const VdfMask &mask) const override {
82  return NULL;
83  }
84 
85  /// Returns an output value for reading.
86  ///
88  const VdfOutput &output,
89  const VdfMask &mask) const override {
90  return NULL;
91  }
92 
93  /// Returns an output value for writing.
94  ///
96  const VdfOutput &output) const override {
97  return NULL;
98  }
99 
100  /// Clears the data for a specific output on this executor.
101  ///
102  /// This has no effect on this type of executor.
103  ///
105  const VdfId outputId, const VdfId nodeId) override {}
106 
107  /// Clears all the data caches associated with any output in the network.
108  ///
109  /// This has no effect on this type of executor.
110  ///
111  virtual void _ClearData() override {}
112 
113  /// Called before invalidation begins to update the timestamp that will be
114  /// written for every VdfOutput visited during invalidation. This timestamp
115  /// is later used to identify outputs for mung buffer locking.
116  ///
117  /// This has no effect on this type of executor.
118  ///
119  virtual void _UpdateInvalidationTimestamp() override {}
120 
121  /// Called to set destOutput's buffer output to be a reference to the
122  /// buffer output of sourceOutput.
123  ///
124  /// This is not supported on this type of executor.
125  ///
126  VDF_API
127  virtual void _SetReferenceOutputValue(
128  const VdfOutput &destOutput,
129  const VdfOutput &sourceOutput,
130  const VdfMask &sourceMask) const override;
131 
132  /// Mark the output as having been visited. This is only to be used by
133  /// the speculation engine to tell its parent executor that an output
134  /// has been visited and should be marked for invalidation.
135  ///
136  /// This has no effect on this type of executor.
137  ///
138  virtual void _TouchOutput(const VdfOutput &output) const override {}
139 
140 };
141 
143 
144 #endif
virtual const VdfVector * _GetInputValue(const VdfConnection &connection, const VdfMask &mask) const override
virtual VdfVector * _GetOutputValueForWriting(const VdfOutput &output) const override
virtual void SetOutputValue(const VdfOutput &output, const VdfVector &value, const VdfMask &mask)=0
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
GLsizei const GLfloat * value
Definition: glcorearb.h:824
A VdfMask is placed on connections to specify the data flowing through them.
Definition: mask.h:36
An abstract base class for executors, which do not store any data at all. This class mainly serves th...
#define VDF_API
Definition: api.h:25
virtual void _TouchOutput(const VdfOutput &output) const override
virtual bool TakeOutputValue(const VdfOutput &output, VdfVector *value, const VdfMask &mask)=0
virtual bool IsEmpty() const override
GLint GLuint mask
Definition: glcorearb.h:124
virtual void _UpdateInvalidationTimestamp() override
virtual void _ClearData() override
void _ClearDataForOutput(const VdfId outputId, const VdfId nodeId) override
virtual void _SetReferenceOutputValue(const VdfOutput &destOutput, const VdfOutput &sourceOutput, const VdfMask &sourceMask) const =0
#define VDF_API_TYPE
Definition: api.h:26
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
Abstract base class for classes that execute a VdfNetwork to compute a requested set of values...
virtual const VdfVector * _GetOutputValueForReading(const VdfOutput &output, const VdfMask &mask) const override
uint64_t VdfId
The unique identifier type for Vdf objects.
Definition: types.h:107