7 #ifndef PXR_USD_USD_SCHEMA_REGISTRY_H
8 #define PXR_USD_USD_SCHEMA_REGISTRY_H
20 #include <unordered_map>
58 std::unordered_map<TfToken, TfTokenVector, TfHash>;
128 static std::pair<TfToken, UsdSchemaVersion>
159 static const SchemaInfo *
170 template <
class SchemaType>
171 static const SchemaInfo *
174 "Provided type must derive UsdSchemaBase.");
182 static const SchemaInfo *
189 static const SchemaInfo *
205 static const std::vector<const SchemaInfo *> &
213 static std::vector<const SchemaInfo *>
226 template <
class SchemaType>
448 const std::string &namespacePrefix,
449 const std::string &baseName);
467 const std::string &nameTemplate,
468 const std::string &instanceName);
481 const std::string &nameTemplate);
493 const std::string &nameTemplate);
499 const TfToken &typeName)
const {
500 const auto it = _concreteTypedPrimDefinitions.find(typeName);
501 return it != _concreteTypedPrimDefinitions.end() ?
502 it->second.get() :
nullptr;
509 const TfToken &typeName)
const {
510 const auto it = _appliedAPIPrimDefinitions.find(typeName);
511 return it != _appliedAPIPrimDefinitions.end() ?
512 it->second.primDef.get() :
nullptr;
517 return _emptyPrimDefinition;
525 std::unique_ptr<UsdPrimDefinition>
541 return _fallbackPrimTypes;
549 using _FamilyAndInstanceToVersionMap =
552 void _ComposeAPISchemasIntoPrimDefinition(
555 _FamilyAndInstanceToVersionMap *seenSchemaFamilyVersions)
const;
560 class _SchemaDefInitHelper;
562 std::vector<SdfLayerRefPtr> _schematicsLayers;
564 std::unordered_map<TfToken, const std::unique_ptr<UsdPrimDefinition>,
565 TfHash> _concreteTypedPrimDefinitions;
567 struct _APISchemaDefinitionInfo {
568 std::unique_ptr<UsdPrimDefinition> primDef;
569 bool applyExpectsInstanceName;
571 std::unordered_map<TfToken, const _APISchemaDefinitionInfo, TfHash>
572 _appliedAPIPrimDefinitions;
588 const TfType &apiSchemaType,
602 #endif //PXR_USD_USD_SCHEMA_REGISTRY_H
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
const UsdPrimDefinition * FindAppliedAPIPrimDefinition(const TfToken &typeName) const
static USD_API TfType GetConcreteTypeFromSchemaTypeName(const TfToken &typeName)
static USD_API TfToken GetMultipleApplyNameTemplateBaseName(const std::string &nameTemplate)
GLsizei const GLfloat * value
const VtDictionary & GetFallbackPrimTypes() const
static USD_API bool IsAllowedSchemaIdentifier(const TfToken &schemaIdentifier)
const UsdPrimDefinition * GetEmptyPrimDefinition() const
Returns the empty prim definition.
static USD_API TfType GetTypeFromName(const TfToken &typeName)
static USD_API bool IsConcrete(const TfType &primType)
static USD_API UsdSchemaKind GetSchemaKind(const TfType &schemaType)
static USD_API std::pair< TfToken, UsdSchemaVersion > ParseSchemaFamilyAndVersionFromIdentifier(const TfToken &schemaIdentifier)
static const SchemaInfo * FindSchemaInfo()
static USD_API bool IsAllowedAPISchemaInstanceName(const TfToken &apiSchemaName, const TfToken &instanceName)
static USD_API bool IsAbstract(const TfType &primType)
static USD_API const TokenToTokenVectorMap & GetAutoApplyAPISchemas()
void Usd_SortAutoAppliedAPISchemas(TfTokenVector *autoAppliedAPISchemas)
unsigned int UsdSchemaVersion
Schema versions are specified as a single unsigned integer value.
static USD_API bool IsAllowedSchemaFamily(const TfToken &schemaFamily)
static USD_API TfToken MakeSchemaIdentifierForFamilyAndVersion(const TfToken &schemaFamily, UsdSchemaVersion schemaVersion)
static TfToken GetSchemaTypeName()
static USD_API bool IsTyped(const TfType &primType)
Returns true if the prim type primType inherits from UsdTyped.
static USD_API TfToken MakeMultipleApplyNameTemplate(const std::string &namespacePrefix, const std::string &baseName)
static USD_API bool IsMultipleApplyNameTemplate(const std::string &nameTemplate)
static USD_API const std::vector< const SchemaInfo * > & FindSchemaInfosInFamily(const TfToken &schemaFamily)
std::vector< TfToken > TfTokenVector
Convenience types.
static USD_API const TfTokenVector & GetAPISchemaCanOnlyApplyToTypeNames(const TfToken &apiSchemaName, const TfToken &instanceName=TfToken())
UsdSchemaKind kind
The schema's kind: ConcreteTyped, SingleApplyAPI, etc.
static USD_API void CollectAddtionalAutoApplyAPISchemasFromPlugins(TokenToTokenVectorMap *autoApplyAPISchemas)
static USD_API TfToken GetConcreteSchemaTypeName(const TfType &schemaType)
std::unordered_map< TfToken, TfTokenVector, TfHash > TokenToTokenVectorMap
static USD_API bool IsDisallowedField(const TfToken &fieldName)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
static USD_API UsdSchemaRegistry & GetInstance()
static USD_API TfToken GetAPISchemaTypeName(const TfType &schemaType)
static USD_API TfType GetAPITypeFromSchemaTypeName(const TfToken &typeName)
static USD_API bool IsMultipleApplyAPISchema(const TfType &apiSchemaType)
Returns true if apiSchemaType is a multiple-apply API schema type.
#define PXR_NAMESPACE_CLOSE_SCOPE
static USD_API std::pair< TfToken, TfToken > GetTypeNameAndInstance(const TfToken &apiSchemaName)
void Usd_GetAPISchemaPluginApplyToInfoForType(const TfType &apiSchemaType, const TfToken &apiSchemaName, UsdSchemaRegistry::TokenToTokenVectorMap *autoApplyAPISchemasMap, UsdSchemaRegistry::TokenToTokenVectorMap *canOnlyApplyAPISchemasMap, TfHashMap< TfToken, TfToken::Set, TfHash > *allowedInstanceNamesMap)
USD_API std::unique_ptr< UsdPrimDefinition > BuildComposedPrimDefinition(const TfToken &primType, const TfTokenVector &appliedAPISchemas) const
static USD_API bool IsAppliedAPISchema(const TfType &apiSchemaType)
Returns true if apiSchemaType is an applied API schema type.
USD_API_TEMPLATE_CLASS(TfSingleton< UsdSchemaRegistry >)
UsdSchemaVersion version
The version number of the schema within its schema family.
static USD_API TfType GetTypeFromSchemaTypeName(const TfToken &typeName)
PXR_NAMESPACE_OPEN_SCOPE SDF_DECLARE_HANDLES(SdfAttributeSpec)
const UsdPrimDefinition * FindConcretePrimDefinition(const TfToken &typeName) const
static USD_API TfToken MakeMultipleApplyNameInstance(const std::string &nameTemplate, const std::string &instanceName)