HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
declareSpec.h File Reference
+ Include dependency graph for declareSpec.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SDF_DECLARE_ABSTRACT_SPEC(SpecType, BaseSpecType)
 
#define SDF_DEFINE_ABSTRACT_SPEC(SchemaType, SpecType, BaseSpecType)
 
#define SDF_DECLARE_SPEC(SpecType, BaseSpecType)   SDF_DECLARE_ABSTRACT_SPEC(SpecType, BaseSpecType) \
 
#define SDF_DEFINE_SPEC(SchemaType, SpecTypeEnum, SpecType, BaseSpecType)
 
#define SDF_DECLARE_BASE_SPEC(SpecType)
 
#define SDF_DEFINE_BASE_SPEC(SchemaType, SpecType)
 

Macro Definition Documentation

#define SDF_DECLARE_ABSTRACT_SPEC (   SpecType,
  BaseSpecType 
)
Value:
public: \
SpecType() { } \
SpecType(const SpecType& spec) \
: BaseSpecType(spec) { } \
explicit SpecType(const Sdf_IdentityRefPtr& identity) \
: BaseSpecType(identity) { } \
protected: \
friend struct Sdf_CastAccess; \
explicit SpecType(const SdfSpec& spec) \
: BaseSpecType(spec) { } \
Definition: spec.h:49
hboost::intrusive_ptr< Sdf_Identity > Sdf_IdentityRefPtr

Helper macros for implementing C++ spec classes corresponding to the various scene description spec types defined by Sdf. There are two macros that each C++ spec class must invoke, one in the class definition and one in the implementation .cpp file. For example:

<in MySpecType.h> class MySpecType : public MyBaseSpecType { SDF_DECLARE_SPEC(MySpecType, MyBaseSpecType); ... };

<in MySpecType.cpp> SDF_DEFINE_SPEC(MySchemaType, <SdfSpecType enum="" value>="">, MySpecType, MyBaseSpecType);

There are two sets of these macros, one for concrete spec types and one for 'abstract' spec types that only serve as a base class for concrete specs.

Definition at line 57 of file declareSpec.h.

#define SDF_DECLARE_BASE_SPEC (   SpecType)
Value:
public: \
SpecType() { } \
SpecType(const SpecType& spec) : _id(spec._id) { } \
explicit SpecType(const Sdf_IdentityRefPtr& id) : _id(id) { } \
hboost::intrusive_ptr< Sdf_Identity > Sdf_IdentityRefPtr

Definition at line 99 of file declareSpec.h.

#define SDF_DECLARE_SPEC (   SpecType,
  BaseSpecType 
)    SDF_DECLARE_ABSTRACT_SPEC(SpecType, BaseSpecType) \

Definition at line 82 of file declareSpec.h.

#define SDF_DEFINE_ABSTRACT_SPEC (   SchemaType,
  SpecType,
  BaseSpecType 
)
Value:
{ \
TfType::Define<SpecType, TfType::Bases<BaseSpecType> >(); \
} \
{ \
SchemaType, SpecType>(); \
}
#define TF_REGISTRY_FUNCTION_WITH_TAG(KEY_TYPE, TAG)
static void RegisterAbstractSpecType()
Registers the C++ type T as an abstract spec class.
Definition: specType.h:68
Definition: type.h:64

Definition at line 69 of file declareSpec.h.

#define SDF_DEFINE_BASE_SPEC (   SchemaType,
  SpecType 
)
Value:
{ \
TfType::Define<SpecType>(); \
} \
{ \
SchemaType, SpecType>(); \
}
#define TF_REGISTRY_FUNCTION_WITH_TAG(KEY_TYPE, TAG)
static void RegisterAbstractSpecType()
Registers the C++ type T as an abstract spec class.
Definition: specType.h:68
Definition: type.h:64

Definition at line 105 of file declareSpec.h.

#define SDF_DEFINE_SPEC (   SchemaType,
  SpecTypeEnum,
  SpecType,
  BaseSpecType 
)
Value:
{ \
TfType::Define<SpecType, TfType::Bases<BaseSpecType> >(); \
} \
{ \
SdfSpecTypeRegistration::RegisterSpecType<SchemaType, SpecType> \
(SpecTypeEnum); \
}
#define TF_REGISTRY_FUNCTION_WITH_TAG(KEY_TYPE, TAG)
Definition: type.h:64

Definition at line 85 of file declareSpec.h.