|
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) |
A TypedDataFactory is a function which initializes an Ts_PolymorphicDataHolder instance for a given VtValue. | |
typedef TfHashMap< TfType, TypedDataFactory, TfHash > | DataFactoryMap |
Map from TfTypes to TypedDataFactories. | |
Public Member Functions | |
template<class T > | |
void | RegisterTypedDataFactory (TypedDataFactory factory) |
Registers a TypedDataFactory for a particular type. | |
TS_API void | 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. | |
TS_API bool | IsSupportedType (const TfType &type) const |
Returns true if the type of value is a type we can make keyframes for. | |
Static Public Member Functions | |
static TS_API TsTypeRegistry & | GetInstance () |
Return the single instance of TsTypeRegistry. | |
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:
TS_REGISTER_TYPE(double);
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.
typedef TfHashMap<TfType,TypedDataFactory,TfHash> DataFactoryMap |
Map from TfTypes to TypedDataFactories.
Definition at line 66 of file typeRegistry.h.
typedef void(* 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 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.
TS_API bool IsSupportedType | ( | const TfType & | type | ) | const |
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 89 of file typeRegistry.h.