HDK
|
Type registry which provides a mapping from dynamically typed objects to statically typed internal ones. More...
#include <typeRegistry.h>
Public Types | |
typedef void(* | TypedDataFactory )(Ts_PolymorphicDataHolder *holder, const VtValue &value) |
typedef TfHashMap< TfType, TypedDataFactory, TfHash > | DataFactoryMap |
Map from TfTypes to TypedDataFactories. More... | |
Public Member Functions | |
template<class T > | |
void | RegisterTypedDataFactory (TypedDataFactory factory) |
Registers a TypedDataFactory for a particular type. More... | |
TS_API void | InitializeDataHolder (Ts_PolymorphicDataHolder *holder, const VtValue &value) |
TS_API bool | IsSupportedType (const TfType &type) const |
Static Public Member Functions | |
static TS_API TsTypeRegistry & | GetInstance () |
Return the single instance of TsTypeRegistry. More... | |
Friends | |
class | TfSingleton< TsTypeRegistry > |
Type registry which provides a mapping from dynamically typed objects to statically typed internal ones.
A new type may be registered by using the TS_REGISTER_TYPE macro. ie:
The type will also need to have a traits class defined for it. See Types.h for example traits classes.
Definition at line 48 of file typeRegistry.h.
Map from TfTypes to TypedDataFactories.
Definition at line 66 of file typeRegistry.h.
typedef void(* TsTypeRegistry::TypedDataFactory)(Ts_PolymorphicDataHolder *holder, const VtValue &value) |
A TypedDataFactory is a function which initializes an Ts_PolymorphicDataHolder instance for a given VtValue.
Definition at line 61 of file typeRegistry.h.
|
inlinestatic |
Return the single instance of TsTypeRegistry.
Definition at line 55 of file typeRegistry.h.
TS_API void TsTypeRegistry::InitializeDataHolder | ( | Ts_PolymorphicDataHolder * | holder, |
const VtValue & | value | ||
) |
Initialize an Ts_PolymorphicDataHolder so that it holds an Ts_TypedData of the appropriate type with the provided values.
Returns true if the type of value is a type we can make keyframes for.
|
inline |
Registers a TypedDataFactory for a particular type.
Definition at line 70 of file typeRegistry.h.
|
friend |
Definition at line 91 of file typeRegistry.h.