24 #ifndef PXR_USD_SDF_DECLARE_SPEC_H
25 #define PXR_USD_SDF_DECLARE_SPEC_H
57 #define SDF_DECLARE_ABSTRACT_SPEC(SpecType, BaseSpecType) \
60 SpecType(const SpecType& spec) \
61 : BaseSpecType(spec) { } \
62 explicit SpecType(const Sdf_IdentityRefPtr& identity) \
63 : BaseSpecType(identity) { } \
65 friend struct Sdf_CastAccess; \
66 explicit SpecType(const SdfSpec& spec) \
67 : BaseSpecType(spec) { } \
69 #define SDF_DEFINE_ABSTRACT_SPEC(SchemaType, SpecType, BaseSpecType) \
70 TF_REGISTRY_FUNCTION_WITH_TAG(TfType, Type) \
72 TfType::Define<SpecType, TfType::Bases<BaseSpecType> >(); \
74 TF_REGISTRY_FUNCTION_WITH_TAG(SdfSpecTypeRegistration, Registration) \
76 SdfSpecTypeRegistration::RegisterAbstractSpecType< \
77 SchemaType, SpecType>(); \
82 #define SDF_DECLARE_SPEC(SpecType, BaseSpecType) \
83 SDF_DECLARE_ABSTRACT_SPEC(SpecType, BaseSpecType) \
85 #define SDF_DEFINE_SPEC(SchemaType, SpecTypeEnum, SpecType, BaseSpecType) \
86 TF_REGISTRY_FUNCTION_WITH_TAG(TfType, Type) \
88 TfType::Define<SpecType, TfType::Bases<BaseSpecType> >(); \
90 TF_REGISTRY_FUNCTION_WITH_TAG(SdfSpecTypeRegistration, Registration) \
92 SdfSpecTypeRegistration::RegisterSpecType<SchemaType, SpecType> \
99 #define SDF_DECLARE_BASE_SPEC(SpecType) \
102 SpecType(const SpecType& spec) : _id(spec._id) { } \
103 explicit SpecType(const Sdf_IdentityRefPtr& id) : _id(id) { } \
105 #define SDF_DEFINE_BASE_SPEC(SchemaType, SpecType) \
106 TF_REGISTRY_FUNCTION_WITH_TAG(TfType, Type) \
108 TfType::Define<SpecType>(); \
110 TF_REGISTRY_FUNCTION_WITH_TAG(SdfSpecTypeRegistration, Registration) \
112 SdfSpecTypeRegistration::RegisterAbstractSpecType< \
113 SchemaType, SpecType>(); \
118 #endif // PXR_USD_SDF_DECLARE_SPEC_H
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE