7 #ifndef PXR_USD_PCP_MAP_EXPRESSION_H
8 #define PXR_USD_PCP_MAP_EXPRESSION_H
16 #include <tbb/spin_mutex.h>
58 _node.
swap(other._node);
124 return _node && _node->key.op == _OpConstant &&
125 _node->key.valueForConstant.IsIdentity();
186 _Node(
const _Node&) =
delete;
204 const Value & valueForConstant_ )
208 , valueForConstant(valueForConstant_)
210 inline size_t GetHash()
const;
219 const bool expressionTreeAlwaysHasIdentity;
230 const Value & EvaluateAndCache()
const;
233 void SetValueForVariable(
Value &&newValue);
236 const Value & GetValueForVariable()
const {
237 return _valueForVariable;
241 explicit _Node(
const Key &key_ );
243 Value _EvaluateUncached()
const;
247 static bool _ExpressionTreeAlwaysHasIdentity(
const Key& key);
254 mutable std::atomic<int> _refCount;
255 mutable Value _cachedValue;
256 mutable std::set<_Node*> _dependentExpressions;
257 Value _valueForVariable;
258 mutable tbb::spin_mutex _mutex;
259 mutable std::atomic<bool> _hasCachedValue;
271 #endif // PXR_USD_PCP_MAP_EXPRESSION_H
Key(_Op op_, const _NodeRefPtr &arg1_, const _NodeRefPtr &arg2_, const Value &valueForConstant_)
PcpMapFunction Value
The value type of PcpMapExpression is a PcpMapFunction.
friend struct Pcp_VariableImpl
static PCP_API VariableUniquePtr NewVariable(Value &&initialValue)
bool IsConstantIdentity() const
Return true if the map function is the constant identity function.
friend PCP_API void TfDelegatedCountDecrement(_Node *) noexcept
PCP_API bool IsIdentity() const
static PCP_API PcpMapExpression Identity()
Return an expression representing PcpMapFunction::Identity().
PCP_API PcpMapExpression Compose(const PcpMapExpression &f) const
GLsizei const GLfloat * value
GLsizei const GLchar *const * path
PCP_API SdfPath MapSourceToTarget(const SdfPath &path) const
PCP_API PcpMapExpression AddRootIdentity() const
virtual const Value & GetValue() const =0
Return the current value.
const SdfLayerOffset & GetTimeOffset() const
The time offset of the mapping.
virtual PcpMapExpression GetExpression() const =0
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
SdfPath MapTargetToSource(const SdfPath &path) const
std::string GetString() const
const SdfLayerOffset & GetTimeOffset() const
The time offset of the mapping.
A generic, discriminated value, whose type may be queried dynamically.
SdfPath MapSourceToTarget(const SdfPath &path) const
virtual void SetValue(Value &&value)=0
std::unique_ptr< Variable > VariableUniquePtr
Variables are held by reference.
PCP_API const Value & Evaluate() const
PCP_API PcpMapExpression Inverse() const
Create a new PcpMapExpression representing the inverse of f.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
LeafData & operator=(const LeafData &)=delete
#define PXR_NAMESPACE_CLOSE_SCOPE
bool IsNull() const noexcept
Return true if this is a null expression.
PcpMapExpression() noexcept=default
Default-construct a NULL expression.
PCP_API std::string GetString() const
PCP_API SdfPath MapTargetToSource(const SdfPath &path) const
const Value valueForConstant
friend PCP_API void TfDelegatedCountIncrement(_Node *)
static PCP_API PcpMapExpression Constant(const Value &constValue)
Create a new constant.
void swap(TfDelegatedCountPtr &other) noexcept
Swap this object's held pointer with other's.
friend class Pcp_Statistics
void Swap(PcpMapExpression &other) noexcept
Swap this expression with the other.