All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
schema.h
1//
2// Copyright 2016 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_SDF_SCHEMA_H
8#define PXR_USD_SDF_SCHEMA_H
9
10#include "pxr/pxr.h"
11#include "pxr/usd/sdf/api.h"
12#include "pxr/usd/sdf/allowed.h"
13#include "pxr/usd/sdf/types.h"
14#include "pxr/usd/sdf/valueTypeName.h"
15
16#include "pxr/base/plug/notice.h"
17#include "pxr/base/tf/hash.h"
18#include "pxr/base/tf/hashmap.h"
21#include "pxr/base/tf/token.h"
22#include "pxr/base/tf/type.h"
24#include "pxr/base/vt/value.h"
25
26#include <memory>
27#include <string>
28#include <vector>
29
30PXR_NAMESPACE_OPEN_SCOPE
31
32class JsValue;
33class SdfPath;
34class SdfPayload;
35class SdfReference;
36class Sdf_ValueTypeRegistry;
37
39
45class SdfSchemaBase : public TfWeakBase {
46 SdfSchemaBase(const SdfSchemaBase&) = delete;
47 SdfSchemaBase& operator=(const SdfSchemaBase&) = delete;
48protected:
49 class _SpecDefiner;
50
51public:
57 public:
59 const SdfSchemaBase& schema,
60 const TfToken& name,
61 const VtValue& fallbackValue);
62
63 typedef std::vector< std::pair<TfToken, JsValue> > InfoVec;
64
65 SDF_API const TfToken& GetName() const;
66 SDF_API const VtValue& GetFallbackValue() const;
67 SDF_API const InfoVec& GetInfo() const;
68
69 SDF_API bool IsPlugin() const;
70 SDF_API bool IsReadOnly() const;
71 SDF_API bool HoldsChildren() const;
72
76
77 template <class T>
78 SdfAllowed IsValidValue(const T& value) const
79 {
80 return (_valueValidator ?
81 _valueValidator(_schema, VtValue(value)) :
82 SdfAllowed(true));
83 }
84
85 template <class T>
86 SdfAllowed IsValidListValue(const T& value) const
87 {
88 return (_listValueValidator ?
89 _listValueValidator(_schema, VtValue(value)) :
90 SdfAllowed(true));
91 }
92
93 template <class T>
94 SdfAllowed IsValidMapKey(const T& value) const
95 {
96 return (_mapKeyValidator ?
97 _mapKeyValidator(_schema, VtValue(value)) :
98 SdfAllowed(true));
99 }
100
101 template <class T>
102 SdfAllowed IsValidMapValue(const T& value) const
103 {
104 return (_mapValueValidator ?
105 _mapValueValidator(_schema, VtValue(value)) :
106 SdfAllowed(true));
107 }
108
110
113
115
116 FieldDefinition& Plugin();
117 FieldDefinition& Children();
118 FieldDefinition& ReadOnly();
119 FieldDefinition& AddInfo(const TfToken& tok, const JsValue& val);
120
121 using Validator =
122 SdfAllowed (*) (const SdfSchemaBase&, const VtValue&);
123 FieldDefinition& ValueValidator(Validator v);
124 FieldDefinition& ListValueValidator(Validator v);
125 FieldDefinition& MapKeyValidator(Validator v);
126 FieldDefinition& MapValueValidator(Validator v);
127
129
130 private:
131 const SdfSchemaBase& _schema;
132 TfToken _name;
133 VtValue _fallbackValue;
134 InfoVec _info;
135
136 bool _isPlugin;
137 bool _isReadOnly;
138 bool _holdsChildren;
139
140 Validator _valueValidator;
141 Validator _listValueValidator;
142 Validator _mapKeyValidator;
143 Validator _mapValueValidator;
144 };
145
146 // Structure containing information about a field as it pertains to the
147 // spec this object defines.
148 struct _FieldInfo {
149 _FieldInfo(): required(false), metadata(false) { }
150 bool required;
151 bool metadata;
152 TfToken metadataDisplayGroup;
153 };
154
155 class SpecDefinition;
156
162 public:
164 SDF_API TfTokenVector GetFields() const;
165
168 return _requiredFields;
169 }
170
173
175 SDF_API bool IsValidField(const TfToken& name) const;
176
178 SDF_API bool IsMetadataField(const TfToken& name) const;
179
183 SDF_API
185
187 SDF_API bool IsRequiredField(const TfToken& name) const;
188
189
190 private:
191 typedef TfHashMap<TfToken, _FieldInfo, TfToken::HashFunctor>
192 _FieldMap;
193 _FieldMap _fields;
194
195 // A separate vector of required field names from _fields. Access to
196 // these is in a hot path, so we cache them separately.
197 TfTokenVector _requiredFields;
198
199 private:
200 friend class _SpecDefiner;
201 void _AddField(const TfToken& name, const _FieldInfo& fieldInfo);
202 };
203
206 SDF_API
207 const FieldDefinition* GetFieldDefinition(const TfToken &fieldKey) const;
208
211 inline const SpecDefinition* GetSpecDefinition(SdfSpecType specType) const {
212 #ifdef PXR_PREFER_SAFETY_OVER_SPEED
213 if (ARCH_UNLIKELY(specType < SdfSpecTypeUnknown ||
214 specType >= SdfNumSpecTypes))
215 {
216 return _IssueErrorForInvalidSpecType(specType);
217 }
218 #endif // PXR_PREFER_SAFETY_OVER_SPEED
219
220 return _specDefinitions[specType].second ?
221 &_specDefinitions[specType].first : nullptr;
222 }
223
226
229 SDF_API
230 bool IsRegistered(const TfToken &fieldKey, VtValue *fallback=NULL) const;
231
234 SDF_API
235 bool HoldsChildren(const TfToken &fieldKey) const;
236
239 SDF_API
240 const VtValue& GetFallback(const TfToken &fieldKey) const;
241
243 SDF_API
244 VtValue CastToTypeOf(const TfToken &fieldKey, const VtValue &value) const;
245
247 SDF_API
248 bool IsValidFieldForSpec(const TfToken &fieldKey, SdfSpecType specType) const;
249
251 SDF_API TfTokenVector GetFields(SdfSpecType specType) const;
252
255
259 SDF_API
261 TfToken const &metadataField) const;
262
264 SDF_API const TfTokenVector &GetRequiredFields(SdfSpecType specType) const;
265
270 inline bool IsRequiredFieldName(const TfToken &fieldName) const {
271 for (TfToken const &fname: _requiredFieldNames) {
272 if (fname == fieldName) {
273 return true;
274 }
275 }
276 return false;
277 }
278
280
285
286 SDF_API
288 SDF_API
289 static SdfAllowed IsValidIdentifier(const std::string& name);
290 SDF_API
291 static SdfAllowed IsValidNamespacedIdentifier(const std::string& name);
292 SDF_API
293 static SdfAllowed IsValidInheritPath(const SdfPath& path);
294 SDF_API
295 static SdfAllowed IsValidPayload(const SdfPayload& payload);
296 SDF_API
297 static SdfAllowed IsValidReference(const SdfReference& ref);
298 SDF_API
299 static SdfAllowed IsValidRelationshipTargetPath(const SdfPath& path);
300 SDF_API
301 static SdfAllowed IsValidRelocatesSourcePath(const SdfPath& path);
302 SDF_API
303 static SdfAllowed IsValidRelocatesTargetPath(const SdfPath& path);
304 SDF_API
305 static SdfAllowed IsValidRelocate(const SdfRelocate& relocate);
306 SDF_API
307 static SdfAllowed IsValidSpecializesPath(const SdfPath& path);
308 SDF_API
309 static SdfAllowed IsValidSubLayer(const std::string& sublayer);
310 SDF_API
311 static SdfAllowed IsValidVariantIdentifier(const std::string& name);
312 SDF_API
313 static SdfAllowed IsValidVariantSelection(const std::string& sel);
314
316
319
325 SDF_API
326 SdfAllowed IsValidValue(const VtValue& value) const;
327
329 SDF_API
330 std::vector<SdfValueTypeName> GetAllTypes() const;
331
333 SDF_API
334 SdfValueTypeName FindType(const TfToken& typeName) const;
336 SDF_API
337 SdfValueTypeName FindType(const char *typeName) const;
339 SDF_API
340 SdfValueTypeName FindType(std::string const &typeName) const;
341
343 SDF_API
345 const TfToken& role = TfToken()) const;
346
348 SDF_API
350 const TfToken& role = TfToken()) const;
351
355 SDF_API
357
359
360protected:
366 public:
369
371 const TfToken& name, bool required = false);
372 _SpecDefiner& MetadataField(
373 const TfToken& name, bool required = false);
374 _SpecDefiner& MetadataField(
375 const TfToken& name, const TfToken& displayGroup,
376 bool required = false);
377
378 _SpecDefiner &CopyFrom(const SpecDefinition &other);
379
381 private:
382 friend class SdfSchemaBase;
383 explicit _SpecDefiner(SdfSchemaBase *schema, SpecDefinition *definition)
384 : _schema(schema)
385 , _definition(definition)
386 {}
387 SdfSchemaBase *_schema;
388 SpecDefinition *_definition;
389 };
390
393 public:
394 explicit _ValueTypeRegistrar(Sdf_ValueTypeRegistry*);
395
396 class Type
397 {
398 public:
399 ~Type();
400
401 // Specify a type with the given name, default value, and default
402 // array value of VtArray<T>.
403 template <class T>
404 Type(const TfToken& name, const T& defaultValue)
405 : Type(name, VtValue(defaultValue), VtValue(VtArray<T>()))
406 { }
407 template <class T>
408 Type(char const *name, const T& defaultValue)
409 : Type(TfToken(name),
410 VtValue(defaultValue), VtValue(VtArray<T>()))
411 { }
412
413 // Specify a type with the given name and underlying C++ type.
414 // No default value or array value will be registered.
415 Type(const TfToken& name, const TfType& type);
416
417 // Set C++ type name string for this type. Defaults to type name
418 // from TfType.
419 Type& CPPTypeName(const std::string& cppTypeName);
420
421 // Set shape for this type. Defaults to shapeless.
422 Type& Dimensions(const SdfTupleDimensions& dims);
423
424 // Set default unit for this type. Defaults to dimensionless unit.
425 Type& DefaultUnit(TfEnum unit);
426
427 // Set role for this type. Defaults to no role.
428 Type& Role(const TfToken& role);
429
430 // Indicate that arrays of this type are not supported.
431 Type& NoArrays();
432
433 private:
434 Type(const TfToken& name,
435 const VtValue& defaultValue,
436 const VtValue& defaultArrayValue);
437
438 class _Impl;
439 std::unique_ptr<_Impl> _impl;
440
441 friend class _ValueTypeRegistrar;
442 };
443
445 void AddType(const Type& type);
446
447 private:
448 Sdf_ValueTypeRegistry* _registry;
449 };
450
452
455 class EmptyTag {};
457
458 virtual ~SdfSchemaBase();
459
467 template <class T>
469 const TfToken &fieldKey, const T &fallback, bool plugin = false)
470 {
471 return _CreateField(fieldKey, VtValue(fallback), plugin);
472 }
473
477 // Mark the definition as valid and return a pointer to it.
478 _specDefinitions[type].second = true;
479 return _SpecDefiner(this, &_specDefinitions[type].first);
480 }
481
485
488
492
495
498
501
505 typedef std::function<VtValue(const std::string&, const JsValue&)>
507
510 const std::vector<const SdfSchemaBase::FieldDefinition *>
511 _UpdateMetadataFromPlugins(const PlugPluginPtrVector& plugins,
512 const std::string& metadataTag =
513 std::string(),
514 const _DefaultValueFactoryFn& defFactory =
516
517private:
518 friend class _SpecDefiner;
519
520 void _OnDidRegisterPlugins(const PlugNotice::DidRegisterPlugins& n);
521
522 // Return a _SpecDefiner for an existing spec definition, \p local.
524 return _SpecDefiner(this, local);
525 }
526
527 void _AddRequiredFieldName(const TfToken &name);
528
529 const SpecDefinition* _CheckAndGetSpecDefinition(SdfSpecType type) const;
530
531 SDF_API
532 const SpecDefinition* _IssueErrorForInvalidSpecType(SdfSpecType specType) const;
533
534 friend struct Sdf_SchemaFieldTypeRegistrar;
535 FieldDefinition& _CreateField(
536 const TfToken &fieldKey, const VtValue &fallback, bool plugin = false);
537
538 template <class T>
539 FieldDefinition& _DoRegisterField(const TfToken &fieldKey, const T &fallback)
540 {
541 return _DoRegisterField(fieldKey, VtValue(fallback));
542 }
543
544 FieldDefinition& _DoRegisterField(
545 const TfToken &fieldKey, const VtValue &fallback);
546
547private:
548 typedef TfHashMap<TfToken, SdfSchemaBase::FieldDefinition,
550 _FieldDefinitionMap;
551 _FieldDefinitionMap _fieldDefinitions;
552
553 // Pair of definition and flag indicating validity.
554 std::pair<SdfSchemaBase::SpecDefinition, bool>
555 _specDefinitions[SdfNumSpecTypes];
556
557 std::unique_ptr<Sdf_ValueTypeRegistry> _valueTypeRegistry;
558 TfTokenVector _requiredFieldNames;
559};
560
566class SdfSchema : public SdfSchemaBase {
567public:
568 SDF_API
569 static const SdfSchema& GetInstance()
570 {
572 }
573
574private:
575 friend class TfSingleton<SdfSchema>;
576 SdfSchema();
577 virtual ~SdfSchema();
578};
579
580SDF_API_TEMPLATE_CLASS(TfSingleton<SdfSchema>);
581
585#define SDF_FIELD_KEYS \
586 ((Active, "active")) \
587 ((AllowedTokens, "allowedTokens")) \
588 ((AssetInfo, "assetInfo")) \
589 ((ColorConfiguration, "colorConfiguration")) \
590 ((ColorManagementSystem, "colorManagementSystem")) \
591 ((ColorSpace, "colorSpace")) \
592 ((Comment, "comment")) \
593 ((ConnectionPaths, "connectionPaths")) \
594 ((Custom, "custom")) \
595 ((CustomData, "customData")) \
596 ((CustomLayerData, "customLayerData")) \
597 ((Default, "default")) \
598 ((DefaultPrim, "defaultPrim")) \
599 ((DisplayGroup, "displayGroup")) \
600 ((DisplayGroupOrder, "displayGroupOrder")) \
601 ((DisplayName, "displayName")) \
602 ((DisplayUnit, "displayUnit")) \
603 ((Documentation, "documentation")) \
604 ((EndTimeCode, "endTimeCode")) \
605 ((ExpressionVariables, "expressionVariables")) \
606 ((FramePrecision, "framePrecision")) \
607 ((FramesPerSecond, "framesPerSecond")) \
608 ((Hidden, "hidden")) \
609 ((HasOwnedSubLayers, "hasOwnedSubLayers")) \
610 ((InheritPaths, "inheritPaths")) \
611 ((Instanceable, "instanceable")) \
612 ((Kind, "kind")) \
613 ((LayerRelocates, "layerRelocates")) \
614 ((PrimOrder, "primOrder")) \
615 ((NoLoadHint, "noLoadHint")) \
616 ((Owner, "owner")) \
617 ((Payload, "payload")) \
618 ((Permission, "permission")) \
619 ((Prefix, "prefix")) \
620 ((PrefixSubstitutions, "prefixSubstitutions")) \
621 ((PropertyOrder, "propertyOrder")) \
622 ((References, "references")) \
623 ((Relocates, "relocates")) \
624 ((SessionOwner, "sessionOwner")) \
625 ((Specializes, "specializes")) \
626 ((Specifier, "specifier")) \
627 ((Spline, "spline")) \
628 ((StartTimeCode, "startTimeCode")) \
629 ((SubLayers, "subLayers")) \
630 ((SubLayerOffsets, "subLayerOffsets")) \
631 ((Suffix, "suffix")) \
632 ((SuffixSubstitutions, "suffixSubstitutions")) \
633 ((SymmetricPeer, "symmetricPeer")) \
634 ((SymmetryArgs, "symmetryArgs")) \
635 ((SymmetryArguments, "symmetryArguments")) \
636 ((SymmetryFunction, "symmetryFunction")) \
637 ((TargetPaths, "targetPaths")) \
638 ((TimeSamples, "timeSamples")) \
639 ((TimeCodesPerSecond, "timeCodesPerSecond")) \
640 ((TypeName, "typeName")) \
641 ((VariantSelection, "variantSelection")) \
642 ((Variability, "variability")) \
643 ((VariantSetNames, "variantSetNames")) \
644 \
645 /* XXX: These fields should move into Sd. See bug 123508. */ \
646 ((EndFrame, "endFrame")) \
647 ((StartFrame, "startFrame"))
648
649#define SDF_CHILDREN_KEYS \
650 ((ConnectionChildren, "connectionChildren")) \
651 ((ExpressionChildren, "expressionChildren")) \
652 ((MapperArgChildren, "mapperArgChildren")) \
653 ((MapperChildren, "mapperChildren")) \
654 ((PrimChildren, "primChildren")) \
655 ((PropertyChildren, "properties")) \
656 ((RelationshipTargetChildren, "targetChildren")) \
657 ((VariantChildren, "variantChildren")) \
658 ((VariantSetChildren, "variantSetChildren"))
659
660TF_DECLARE_PUBLIC_TOKENS(SdfFieldKeys, SDF_API, SDF_FIELD_KEYS);
661TF_DECLARE_PUBLIC_TOKENS(SdfChildrenKeys, SDF_API, SDF_CHILDREN_KEYS);
662
663PXR_NAMESPACE_CLOSE_SCOPE
664
665#endif // PXR_USD_SDF_SCHEMA_H
A discriminated union type for JSON values.
Definition: value.h:45
Notice sent after new plugins have been registered with the Plug registry.
Definition: notice.h:34
Defines an interface to registered plugins.
Definition: plugin.h:40
Indicates if an operation is allowed and, if not, why not.
Definition: allowed.h:29
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Represents a payload and all its meta data.
Definition: payload.h:41
Represents a reference and all its meta data.
Definition: reference.h:58
Class that defines fields for a spec type.
Definition: schema.h:365
_SpecDefiner & Field(const TfToken &name, bool required=false)
Functions for setting spec attributes during registration.
A helper for registering value types.
Definition: schema.h:392
void AddType(const Type &type)
Register a value type and its corresponding array value type.
Class defining various attributes for a field.
Definition: schema.h:56
FieldDefinition & FallbackValue(const VtValue &v)
Functions for setting field attributes during registration.
SdfAllowed IsValidValue(const T &value) const
Validation functions that return true if a given value passes the registered validator or if no valid...
Definition: schema.h:78
Class representing fields and other information for a spec type.
Definition: schema.h:161
SDF_API bool IsValidField(const TfToken &name) const
Returns whether the given field is valid for this spec.
TfTokenVector const & GetRequiredFields() const
Returns all value fields marked as required for this spec.
Definition: schema.h:167
SDF_API TfTokenVector GetFields() const
Returns all fields for this spec.
SDF_API bool IsMetadataField(const TfToken &name) const
Returns whether the given field is metadata for this spec.
SDF_API bool IsRequiredField(const TfToken &name) const
Returns whether the given field is required for this spec.
SDF_API TfTokenVector GetMetadataFields() const
Returns all value fields marked as metadata for this spec.
SDF_API TfToken GetMetadataFieldDisplayGroup(const TfToken &name) const
Returns the display group for this metadata field.
Generic class that provides information about scene description fields but doesn't actually provide a...
Definition: schema.h:45
void _RegisterPluginFields()
Registers plugin fields and sets up handling so that fields will be added when additional plugins are...
SDF_API std::vector< SdfValueTypeName > GetAllTypes() const
Returns all registered type names.
SDF_API TfToken GetMetadataFieldDisplayGroup(SdfSpecType specType, TfToken const &metadataField) const
Return the metadata field display group for metadata metadataField on specType.
SDF_API VtValue CastToTypeOf(const TfToken &fieldKey, const VtValue &value) const
Coerce value to the correct type for the specified field.
SDF_API const FieldDefinition * GetFieldDefinition(const TfToken &fieldKey) const
Returns the field definition for the given field.
SDF_API SdfValueTypeName FindType(const TfToken &typeName) const
Return the type name object for the given type name token.
std::function< VtValue(const std::string &, const JsValue &)> _DefaultValueFactoryFn
Factory function for creating a default value for a metadata field.
Definition: schema.h:506
bool IsRequiredFieldName(const TfToken &fieldName) const
Return true if fieldName is a required field name for at least one spec type, return false otherwise.
Definition: schema.h:270
SDF_API bool HoldsChildren(const TfToken &fieldKey) const
Returns whether the given field is a 'children' field – that is, it indexes certain children beneath ...
SDF_API TfTokenVector GetMetadataFields(SdfSpecType specType) const
Returns all metadata fields registered for the given spec type.
SDF_API SdfValueTypeName FindType(const VtValue &value, const TfToken &role=TfToken()) const
Return the type name object for the value's type and optional role.
_SpecDefiner _ExtendSpecDefinition(SdfSpecType specType)
Returns a _SpecDefiner for the previously-defined spec type for specifying additional fields.
SDF_API bool IsRegistered(const TfToken &fieldKey, VtValue *fallback=NULL) const
Convenience functions for accessing specific field information.
SDF_API SdfValueTypeName FindOrCreateType(const TfToken &typeName) const
Return the type name object for the given type name string if it exists otherwise create a temporary ...
static SDF_API SdfAllowed IsValidAttributeConnectionPath(const SdfPath &path)
Specific validation functions for various fields.
SDF_API const VtValue & GetFallback(const TfToken &fieldKey) const
Return the fallback value for the specified fieldKey or the empty value if fieldKey is not registered...
void _RegisterStandardTypes()
Registers standard attribute value types.
void _RegisterStandardFields()
Registers the standard fields.
SDF_API SdfAllowed IsValidValue(const VtValue &value) const
Scene description value types.
SDF_API SdfValueTypeName FindType(std::string const &typeName) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
const std::vector< const SdfSchemaBase::FieldDefinition * > _UpdateMetadataFromPlugins(const PlugPluginPtrVector &plugins, const std::string &metadataTag=std::string(), const _DefaultValueFactoryFn &defFactory=_DefaultValueFactoryFn())
Registers all metadata fields specified in the given plugins under the given metadata tag.
const SpecDefinition * GetSpecDefinition(SdfSpecType specType) const
Returns the spec definition for the given spec type.
Definition: schema.h:211
SDF_API bool IsValidFieldForSpec(const TfToken &fieldKey, SdfSpecType specType) const
Return whether the given field is valid for the given spec type.
SDF_API TfTokenVector GetFields(SdfSpecType specType) const
Returns all fields registered for the given spec type.
void _RegisterLegacyTypes()
Registers legacy attribute value types.
SDF_API SdfValueTypeName FindType(const TfType &type, const TfToken &role=TfToken()) const
Return the type name object for the given type and optional role.
_ValueTypeRegistrar _GetTypeRegistrar() const
Returns a type registrar.
SDF_API SdfValueTypeName FindType(const char *typeName) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
_SpecDefiner _Define(SdfSpecType type)
Registers the given spec type with this schema and return a _SpecDefiner for specifying additional fi...
Definition: schema.h:476
SDF_API const TfTokenVector & GetRequiredFields(SdfSpecType specType) const
Returns all required fields registered for the given spec type.
FieldDefinition & _RegisterField(const TfToken &fieldKey, const T &fallback, bool plugin=false)
Creates and registers a new field named fieldKey with the fallback value fallback.
Definition: schema.h:468
Construct an SdfSchemaBase but does not populate it with standard fields and types.
Definition: schema.h:455
Class that provides information about the various scene description fields.
Definition: schema.h:566
Represents a value type name, i.e.
Definition: valueTypeName.h:71
An enum class that records both enum type and enum value.
Definition: enum.h:120
Manage a single instance of an object (see.
Definition: singleton.h:105
static T & GetInstance()
Return a reference to an object of type T, creating it if necessary.
Definition: singleton.h:120
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
TfType represents a dynamic runtime type.
Definition: type.h:48
Enable a concrete base class for use with TfWeakPtr.
Definition: weakBase.h:124
Represents an arbitrary dimensional rectangular container class.
Definition: array.h:211
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:147
#define TF_DECLARE_WEAK_PTRS(type)
Define standard weak pointer types.
Definition: declarePtrs.h:45
Manage a single instance of an object.
This file defines some macros that are useful for declaring and using static TfTokens.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:81
Represents the shape of a value type (or that of an element in an array).
Definition: valueTypeName.h:30
Functor to use for hash maps from tokens to other things.
Definition: token.h:149
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
Basic Sdf data types.
SdfSpecType
An enum that specifies the type of an object.
Definition: types.h:68
std::pair< SdfPath, SdfPath > SdfRelocate
A single relocate specifying a source SdfPath and a target SdfPath for a relocation.
Definition: types.h:271