This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
expressionVariablesDependencyData.h
1//
2// Copyright 2023 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_USD_PCP_EXPRESSION_VARIABLES_DEPENDENCY_DATA_H
8#define PXR_USD_PCP_EXPRESSION_VARIABLES_DEPENDENCY_DATA_H
9
10#include "pxr/pxr.h"
11#include "pxr/usd/pcp/api.h"
13#include "pxr/base/tf/functionRef.h"
14
15#include <memory>
16#include <unordered_set>
17#include <string>
18
19PXR_NAMESPACE_OPEN_SCOPE
20
22
28{
29public:
30 PCP_API
32
33 PCP_API
36
37 PCP_API
39
40 PCP_API
43
45 PCP_API
46 bool IsEmpty() const;
47
50 PCP_API
52
55 PCP_API
57 const PcpLayerStackPtr& layerStack,
58 std::unordered_set<std::string>&& exprVarDependencies);
59
67 template <class Callback>
68 void ForEachDependency(const Callback& callback) const
69 {
70 _ForEachFunctionRef fn(callback);
71 _ForEachDependency(fn);
72 }
73
77 PCP_API
78 const std::unordered_set<std::string>*
79 GetDependenciesForLayerStack(const PcpLayerStackPtr& layerStack) const;
80
81private:
83 const PcpLayerStackPtr&, const std::unordered_set<std::string>&)>;
84
85 PCP_API
86 void _ForEachDependency(const _ForEachFunctionRef& fn) const;
87
88 class _Data;
89 const _Data* _GetData() const;
90 _Data& _GetWritableData();
91
92 std::unique_ptr<_Data> _data;
93};
94
95PXR_NAMESPACE_CLOSE_SCOPE
96
97#endif
Captures the expression variables used by an associated prim index during composition.
void ForEachDependency(const Callback &callback) const
Runs the given callback on all of the dependencies in this object.
PCP_API bool IsEmpty() const
Returns true if any dependencies have been recorded, false otherwise.
PCP_API const std::unordered_set< std::string > * GetDependenciesForLayerStack(const PcpLayerStackPtr &layerStack) const
Returns the expression variable dependencies associated with layerStack.
PCP_API void AddDependencies(const PcpLayerStackPtr &layerStack, std::unordered_set< std::string > &&exprVarDependencies)
Adds dependencies on the expression variables in exprVarDependencies from layerStack.
PCP_API void AppendDependencyData(PcpExpressionVariablesDependencyData &&data)
Moves dependencies in data and appends it to the dependencies in this object.
Represents a stack of layers that contribute opinions to composition.
Definition: layerStack.h:50
This class provides a non-owning reference to a type-erased callable object with a specified signatur...
Definition: functionRef.h:19
Standard pointer typedefs.
#define TF_DECLARE_WEAK_PTRS(type)
Define standard weak pointer types.
Definition: declarePtrs.h:45