24#ifndef PXR_USD_USD_PRIM_TYPE_INFO_H
25#define PXR_USD_USD_PRIM_TYPE_INFO_H
28#include "pxr/usd/usd/api.h"
29#include "pxr/usd/usd/primDefinition.h"
35PXR_NAMESPACE_OPEN_SCOPE
58 return _typeId.appliedAPISchemas;
88 _primDefinition.load(std::memory_order_acquire)) {
91 return *_FindOrCreatePrimDefinition();
97 return _typeId == other._typeId;
101 return !(*
this == other);
113 friend class Usd_PrimTypeInfoCache;
135 _TypeId(
const _TypeId &typeId) =
default;
136 _TypeId(_TypeId &&typeId) =
default;
139 explicit _TypeId(
const TfToken &primTypeName_)
140 : primTypeName(primTypeName_) {}
143 bool IsEmpty()
const {
144 return primTypeName.
IsEmpty() &&
146 appliedAPISchemas.empty();
150 template <
class HashState>
151 friend void TfHashAppend(HashState &h,
const _TypeId &
id)
153 h.Append(
id.primTypeName,
id.mappedTypeName,
id.appliedAPISchemas);
156 size_t Hash()
const {
160 bool operator==(
const _TypeId &other)
const {
161 return primTypeName == other.primTypeName &&
162 mappedTypeName == other.mappedTypeName &&
163 appliedAPISchemas == other.appliedAPISchemas;
166 bool operator!=(
const _TypeId &other)
const {
167 return !(*
this == other);
178 const _TypeId &_GetTypeId()
const {
return _typeId; }
190 mutable std::atomic<const UsdPrimDefinition *> _primDefinition;
199 mutable std::unique_ptr<UsdPrimDefinition> _ownedPrimDefinition;
202PXR_NAMESPACE_CLOSE_SCOPE
A user-extensible hashing mechanism for use with runtime hash tables.
Token for efficient comparison, assignment, and hashing of known strings.
bool IsEmpty() const
Returns true iff this token contains the empty string "".
TfType represents a dynamic runtime type.
Class representing the builtin definition of a prim given the schemas registered in the schema regist...
Class that holds the full type information for a prim.
const UsdPrimDefinition & GetPrimDefinition() const
Returns the prim definition associated with this prim type's schema type and applied API schemas.
static USD_API const UsdPrimTypeInfo & GetEmptyPrimType()
Returns the empty prim type info.
const TfType & GetSchemaType() const
Returns the TfType of the actual concrete schema that prims of this type will use to create their pri...
const TfToken & GetTypeName() const
Returns the concrete prim type name.
const TfTokenVector & GetAppliedAPISchemas() const
Returns the list of applied API schemas, directly authored on the prim, that impart additional proper...
const TfToken & GetSchemaTypeName() const
Returns the type name associated with the schema type returned from GetSchemaType.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
std::vector< TfToken > TfTokenVector
Convenience types.