24#ifndef PXR_USD_SDF_PROXY_POLICIES_H
25#define PXR_USD_SDF_PROXY_POLICIES_H
30#include "pxr/usd/sdf/api.h"
32#include "pxr/usd/sdf/path.h"
35PXR_NAMESPACE_OPEN_SCOPE
45 typedef std::string value_type;
47 static const value_type& Canonicalize(
const value_type& x)
52 static const std::vector<value_type>& Canonicalize(
53 const std::vector<value_type>& x)
72 static const std::vector<value_type>& Canonicalize(
73 const std::vector<value_type>& x)
93 return _Canonicalize(x, _GetAnchor());
96 std::vector<value_type> Canonicalize(
const std::vector<value_type>& x)
const
102 const SdfPath anchor = _GetAnchor();
104 std::vector<value_type> result = x;
106 *it = _Canonicalize(*it, anchor);
116 return _owner ? _owner->GetPath().GetPrimPath() :
126 SdfSpecHandle _owner;
132 static Vt_DefaultValueHolder Invoke() {
133 TF_AXIOM(
false &&
"Failed VtValue::Get<SdfPathKeyPolicy> not allowed");
134 return Vt_DefaultValueHolder::Create((
void*)0);
151 static const std::vector<value_type>& Canonicalize(
152 const std::vector<value_type>& x)
161 static Vt_DefaultValueHolder Invoke() {
162 TF_AXIOM(
false &&
"Failed VtValue::Get<SdfPayloadTypePolicy> not allowed");
163 return Vt_DefaultValueHolder::Create((
void*)0);
180 static const std::vector<value_type>& Canonicalize(
181 const std::vector<value_type>& x)
190 static Vt_DefaultValueHolder Invoke() {
191 TF_AXIOM(
false &&
"Failed VtValue::Get<SdfReferenceTypePolicy> not allowed");
192 return Vt_DefaultValueHolder::Create((
void*)0);
202 typedef std::string value_type;
204 static const value_type& Canonicalize(
const value_type& x)
209 static const std::vector<value_type>& Canonicalize(
210 const std::vector<value_type>& x)
223 typedef std::map<SdfPath, SdfPath> Type;
224 typedef Type::key_type key_type;
225 typedef Type::mapped_type mapped_type;
226 typedef Type::value_type value_type;
229 static Type CanonicalizeType(
const SdfSpecHandle& v,
const Type& x);
231 static key_type CanonicalizeKey(
const SdfSpecHandle& v,
234 static mapped_type CanonicalizeValue(
const SdfSpecHandle& v,
235 const mapped_type& x);
237 static value_type CanonicalizePair(
const SdfSpecHandle& v,
238 const value_type& x);
254 return x->GetSpecType() == _type;
283PXR_NAMESPACE_CLOSE_SCOPE
Predicate for viewing attributes.
Predicate for viewing properties.
SdfHandle is a smart ptr that calls IsDormant() on the pointed-to object as an extra expiration check...
Key policy for std::string names.
Key policy for TfToken names.
A path value used to locate objects in layers or scenegraphs.
SDF_API SdfPath MakeAbsolutePath(const SdfPath &anchor) const
Returns the absolute form of this path using anchor as the relative basis.
static SDF_API const SdfPath & AbsoluteRootPath()
The absolute path representing the top of the namespace hierarchy.
bool IsEmpty() const noexcept
Returns true if this is the empty path (SdfPath::EmptyPath()).
Key policy for SdfPath; converts all SdfPaths to absolute.
Represents a payload and all its meta data.
List editor type policy for SdfPayload.
Represents a reference and all its meta data.
List editor type policy for SdfReference.
Predicate for viewing relationships.
Map edit proxy value policy for relocates maps.
List editor type policy for sublayers.
Token for efficient comparison, assignment, and hashing of known strings.
#define TF_FOR_ALL(iter, c)
Macro for iterating over a container.
#define TF_AXIOM(cond)
Aborts if the condition cond is not met.
SdfSpecType
An enum that specifies the type of an object.