Loading...
Searching...
No Matches
declareSpec.h
1
//
2
// Copyright 2016 Pixar
3
//
4
// Licensed under the terms set forth in the LICENSE.txt file available at
5
// https://openusd.org/license.
6
//
7
#ifndef PXR_USD_SDF_DECLARE_SPEC_H
8
#define PXR_USD_SDF_DECLARE_SPEC_H
9
10
#include "
pxr/pxr.h
"
11
#include "pxr/usd/sdf/api.h"
12
#include "
pxr/usd/sdf/declareHandles.h
"
13
#include "
pxr/usd/sdf/specType.h
"
14
#include "
pxr/base/tf/registryManager.h
"
15
#include "pxr/base/tf/type.h"
16
17
PXR_NAMESPACE_OPEN_SCOPE
18
19
class
SdfSpec
;
20
40
#define SDF_DECLARE_ABSTRACT_SPEC(SpecType, BaseSpecType) \
41
public: \
42
SpecType() { } \
43
SpecType(const SpecType& spec) \
44
: BaseSpecType(spec) { } \
45
explicit SpecType(const Sdf_IdentityRefPtr& identity) \
46
: BaseSpecType(identity) { } \
47
protected: \
48
friend struct Sdf_CastAccess; \
49
explicit SpecType(const SdfSpec& spec) \
50
: BaseSpecType(spec) { } \
51
52
#define SDF_DEFINE_ABSTRACT_SPEC(SchemaType, SpecType, BaseSpecType) \
53
TF_REGISTRY_FUNCTION_WITH_TAG(TfType, Type) \
54
{ \
55
TfType::Define<SpecType, TfType::Bases<BaseSpecType> >(); \
56
} \
57
TF_REGISTRY_FUNCTION_WITH_TAG(SdfSpecTypeRegistration, Registration) \
58
{ \
59
SdfSpecTypeRegistration::RegisterAbstractSpecType< \
60
SchemaType, SpecType>(); \
61
}
62
63
// ------------------------------------------------------------
64
65
#define SDF_DECLARE_SPEC(SpecType, BaseSpecType) \
66
SDF_DECLARE_ABSTRACT_SPEC(SpecType, BaseSpecType) \
67
68
#define SDF_DEFINE_SPEC(SchemaType, SpecTypeEnum, SpecType, BaseSpecType) \
69
TF_REGISTRY_FUNCTION_WITH_TAG(TfType, Type) \
70
{ \
71
TfType::Define<SpecType, TfType::Bases<BaseSpecType> >(); \
72
} \
73
TF_REGISTRY_FUNCTION_WITH_TAG(SdfSpecTypeRegistration, Registration) \
74
{ \
75
SdfSpecTypeRegistration::RegisterSpecType<SchemaType, SpecType> \
76
(SpecTypeEnum); \
77
}
78
79
// ------------------------------------------------------------
80
// Special set of macros for SdfSpec only.
81
82
#define SDF_DECLARE_BASE_SPEC(SpecType) \
83
public: \
84
SpecType() { } \
85
SpecType(const SpecType& spec) : _id(spec._id) { } \
86
explicit SpecType(const Sdf_IdentityRefPtr& id) : _id(id) { } \
87
88
89
PXR_NAMESPACE_CLOSE_SCOPE
90
91
#endif
// PXR_USD_SDF_DECLARE_SPEC_H
SdfSpec
Base class for all Sdf spec classes.
Definition:
spec.h:33
declareHandles.h
pxr.h
registryManager.h
specType.h
pxr
usd
sdf
declareSpec.h
© Copyright 2025, Pixar Animation Studios. |
Terms of Use
| Generated on Tue Nov 18 2025 10:36:09 by
1.9.6