All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 SDF_SCHEMA_H
25 #define 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"
37 #include "pxr/base/tf/staticTokens.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 
183  SDF_API TfTokenVector GetRequiredFields() const;
184 
186  SDF_API TfTokenVector GetMetadataFields() const;
187 
189  SDF_API bool IsValidField(const TfToken& name) const;
190 
192  SDF_API bool IsMetadataField(const TfToken& name) const;
193 
197  SDF_API
198  TfToken GetMetadataFieldDisplayGroup(const TfToken& name) const;
199 
201  SDF_API bool IsRequiredField(const TfToken& name) const;
202 
203 
204  private:
205  typedef TfHashMap<TfToken, _FieldInfo, TfToken::HashFunctor>
206  _FieldMap;
207  _FieldMap _fields;
208 
209  private:
210  friend class _SpecDefiner;
211  void _AddField(const TfToken& name, const _FieldInfo& fieldInfo);
212  };
213 
216  SDF_API
217  const FieldDefinition* GetFieldDefinition(const TfToken &fieldKey) const;
218 
221  SDF_API
222  const SpecDefinition* GetSpecDefinition(SdfSpecType type) const;
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 
254  SDF_API TfTokenVector GetMetadataFields(SdfSpecType specType) const;
255 
259  SDF_API
261  TfToken const &metadataField) const;
262 
264  SDF_API TfTokenVector GetRequiredFields(SdfSpecType specType) const;
265 
270  inline bool IsRequiredFieldName(const TfToken &fieldName) const {
271  for (size_t i = 0; i != _requiredFieldNames.size(); ++i) {
272  if (_requiredFieldNames[i] == fieldName)
273  return true;
274  }
275  return false;
276  }
277 
279 
284 
286  static SdfAllowed IsValidIdentifier(const std::string& name);
287  static SdfAllowed IsValidNamespacedIdentifier(const std::string& name);
288  static SdfAllowed IsValidInheritPath(const SdfPath& path);
289  static SdfAllowed IsValidPayload(const SdfPayload& payload);
290  static SdfAllowed IsValidReference(const SdfReference& ref);
291  static SdfAllowed IsValidRelationshipTargetPath(const SdfPath& path);
292  static SdfAllowed IsValidRelocatesPath(const SdfPath& path);
293  static SdfAllowed IsValidSpecializesPath(const SdfPath& path);
294  static SdfAllowed IsValidSubLayer(const std::string& sublayer);
295  static SdfAllowed IsValidVariantIdentifier(const std::string& name);
296 
298 
301 
307  SDF_API
308  SdfAllowed IsValidValue(const VtValue& value) const;
309 
311  std::vector<SdfValueTypeName> GetAllTypes() const;
312 
314  SDF_API
315  SdfValueTypeName FindType(const std::string& typeName) const;
316 
318  SDF_API
319  SdfValueTypeName FindType(const TfType& type,
320  const TfToken& role = TfToken()) const;
321 
323  SDF_API
324  SdfValueTypeName FindType(const VtValue& value,
325  const TfToken& role = TfToken()) const;
326 
330  SDF_API
331  SdfValueTypeName FindOrCreateType(const std::string& typeName) const;
332 
334 
335 protected:
340  class _SpecDefiner {
341  public:
344 
346  const TfToken& name, bool required = false);
347  _SpecDefiner& MetadataField(
348  const TfToken& name, bool required = false);
349  _SpecDefiner& MetadataField(
350  const TfToken& name, const TfToken& displayGroup,
351  bool required = false);
352 
353  _SpecDefiner &CopyFrom(const SpecDefinition &other);
354 
356  private:
357  friend class SdfSchemaBase;
358  explicit _SpecDefiner(SdfSchemaBase *schema, SpecDefinition *definition)
359  : _schema(schema)
360  , _definition(definition)
361  {}
362  SdfSchemaBase *_schema;
363  SpecDefinition *_definition;
364  };
365 
368  public:
369  explicit _ValueTypeRegistrar(Sdf_ValueTypeRegistry*);
370 
371  class Type
372  {
373  public:
374  ~Type();
375 
376  // Specify a type with the given name, default value, and default
377  // array value of VtArray<T>.
378  template <class T>
379  Type(const std::string& name, const T& defaultValue)
380  : Type(name, VtValue(defaultValue), VtValue(VtArray<T>()))
381  { }
382 
383  // Specify a type with the given name and underlying C++ type.
384  // No default value or array value will be registered.
385  Type(const std::string& name, const TfType& type);
386 
387  // Set C++ type name string for this type. Defaults to type name
388  // from TfType.
389  Type& CPPTypeName(const std::string& cppTypeName);
390 
391  // Set shape for this type. Defaults to shapeless.
392  Type& Dimensions(const SdfTupleDimensions& dims);
393 
394  // Set default unit for this type. Defaults to dimensionless unit.
395  Type& DefaultUnit(TfEnum unit);
396 
397  // Set role for this type. Defaults to no role.
398  Type& Role(const TfToken& role);
399 
400  // Indicate that arrays of this type are not supported.
401  Type& NoArrays();
402 
403  private:
404  Type(const std::string& name,
405  const VtValue& defaultValue,
406  const VtValue& defaultArrayValue);
407 
408  class _Impl;
409  std::unique_ptr<_Impl> _impl;
410 
411  friend class _ValueTypeRegistrar;
412  };
413 
415  void AddType(const Type& type);
416 
417  private:
418  Sdf_ValueTypeRegistry* _registry;
419  };
420 
421  SdfSchemaBase();
422 
425  class EmptyTag {};
427 
428  virtual ~SdfSchemaBase();
429 
437  template <class T>
439  const TfToken &fieldKey, const T &fallback, bool plugin = false)
440  {
441  return _CreateField(fieldKey, VtValue(fallback), plugin);
442  }
443 
447  return _SpecDefiner(this, &_specDefinitions[type]);
448  }
449 
452  _SpecDefiner _ExtendSpecDefinition(SdfSpecType specType);
453 
456 
459  void _RegisterPluginFields();
460 
462  void _RegisterStandardTypes();
463 
465  void _RegisterLegacyTypes();
466 
468  _ValueTypeRegistrar _GetTypeRegistrar() const;
469 
473  typedef std::function<VtValue(const std::string&, const JsValue&)>
475 
478  const std::vector<const SdfSchemaBase::FieldDefinition *>
479  _UpdateMetadataFromPlugins(const PlugPluginPtrVector& plugins,
480  const std::string& metadataTag =
481  std::string(),
482  const _DefaultValueFactoryFn& defFactory =
484 
485 private:
486  friend class _SpecDefiner;
487 
488  void _OnDidRegisterPlugins(const PlugNotice::DidRegisterPlugins& n);
489 
490  // Return a _SpecDefiner for an existing spec definition, \p local.
492  return _SpecDefiner(this, local);
493  }
494 
495  void _AddRequiredFieldName(const TfToken &name);
496 
497  const SpecDefinition* _CheckAndGetSpecDefinition(SdfSpecType type) const;
498 
499  friend struct Sdf_SchemaFieldTypeRegistrar;
500  FieldDefinition& _CreateField(
501  const TfToken &fieldKey, const VtValue &fallback, bool plugin = false);
502 
503  template <class T>
504  FieldDefinition& _DoRegisterField(const TfToken &fieldKey, const T &fallback)
505  {
506  return _DoRegisterField(fieldKey, VtValue(fallback));
507  }
508 
509  FieldDefinition& _DoRegisterField(
510  const TfToken &fieldKey, const VtValue &fallback);
511 
512 private:
513  typedef TfHashMap<TfToken, SdfSchemaBase::FieldDefinition,
515  _FieldDefinitionMap;
516  _FieldDefinitionMap _fieldDefinitions;
517 
518  typedef TfHashMap<SdfSpecType, SdfSchemaBase::SpecDefinition,
519  TfHash>
520  _SpecDefinitionMap;
521  _SpecDefinitionMap _specDefinitions;
522 
523  std::unique_ptr<Sdf_ValueTypeRegistry> _valueTypeRegistry;
524  TfTokenVector _requiredFieldNames;
525 };
526 
532 class SdfSchema : public SdfSchemaBase {
533 public:
534  SDF_API
535  static const SdfSchema& GetInstance()
536  {
538  }
539 
540 private:
541  friend class TfSingleton<SdfSchema>;
542  SdfSchema();
543  virtual ~SdfSchema();
544 };
545 
546 SDF_API_TEMPLATE_CLASS(TfSingleton<SdfSchema>);
547 
551 #define SDF_FIELD_KEYS \
552  ((Active, "active")) \
553  ((AllowedTokens, "allowedTokens")) \
554  ((AssetInfo, "assetInfo")) \
555  ((ColorConfiguration, "colorConfiguration")) \
556  ((ColorManagementSystem, "colorManagementSystem")) \
557  ((ColorSpace, "colorSpace")) \
558  ((Comment, "comment")) \
559  ((ConnectionPaths, "connectionPaths")) \
560  ((Custom, "custom")) \
561  ((CustomData, "customData")) \
562  ((CustomLayerData, "customLayerData")) \
563  ((Default, "default")) \
564  ((DefaultPrim, "defaultPrim")) \
565  ((DisplayGroup, "displayGroup")) \
566  ((DisplayName, "displayName")) \
567  ((DisplayUnit, "displayUnit")) \
568  ((Documentation, "documentation")) \
569  ((EndTimeCode, "endTimeCode")) \
570  ((FramePrecision, "framePrecision")) \
571  ((FramesPerSecond, "framesPerSecond")) \
572  ((Hidden, "hidden")) \
573  ((HasOwnedSubLayers, "hasOwnedSubLayers")) \
574  ((InheritPaths, "inheritPaths")) \
575  ((Instanceable, "instanceable")) \
576  ((Kind, "kind")) \
577  ((PrimOrder, "primOrder")) \
578  ((NoLoadHint, "noLoadHint")) \
579  ((Owner, "owner")) \
580  ((Payload, "payload")) \
581  ((Permission, "permission")) \
582  ((Prefix, "prefix")) \
583  ((PrefixSubstitutions, "prefixSubstitutions")) \
584  ((PropertyOrder, "propertyOrder")) \
585  ((References, "references")) \
586  ((Relocates, "relocates")) \
587  ((SessionOwner, "sessionOwner")) \
588  ((Specializes, "specializes")) \
589  ((Specifier, "specifier")) \
590  ((StartTimeCode, "startTimeCode")) \
591  ((SubLayers, "subLayers")) \
592  ((SubLayerOffsets, "subLayerOffsets")) \
593  ((Suffix, "suffix")) \
594  ((SuffixSubstitutions, "suffixSubstitutions")) \
595  ((SymmetricPeer, "symmetricPeer")) \
596  ((SymmetryArgs, "symmetryArgs")) \
597  ((SymmetryArguments, "symmetryArguments")) \
598  ((SymmetryFunction, "symmetryFunction")) \
599  ((TargetPaths, "targetPaths")) \
600  ((TimeSamples, "timeSamples")) \
601  ((TimeCodesPerSecond, "timeCodesPerSecond")) \
602  ((TypeName, "typeName")) \
603  ((VariantSelection, "variantSelection")) \
604  ((Variability, "variability")) \
605  ((VariantSetNames, "variantSetNames")) \
606  \
607  /* XXX: These fields should move into Sd. See bug 123508. */ \
608  ((EndFrame, "endFrame")) \
609  ((StartFrame, "startFrame"))
610 
611 #define SDF_CHILDREN_KEYS \
612  ((ConnectionChildren, "connectionChildren")) \
613  ((ExpressionChildren, "expressionChildren")) \
614  ((MapperArgChildren, "mapperArgChildren")) \
615  ((MapperChildren, "mapperChildren")) \
616  ((PrimChildren, "primChildren")) \
617  ((PropertyChildren, "properties")) \
618  ((RelationshipTargetChildren, "targetChildren")) \
619  ((VariantChildren, "variantChildren")) \
620  ((VariantSetChildren, "variantSetChildren"))
621 
622 TF_DECLARE_PUBLIC_TOKENS(SdfFieldKeys, SDF_API, SDF_FIELD_KEYS);
623 TF_DECLARE_PUBLIC_TOKENS(SdfChildrenKeys, SDF_API, SDF_CHILDREN_KEYS);
624 
625 PXR_NAMESPACE_CLOSE_SCOPE
626 
627 #endif // SDF_SCHEMA_H
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:474
Manage a single instance of an object (see.
Definition: singleton.h:122
SDF_API bool IsValidField(const TfToken &name) const
Returns whether the given field is valid for this spec.
#define TF_DECLARE_WEAK_PTRS(type)
Define standard weak pointer types.
Definition: declarePtrs.h:62
SDF_API TfTokenVector GetRequiredFields(SdfSpecType specType) const
Returns all required fields registered for the given spec type.
SDF_API TfTokenVector GetRequiredFields() const
Returns all value fields marked as required for this spec.
void _RegisterLegacyTypes()
Registers legacy attribute value types.
Generic class that provides information about scene description fields but doesn&#39;t actually provide a...
Definition: schema.h:62
SDF_API bool IsRequiredField(const TfToken &name) const
Returns whether the given field is required for this spec.
SDF_API VtValue CastToTypeOf(const TfToken &fieldKey, const VtValue &value) const
Coerce value to the correct type for the specified field.
Class that defines fields for a spec type.
Definition: schema.h:340
SDF_API TfTokenVector GetMetadataFields(SdfSpecType specType) const
Returns all metadata fields registered for the given spec type.
An enum class that records both enum type and enum value.
Definition: enum.h:140
Functor to use for hash maps from tokens to other things.
Definition: token.h:168
_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:83
SdfSpecType
An enum that specifies the type of an object.
Definition: types.h:91
SDF_API bool IsValidFieldForSpec(const TfToken &fieldKey, SdfSpecType specType) const
Return whether the given field is valid for the given spec type.
SDF_API SdfAllowed IsValidValue(const VtValue &value) const
Scene description value types.
Provides hash function on STL string types and other types.
Definition: hash.h:86
SDF_API bool HoldsChildren(const TfToken &fieldKey) const
Returns whether the given field is a &#39;children&#39; field – that is, it indexes certain children beneath ...
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:89
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:438
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...
std::vector< SdfValueTypeName > GetAllTypes() const
Returns all registered type names.
Class defining various attributes for a field.
Definition: schema.h:72
_ValueTypeRegistrar _GetTypeRegistrar() const
Returns a type registrar.
SDF_API bool IsRegistered(const TfToken &fieldKey, VtValue *fallback=NULL) const
Convenience functions for accessing specific field information.
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
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
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
_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
SDF_API const FieldDefinition * GetFieldDefinition(const TfToken &fieldKey) const
Returns the field definition for the given field.
SDF_API SdfValueTypeName FindType(const std::string &typeName) const
Return the type name object for the given type name string.
Represents a payload and all its meta data.
Definition: payload.h:59
SDF_API SdfValueTypeName FindOrCreateType(const std::string &typeName) const
Return the type name object for the given type name string if it exists otherwise create a temporary ...
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:438
Class representing fields and other information for a spec type.
Definition: schema.h:177
SDF_API const SpecDefinition * GetSpecDefinition(SdfSpecType type) const
Returns the spec definition for the given spec type.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:287
static T & GetInstance()
Return a reference to an object of type T, creating it if necessary.
Definition: singleton.h:137
void AddType(const Type &type)
Register a value type and its corresponding array value type.
SDF_API TfTokenVector GetFields() const
Returns all fields for this spec.
A helper for registering value types.
Definition: schema.h:367
void _RegisterStandardTypes()
Registers standard attribute value types.
SDF_API TfToken GetMetadataFieldDisplayGroup(SdfSpecType specType, TfToken const &metadataField) const
Return the metadata field display group for metadata metadataField on specType.
static SdfAllowed IsValidAttributeConnectionPath(const SdfPath &path)
Specific validation functions for various fields.
Represents a reference and all its meta data.
Definition: reference.h:75
Defines an interface to registered plugins.
Definition: plugin.h:59
void _RegisterStandardFields()
Registers the standard fields.
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:446
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:70
Represents the shape of a value type (or that of an element in an array).
Definition: valueTypeName.h:46
SDF_API TfTokenVector GetFields(SdfSpecType specType) const
Returns all fields registered for the given spec type.
SDF_API TfTokenVector GetMetadataFields() const
Returns all value fields marked as metadata for this spec.
Class that provides information about the various scene description fields.
Definition: schema.h:532
SDF_API TfToken GetMetadataFieldDisplayGroup(const TfToken &name) const
Returns the display group for this metadata field.
Enable a concrete base class for use with TfWeakPtr.
Definition: weakBase.h:142
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:182
SDF_API bool IsMetadataField(const TfToken &name) const
Returns whether the given field is metadata for this spec.
Construct an SdfSchemaBase but does not populate it with standard fields and types.
Definition: schema.h:425