Loading...
Searching...
No Matches
expressionVariablesDependencyData.h
1//
2// Copyright 2023 Pixar
3//
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
5// with the following modification; you may not use this file except in
6// compliance with the Apache License and the following modification to it:
7// Section 6. Trademarks. is deleted and replaced with:
8//
9// 6. Trademarks. This License does not grant permission to use the trade
10// names, trademarks, service marks, or product names of the Licensor
11// and its affiliates, except as required to comply with Section 4(c) of
12// the License and to reproduce the content of the NOTICE file.
13//
14// You may obtain a copy of the Apache License at
15//
16// http://www.apache.org/licenses/LICENSE-2.0
17//
18// Unless required by applicable law or agreed to in writing, software
19// distributed under the Apache License with the above modification is
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21// KIND, either express or implied. See the Apache License for the specific
22// language governing permissions and limitations under the Apache License.
23//
24#ifndef PXR_USD_PCP_EXPRESSION_VARIABLES_DEPENDENCY_DATA_H
25#define PXR_USD_PCP_EXPRESSION_VARIABLES_DEPENDENCY_DATA_H
26
27#include "pxr/pxr.h"
28#include "pxr/usd/pcp/api.h"
30#include "pxr/base/tf/functionRef.h"
31
32#include <memory>
33#include <unordered_set>
34#include <string>
35
36PXR_NAMESPACE_OPEN_SCOPE
37
39
45{
46public:
47 PCP_API
49
50 PCP_API
53
54 PCP_API
56
57 PCP_API
60
62 PCP_API
63 bool IsEmpty() const;
64
67 PCP_API
69
72 PCP_API
74 const PcpLayerStackPtr& layerStack,
75 std::unordered_set<std::string>&& exprVarDependencies);
76
84 template <class Callback>
85 void ForEachDependency(const Callback& callback) const
86 {
87 _ForEachFunctionRef fn(callback);
88 _ForEachDependency(fn);
89 }
90
94 PCP_API
95 const std::unordered_set<std::string>*
96 GetDependenciesForLayerStack(const PcpLayerStackPtr& layerStack) const;
97
98private:
100 const PcpLayerStackPtr&, const std::unordered_set<std::string>&)>;
101
102 PCP_API
103 void _ForEachDependency(const _ForEachFunctionRef& fn) const;
104
105 class _Data;
106 const _Data* _GetData() const;
107 _Data& _GetWritableData();
108
109 std::unique_ptr<_Data> _data;
110};
111
112PXR_NAMESPACE_CLOSE_SCOPE
113
114#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:67
This class provides a non-owning reference to a type-erased callable object with a specified signatur...
Definition: functionRef.h:36
Standard pointer typedefs.
#define TF_DECLARE_WEAK_PTRS(type)
Define standard weak pointer types.
Definition: declarePtrs.h:62