schema.h
1 //
2 // Copyright 2016 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_SDF_SCHEMA_H
25 #define PXR_USD_SDF_SCHEMA_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/usd/sdf/api.h"
29 #include "pxr/usd/sdf/allowed.h"
30 #include "pxr/usd/sdf/types.h"
31 #include "pxr/usd/sdf/valueTypeName.h"
32 
33 #include "pxr/base/plug/notice.h"
34 #include "pxr/base/tf/hash.h"
35 #include "pxr/base/tf/hashmap.h"
36 #include "pxr/base/tf/singleton.h"
38 #include "pxr/base/tf/token.h"
39 #include "pxr/base/tf/type.h"
40 #include "pxr/base/tf/weakBase.h"
41 #include "pxr/base/vt/value.h"
42 
43 #include <memory>
44 #include <string>
45 #include <vector>
46 
47 PXR_NAMESPACE_OPEN_SCOPE
48 
49 class JsValue;
50 class SdfPath;
51 class SdfPayload;
52 class SdfReference;
53 class Sdf_ValueTypeRegistry;
54 
56 
62 class SdfSchemaBase : public TfWeakBase, public boost::noncopyable {
63 
64 protected:
65  class _SpecDefiner;
66 
67 public:
73  public:
75  const SdfSchemaBase& schema,
76  const TfToken& name,
77  const VtValue& fallbackValue);
78 
79  typedef std::vector< std::pair<TfToken, JsValue> > InfoVec;
80 
81  SDF_API const TfToken& GetName() const;
82  SDF_API const VtValue& GetFallbackValue() const;
83  SDF_API const InfoVec& GetInfo() const;
84 
85  SDF_API bool IsPlugin() const;
86  SDF_API bool IsReadOnly() const;
87  SDF_API bool HoldsChildren() const;
88 
92 
93  template <class T>
94  SdfAllowed IsValidValue(const T& value) const
95  {
96  return (_valueValidator ?
97  _valueValidator(_schema, VtValue(value)) :
98  SdfAllowed(true));
99  }
100 
101  template <class T>
102  SdfAllowed IsValidListValue(const T& value) const
103  {
104  return (_listValueValidator ?
105  _listValueValidator(_schema, VtValue(value)) :
106  SdfAllowed(true));
107  }
108 
109  template <class T>
110  SdfAllowed IsValidMapKey(const T& value) const
111  {
112  return (_mapKeyValidator ?
113  _mapKeyValidator(_schema, VtValue(value)) :
114  SdfAllowed(true));
115  }
116 
117  template <class T>
118  SdfAllowed IsValidMapValue(const T& value) const
119  {
120  return (_mapValueValidator ?
121  _mapValueValidator(_schema, VtValue(value)) :
122  SdfAllowed(true));
123  }
124 
126 
129 
130  FieldDefinition& FallbackValue(const VtValue& v);
131 
132  FieldDefinition& Plugin();
133  FieldDefinition& Children();
134  FieldDefinition& ReadOnly();
135  FieldDefinition& AddInfo(const TfToken& tok, const JsValue& val);
136 
137  using Validator =
138  SdfAllowed (*) (const SdfSchemaBase&, const VtValue&);
139  FieldDefinition& ValueValidator(Validator v);
140  FieldDefinition& ListValueValidator(Validator v);
141  FieldDefinition& MapKeyValidator(Validator v);
142  FieldDefinition& MapValueValidator(Validator v);
143 
145 
146  private:
147  const SdfSchemaBase& _schema;
148  TfToken _name;
149  VtValue _fallbackValue;
150  InfoVec _info;
151 
152  bool _isPlugin;
153  bool _isReadOnly;
154  bool _holdsChildren;
155 
156  Validator _valueValidator;
157  Validator _listValueValidator;
158  Validator _mapKeyValidator;
159  Validator _mapValueValidator;
160  };
161 
162  // Structure containing information about a field as it pertains to the
163  // spec this object defines.
164  struct _FieldInfo {
165  _FieldInfo(): required(false), metadata(false) { }
166  bool required;
167  bool metadata;
168  TfToken metadataDisplayGroup;
169  };
170 
171  class SpecDefinition;
172 
178  public:
180  SDF_API TfTokenVector GetFields() const;
181 
184  return _requiredFields;
185  }
186 
188  SDF_API TfTokenVector GetMetadataFields() const;
189 
191  SDF_API bool IsValidField(const TfToken& name) const;
192 
194  SDF_API bool IsMetadataField(const TfToken& name) const;
195 
199  SDF_API
200  TfToken GetMetadataFieldDisplayGroup(const TfToken& name) const;
201 
203  SDF_API bool IsRequiredField(const TfToken& name) const;
204 
205 
206  private:
207  typedef TfHashMap<TfToken, _FieldInfo, TfToken::HashFunctor>
208  _FieldMap;
209  _FieldMap _fields;
210 
211  // A separate vector of required field names from _fields. Access to
212  // these is in a hot path, so we cache them separately.
213  TfTokenVector _requiredFields;
214 
215  private:
216  friend class _SpecDefiner;
217  void _AddField(const TfToken& name, const _FieldInfo& fieldInfo);
218  };
219 
222  SDF_API
223  const FieldDefinition* GetFieldDefinition(const TfToken &fieldKey) const;
224 
227  inline const SpecDefinition* GetSpecDefinition(SdfSpecType specType) const {
228  return _specDefinitions[specType].second ?
229  &_specDefinitions[specType].first : nullptr;
230  }
231 
234 
237  SDF_API
238  bool IsRegistered(const TfToken &fieldKey, VtValue *fallback=NULL) const;
239 
242  SDF_API
243  bool HoldsChildren(const TfToken &fieldKey) const;
244 
247  SDF_API
248  const VtValue& GetFallback(const TfToken &fieldKey) const;
249 
251  SDF_API
252  VtValue CastToTypeOf(const TfToken &fieldKey, const VtValue &value) const;
253 
255  SDF_API
256  bool IsValidFieldForSpec(const TfToken &fieldKey, SdfSpecType specType) const;
257 
259  SDF_API TfTokenVector GetFields(SdfSpecType specType) const;
260 
262  SDF_API TfTokenVector GetMetadataFields(SdfSpecType specType) const;
263 
267  SDF_API
269  TfToken const &metadataField) const;
270 
272  SDF_API const TfTokenVector &GetRequiredFields(SdfSpecType specType) const;
273 
278  inline bool IsRequiredFieldName(const TfToken &fieldName) const {
279  for (TfToken const &fname: _requiredFieldNames) {
280  if (fname == fieldName) {
281  return true;
282  }
283  }
284  return false;
285  }
286 
288 
293 
294  SDF_API
296  SDF_API
297  static SdfAllowed IsValidIdentifier(const std::string& name);
298  SDF_API
299  static SdfAllowed IsValidNamespacedIdentifier(const std::string& name);
300  SDF_API
301  static SdfAllowed IsValidInheritPath(const SdfPath& path);
302  SDF_API
303  static SdfAllowed IsValidPayload(const SdfPayload& payload);
304  SDF_API
305  static SdfAllowed IsValidReference(const SdfReference& ref);
306  SDF_API
307  static SdfAllowed IsValidRelationshipTargetPath(const SdfPath& path);
308  SDF_API
309  static SdfAllowed IsValidRelocatesPath(const SdfPath& path);
310  SDF_API
311  static SdfAllowed IsValidSpecializesPath(const SdfPath& path);
312  SDF_API
313  static SdfAllowed IsValidSubLayer(const std::string& sublayer);
314  SDF_API
315  static SdfAllowed IsValidVariantIdentifier(const std::string& name);
316 
318 
321 
327  SDF_API
328  SdfAllowed IsValidValue(const VtValue& value) const;
329 
331  SDF_API
332  std::vector<SdfValueTypeName> GetAllTypes() const;
333 
335  SDF_API
336  SdfValueTypeName FindType(const TfToken& typeName) const;
338  SDF_API
339  SdfValueTypeName FindType(const char *typeName) const;
341  SDF_API
342  SdfValueTypeName FindType(std::string const &typeName) const;
343 
345  SDF_API
346  SdfValueTypeName FindType(const TfType& type,
347  const TfToken& role = TfToken()) const;
348 
350  SDF_API
351  SdfValueTypeName FindType(const VtValue& value,
352  const TfToken& role = TfToken()) const;
353 
357  SDF_API
358  SdfValueTypeName FindOrCreateType(const TfToken& typeName) const;
359 
361 
362 protected:
367  class _SpecDefiner {
368  public:
371 
373  const TfToken& name, bool required = false);
374  _SpecDefiner& MetadataField(
375  const TfToken& name, bool required = false);
376  _SpecDefiner& MetadataField(
377  const TfToken& name, const TfToken& displayGroup,
378  bool required = false);
379 
380  _SpecDefiner &CopyFrom(const SpecDefinition &other);
381 
383  private:
384  friend class SdfSchemaBase;
385  explicit _SpecDefiner(SdfSchemaBase *schema, SpecDefinition *definition)
386  : _schema(schema)
387  , _definition(definition)
388  {}
389  SdfSchemaBase *_schema;
390  SpecDefinition *_definition;
391  };
392 
395  public:
396  explicit _ValueTypeRegistrar(Sdf_ValueTypeRegistry*);
397 
398  class Type
399  {
400  public:
401  ~Type();
402 
403  // Specify a type with the given name, default value, and default
404  // array value of VtArray<T>.
405  template <class T>
406  Type(const TfToken& name, const T& defaultValue)
407  : Type(name, VtValue(defaultValue), VtValue(VtArray<T>()))
408  { }
409  template <class T>
410  Type(char const *name, const T& defaultValue)
411  : Type(TfToken(name),
412  VtValue(defaultValue), VtValue(VtArray<T>()))
413  { }
414 
415  // Specify a type with the given name and underlying C++ type.
416  // No default value or array value will be registered.
417  Type(const TfToken& name, const TfType& type);
418 
419  // Set C++ type name string for this type. Defaults to type name
420  // from TfType.
421  Type& CPPTypeName(const std::string& cppTypeName);
422 
423  // Set shape for this type. Defaults to shapeless.
424  Type& Dimensions(const SdfTupleDimensions& dims);
425 
426  // Set default unit for this type. Defaults to dimensionless unit.
427  Type& DefaultUnit(TfEnum unit);
428 
429  // Set role for this type. Defaults to no role.
430  Type& Role(const TfToken& role);
431 
432  // Indicate that arrays of this type are not supported.
433  Type& NoArrays();
434 
435  private:
436  Type(const TfToken& name,
437  const VtValue& defaultValue,
438  const VtValue& defaultArrayValue);
439 
440  class _Impl;
441  std::unique_ptr<_Impl> _impl;
442 
443  friend class _ValueTypeRegistrar;
444  };
445 
447  void AddType(const Type& type);
448 
449  private:
450  Sdf_ValueTypeRegistry* _registry;
451  };
452 
453  SdfSchemaBase();
454 
457  class EmptyTag {};
459 
460  virtual ~SdfSchemaBase();
461 
469  template <class T>
471  const TfToken &fieldKey, const T &fallback, bool plugin = false)
472  {
473  return _CreateField(fieldKey, VtValue(fallback), plugin);
474  }
475 
479  // Mark the definition as valid and return a pointer to it.
480  _specDefinitions[type].second = true;
481  return _SpecDefiner(this, &_specDefinitions[type].first);
482  }
483 
486  _SpecDefiner _ExtendSpecDefinition(SdfSpecType specType);
487 
490 
493  void _RegisterPluginFields();
494 
496  void _RegisterStandardTypes();
497 
499  void _RegisterLegacyTypes();
500 
502  _ValueTypeRegistrar _GetTypeRegistrar() const;
503 
507  typedef std::function<VtValue(const std::string&, const JsValue&)>
509 
512  const std::vector<const SdfSchemaBase::FieldDefinition *>
513  _UpdateMetadataFromPlugins(const PlugPluginPtrVector& plugins,
514  const std::string& metadataTag =
515  std::string(),
516  const _DefaultValueFactoryFn& defFactory =
518 
519 private:
520  friend class _SpecDefiner;
521 
522  void _OnDidRegisterPlugins(const PlugNotice::DidRegisterPlugins& n);
523 
524  // Return a _SpecDefiner for an existing spec definition, \p local.
526  return _SpecDefiner(this, local);
527  }
528 
529  void _AddRequiredFieldName(const TfToken &name);
530 
531  const SpecDefinition* _CheckAndGetSpecDefinition(SdfSpecType type) const;
532 
533  friend struct Sdf_SchemaFieldTypeRegistrar;
534  FieldDefinition& _CreateField(
535  const TfToken &fieldKey, const VtValue &fallback, bool plugin = false);
536 
537  template <class T>
538  FieldDefinition& _DoRegisterField(const TfToken &fieldKey, const T &fallback)
539  {
540  return _DoRegisterField(fieldKey, VtValue(fallback));
541  }
542 
543  FieldDefinition& _DoRegisterField(
544  const TfToken &fieldKey, const VtValue &fallback);
545 
546 private:
547  typedef TfHashMap<TfToken, SdfSchemaBase::FieldDefinition,
549  _FieldDefinitionMap;
550  _FieldDefinitionMap _fieldDefinitions;
551 
552  // Pair of definition and flag indicating validity.
553  std::pair<SdfSchemaBase::SpecDefinition, bool>
554  _specDefinitions[SdfNumSpecTypes];
555 
556  std::unique_ptr<Sdf_ValueTypeRegistry> _valueTypeRegistry;
557  TfTokenVector _requiredFieldNames;
558 };
559 
565 class SdfSchema : public SdfSchemaBase {
566 public:
567  SDF_API
568  static const SdfSchema& GetInstance()
569  {
571  }
572 
573 private:
574  friend class TfSingleton<SdfSchema>;
575  SdfSchema();
576  virtual ~SdfSchema();
577 };
578 
579 SDF_API_TEMPLATE_CLASS(TfSingleton<SdfSchema>);
580 
584 #define SDF_FIELD_KEYS \
585  ((Active, "active")) \
586  ((AllowedTokens, "allowedTokens")) \
587  ((AssetInfo, "assetInfo")) \
588  ((ColorConfiguration, "colorConfiguration")) \
589  ((ColorManagementSystem, "colorManagementSystem")) \
590  ((ColorSpace, "colorSpace")) \
591  ((Comment, "comment")) \
592  ((ConnectionPaths, "connectionPaths")) \
593  ((Custom, "custom")) \
594  ((CustomData, "customData")) \
595  ((CustomLayerData, "customLayerData")) \
596  ((Default, "default")) \
597  ((DefaultPrim, "defaultPrim")) \
598  ((DisplayGroup, "displayGroup")) \
599  ((DisplayGroupOrder, "displayGroupOrder")) \
600  ((DisplayName, "displayName")) \
601  ((DisplayUnit, "displayUnit")) \
602  ((Documentation, "documentation")) \
603  ((EndTimeCode, "endTimeCode")) \
604  ((FramePrecision, "framePrecision")) \
605  ((FramesPerSecond, "framesPerSecond")) \
606  ((Hidden, "hidden")) \
607  ((HasOwnedSubLayers, "hasOwnedSubLayers")) \
608  ((InheritPaths, "inheritPaths")) \
609  ((Instanceable, "instanceable")) \
610  ((Kind, "kind")) \
611  ((PrimOrder, "primOrder")) \
612  ((NoLoadHint, "noLoadHint")) \
613  ((Owner, "owner")) \
614  ((Payload, "payload")) \
615  ((Permission, "permission")) \
616  ((Prefix, "prefix")) \
617  ((PrefixSubstitutions, "prefixSubstitutions")) \
618  ((PropertyOrder, "propertyOrder")) \
619  ((References, "references")) \
620  ((Relocates, "relocates")) \
621  ((SessionOwner, "sessionOwner")) \
622  ((Specializes, "specializes")) \
623  ((Specifier, "specifier")) \
624  ((StartTimeCode, "startTimeCode")) \
625  ((SubLayers, "subLayers")) \
626  ((SubLayerOffsets, "subLayerOffsets")) \
627  ((Suffix, "suffix")) \
628  ((SuffixSubstitutions, "suffixSubstitutions")) \
629  ((SymmetricPeer, "symmetricPeer")) \
630  ((SymmetryArgs, "symmetryArgs")) \
631  ((SymmetryArguments, "symmetryArguments")) \
632  ((SymmetryFunction, "symmetryFunction")) \
633  ((TargetPaths, "targetPaths")) \
634  ((TimeSamples, "timeSamples")) \
635  ((TimeCodesPerSecond, "timeCodesPerSecond")) \
636  ((TypeName, "typeName")) \
637  ((VariantSelection, "variantSelection")) \
638  ((Variability, "variability")) \
639  ((VariantSetNames, "variantSetNames")) \
640  \
641  /* XXX: These fields should move into Sd. See bug 123508. */ \
642  ((EndFrame, "endFrame")) \
643  ((StartFrame, "startFrame"))
644 
645 #define SDF_CHILDREN_KEYS \
646  ((ConnectionChildren, "connectionChildren")) \
647  ((ExpressionChildren, "expressionChildren")) \
648  ((MapperArgChildren, "mapperArgChildren")) \
649  ((MapperChildren, "mapperChildren")) \
650  ((PrimChildren, "primChildren")) \
651  ((PropertyChildren, "properties")) \
652  ((RelationshipTargetChildren, "targetChildren")) \
653  ((VariantChildren, "variantChildren")) \
654  ((VariantSetChildren, "variantSetChildren"))
655 
656 TF_DECLARE_PUBLIC_TOKENS(SdfFieldKeys, SDF_API, SDF_FIELD_KEYS);
657 TF_DECLARE_PUBLIC_TOKENS(SdfChildrenKeys, SDF_API, SDF_CHILDREN_KEYS);
658 
659 PXR_NAMESPACE_CLOSE_SCOPE
660 
661 #endif // PXR_USD_SDF_SCHEMA_H
SDF_API bool IsRegistered(const TfToken &fieldKey, VtValue *fallback=NULL) const
Convenience functions for accessing specific field information.
SDF_API TfTokenVector GetMetadataFields(SdfSpecType specType) const
Returns all metadata fields registered for the given spec type.
SDF_API TfTokenVector GetFields(SdfSpecType specType) const
Returns all fields registered for the given spec type.
Manage a single instance of an object.
void _RegisterPluginFields()
Registers plugin fields and sets up handling so that fields will be added when additional plugins are...
std::function< VtValue(const std::string &, const JsValue &)> _DefaultValueFactoryFn
Factory function for creating a default value for a metadata field.
Definition: schema.h:508
static SDF_API SdfAllowed IsValidAttributeConnectionPath(const SdfPath &path)
Specific validation functions for various fields.
Manage a single instance of an object (see.
Definition: singleton.h:120
SDF_API const FieldDefinition * GetFieldDefinition(const TfToken &fieldKey) const
Returns the field definition for the given field.
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:278
SDF_API VtValue CastToTypeOf(const TfToken &fieldKey, const VtValue &value) const
Coerce value to the correct type for the specified field.
#define TF_DECLARE_WEAK_PTRS(type)
Define standard weak pointer types.
Definition: declarePtrs.h:62
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 TfToken GetMetadataFieldDisplayGroup(SdfSpecType specType, TfToken const &metadataField) const
Return the metadata field display group for metadata metadataField on specType.
TfTokenVector const & GetRequiredFields() const
Returns all value fields marked as required for this spec.
Definition: schema.h:183
void _RegisterLegacyTypes()
Registers legacy attribute value types.
_ValueTypeRegistrar _GetTypeRegistrar() const
Returns a type registrar.
Generic class that provides information about scene description fields but doesn't actually provide a...
Definition: schema.h:62
SDF_API bool IsValidField(const TfToken &name) const
Returns whether the given field is valid for this spec.
Class that defines fields for a spec type.
Definition: schema.h:367
An enum class that records both enum type and enum value.
Definition: enum.h:139
Functor to use for hash maps from tokens to other things.
Definition: token.h:166
_SpecDefiner & Field(const TfToken &name, bool required=false)
Functions for setting spec attributes during registration.
Represents a value type name, i.e.
Definition: valueTypeName.h:87
Basic Sdf data types.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:87
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:470
Class defining various attributes for a field.
Definition: schema.h:72
SDF_API TfToken GetMetadataFieldDisplayGroup(const TfToken &name) const
Returns the display group for this metadata field.
Indicates if an operation is allowed and, if not, why not.
Definition: allowed.h:47
A discriminated union type for JSON values.
Definition: value.h:61
_SpecDefiner _ExtendSpecDefinition(SdfSpecType specType)
Returns a _SpecDefiner for the previously-defined spec type for specifying additional fields.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:118
Represents a payload and all its meta data.
Definition: payload.h:60
SDF_API SdfAllowed IsValidValue(const VtValue &value) const
Scene description value types.
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:442
Class representing fields and other information for a spec type.
Definition: schema.h:177
Represents an arbitrary dimensional rectangular container class.
Definition: array.h:229
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:290
static T & GetInstance()
Return a reference to an object of type T, creating it if necessary.
Definition: singleton.h:135
void AddType(const Type &type)
Register a value type and its corresponding array value type.
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 GetMetadataFields() const
Returns all value fields marked as metadata for this spec.
A helper for registering value types.
Definition: schema.h:394
void _RegisterStandardTypes()
Registers standard attribute value types.
Represents a reference and all its meta data.
Definition: reference.h:77
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...
Defines an interface to registered plugins.
Definition: plugin.h:57
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:94
SDF_API TfTokenVector GetFields() const
Returns all fields for this spec.
This file defines some macros that are useful for declaring and using static TfTokens.
void _RegisterStandardFields()
Registers the standard fields.
SdfSpecType
An enum that specifies the type of an object.
Definition: types.h:91
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.
Notice sent after new plugins have been registered with the Plug registry.
Definition: notice.h:50
FieldDefinition & FallbackValue(const VtValue &v)
Functions for setting field attributes during registration.
_SpecDefiner _Define(SdfSpecType type)
Registers the given spec type with this schema and return a _SpecDefiner for specifying additional fi...
Definition: schema.h:478
const SpecDefinition * GetSpecDefinition(SdfSpecType specType) const
Returns the spec definition for the given spec type.
Definition: schema.h:227
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.
TfType represents a dynamic runtime type.
Definition: type.h:64
Represents the shape of a value type (or that of an element in an array).
Definition: valueTypeName.h:46
Class that provides information about the various scene description fields.
Definition: schema.h:565
SDF_API std::vector< SdfValueTypeName > GetAllTypes() const
Returns all registered type names.
SDF_API const TfTokenVector & GetRequiredFields(SdfSpecType specType) const
Returns all required fields registered for the given spec type.
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 ...
Enable a concrete base class for use with TfWeakPtr.
Definition: weakBase.h:141
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:166
SDF_API SdfValueTypeName FindType(const TfToken &typeName) const
Return the type name object for the given type name token.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
Construct an SdfSchemaBase but does not populate it with standard fields and types.
Definition: schema.h:457