HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TsTypeRegistry Class Reference

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 TsTypeRegistryGetInstance ()
 Return the single instance of TsTypeRegistry. More...
 

Friends

class TfSingleton< TsTypeRegistry >
 

Detailed Description

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.

Member Typedef Documentation

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.

Member Function Documentation

static TS_API TsTypeRegistry& TsTypeRegistry::GetInstance ( )
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.

TS_API bool TsTypeRegistry::IsSupportedType ( const TfType type) const

Returns true if the type of value is a type we can make keyframes for.

template<class T >
void TsTypeRegistry::RegisterTypedDataFactory ( TypedDataFactory  factory)
inline

Registers a TypedDataFactory for a particular type.

Definition at line 70 of file typeRegistry.h.

Friends And Related Function Documentation

friend class TfSingleton< TsTypeRegistry >
friend

Definition at line 91 of file typeRegistry.h.


The documentation for this class was generated from the following file: