24 #ifndef PXR_USD_USD_SCHEMA_REGISTRY_H
25 #define PXR_USD_USD_SCHEMA_REGISTRY_H
37 #include <unordered_map>
75 std::unordered_map<TfToken, TfTokenVector, TfHash>;
145 static std::pair<TfToken, UsdSchemaVersion>
176 static const SchemaInfo *
187 template <
class SchemaType>
188 static const SchemaInfo *
191 "Provided type must derive UsdSchemaBase.");
199 static const SchemaInfo *
206 static const SchemaInfo *
222 static const std::vector<const SchemaInfo *> &
230 static std::vector<const SchemaInfo *>
243 template <
class SchemaType>
516 const TfToken &typeName)
const {
517 const auto it = _concreteTypedPrimDefinitions.find(typeName);
518 return it != _concreteTypedPrimDefinitions.end() ?
519 it->second.get() :
nullptr;
526 const TfToken &typeName)
const {
527 const auto it = _appliedAPIPrimDefinitions.find(typeName);
528 return it != _appliedAPIPrimDefinitions.end() ?
529 it->second.primDef.get() :
nullptr;
534 return _emptyPrimDefinition;
542 std::unique_ptr<UsdPrimDefinition>
558 return _fallbackPrimTypes;
566 using _FamilyAndInstanceToVersionMap =
569 void _ComposeAPISchemasIntoPrimDefinition(
572 _FamilyAndInstanceToVersionMap *seenSchemaFamilyVersions)
const;
577 class _SchemaDefInitHelper;
579 std::vector<SdfLayerRefPtr> _schematicsLayers;
581 std::unordered_map<TfToken, const std::unique_ptr<UsdPrimDefinition>,
582 TfHash> _concreteTypedPrimDefinitions;
584 struct _APISchemaDefinitionInfo {
585 std::unique_ptr<UsdPrimDefinition> primDef;
586 bool applyExpectsInstanceName;
588 std::unordered_map<TfToken, const _APISchemaDefinitionInfo, TfHash>
589 _appliedAPIPrimDefinitions;
605 const TfType &apiSchemaType,
619 #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 GLchar *const * string
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)