7#ifndef PXR_USD_SDF_PROXY_POLICIES_H
8#define PXR_USD_SDF_PROXY_POLICIES_H
13#include "pxr/usd/sdf/api.h"
15#include "pxr/usd/sdf/path.h"
18PXR_NAMESPACE_OPEN_SCOPE
28 typedef std::string value_type;
30 static const value_type& Canonicalize(
const value_type& x)
35 static const std::vector<value_type>& Canonicalize(
36 const std::vector<value_type>& x)
55 static const std::vector<value_type>& Canonicalize(
56 const std::vector<value_type>& x)
76 return _Canonicalize(x, _GetAnchor());
79 std::vector<value_type> Canonicalize(
const std::vector<value_type>& x)
const
85 const SdfPath anchor = _GetAnchor();
87 std::vector<value_type> result = x;
89 *it = _Canonicalize(*it, anchor);
99 return _owner ? _owner->GetPath().GetPrimPath() :
109 SdfSpecHandle _owner;
115 static Vt_DefaultValueHolder Invoke() {
116 TF_AXIOM(
false &&
"Failed VtValue::Get<SdfPathKeyPolicy> not allowed");
117 return Vt_DefaultValueHolder::Create((
void*)0);
134 static const std::vector<value_type>& Canonicalize(
135 const std::vector<value_type>& x)
144 static Vt_DefaultValueHolder Invoke() {
145 TF_AXIOM(
false &&
"Failed VtValue::Get<SdfPayloadTypePolicy> not allowed");
146 return Vt_DefaultValueHolder::Create((
void*)0);
163 static const std::vector<value_type>& Canonicalize(
164 const std::vector<value_type>& x)
173 static Vt_DefaultValueHolder Invoke() {
174 TF_AXIOM(
false &&
"Failed VtValue::Get<SdfReferenceTypePolicy> not allowed");
175 return Vt_DefaultValueHolder::Create((
void*)0);
185 typedef std::string value_type;
187 static const value_type& Canonicalize(
const value_type& x)
192 static const std::vector<value_type>& Canonicalize(
193 const std::vector<value_type>& x)
206 typedef std::map<SdfPath, SdfPath> Type;
207 typedef Type::key_type key_type;
208 typedef Type::mapped_type mapped_type;
209 typedef Type::value_type value_type;
212 static Type CanonicalizeType(
const SdfSpecHandle& v,
const Type& x);
214 static key_type CanonicalizeKey(
const SdfSpecHandle& v,
217 static mapped_type CanonicalizeValue(
const SdfSpecHandle& v,
218 const mapped_type& x);
220 static value_type CanonicalizePair(
const SdfSpecHandle& v,
221 const value_type& x);
237 return x->GetSpecType() == _type;
266PXR_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.