25 #ifndef PXR_BASE_TS_TYPE_REGISTRY_H
26 #define PXR_BASE_TS_TYPE_REGISTRY_H
71 _dataFactoryMap[TfType::Find<T>()] = factory;
96 #define TS_REGISTER_TYPE(TYPE) \
97 TF_REGISTRY_FUNCTION(TsTypeRegistry) { \
98 TsTypeRegistry ® = TsTypeRegistry::GetInstance(); \
99 reg.RegisterTypedDataFactory<TYPE>( \
100 [](Ts_PolymorphicDataHolder *holder, const VtValue &value) { \
101 holder->New(value.Get<TYPE>()); \
TS_API void InitializeDataHolder(Ts_PolymorphicDataHolder *holder, const VtValue &value)
GLsizei const GLfloat * value
TS_API bool IsSupportedType(const TfType &type) const
Type registry which provides a mapping from dynamically typed objects to statically typed internal on...
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
TfHashMap< TfType, TypedDataFactory, TfHash > DataFactoryMap
Map from TfTypes to TypedDataFactories.
static TS_API TsTypeRegistry & GetInstance()
Return the single instance of TsTypeRegistry.
#define PXR_NAMESPACE_CLOSE_SCOPE
void(* TypedDataFactory)(Ts_PolymorphicDataHolder *holder, const VtValue &value)
void RegisterTypedDataFactory(TypedDataFactory factory)
Registers a TypedDataFactory for a particular type.