HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
systemChangeProcessor.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_EXEC_SYSTEM_CHANGE_PROCESSOR_H
8 #define PXR_EXEC_EXEC_SYSTEM_CHANGE_PROCESSOR_H
9 
10 /// \file
11 
12 #include "pxr/pxr.h"
13 
14 #include "pxr/exec/exec/api.h"
15 #include "pxr/exec/exec/system.h"
16 
17 #include "pxr/base/tf/token.h"
18 
19 #include <memory>
20 
22 
23 /// Public API to deliver scene changes from ExecSystem derived classes.
24 ///
25 /// Classes derived from ExecSystem are responsible for notifying ExecSystem
26 /// when scene changes occur. They do so by constructing an
27 /// ExecSystem::_ChangeProcessor from their parent ExecSystem, and invoking
28 /// methods corresponding to the scene changes.
29 ///
31 {
32 public:
33  EXEC_API
34  explicit _ChangeProcessor(ExecSystem *system);
35 
36  EXEC_API
38 
39  /// Notifies the ExecSystem that a scene object has been resynced.
40  ///
41  /// \see UsdNotice::ObjectsChanged::GetResyncedPaths.
42  ///
43  EXEC_API
44  void DidResync(const SdfPath &path);
45 
46  /// Notifies the ExecSystem that a scene object's fields have changed, but
47  /// the object has *not* been resynced.
48  ///
49  /// \see UsdNotice::ObjectsChanged::GetChangedInfoOnlyPaths.
50  /// \see UsdNotice::ObjectsChanged::GetChangedFields.
51  ///
52  EXEC_API
53  void DidChangeInfoOnly(
54  const SdfPath &path,
55  const TfTokenVector &changedFields);
56 
57  /// Notifies the ExecSystem that the set of attribute connections that
58  /// target a scene object has changed.
59  ///
60  EXEC_API
61  void DidChangeIncomingConnections(const SdfPath &path);
62 
63 private:
64  // Processes accumulated state from changes before the processor goes out of
65  // scope.
66  //
67  void _PostProcessChanges();
68 
69 private:
70  ExecSystem *const _system;
71 
72  // State accumulated over a round of change processing.
73  struct _State;
74  std::unique_ptr<_State> _state;
75 };
76 
78 
79 #endif
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
EXEC_API void DidChangeIncomingConnections(const SdfPath &path)
EXEC_API void DidChangeInfoOnly(const SdfPath &path, const TfTokenVector &changedFields)
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
#define EXEC_API
Definition: api.h:25
Definition: path.h:280
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
EXEC_API _ChangeProcessor(ExecSystem *system)
EXEC_API void DidResync(const SdfPath &path)