Loading...
Searching...
No Matches
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)
 A TypedDataFactory is a function which initializes an Ts_PolymorphicDataHolder instance for a given VtValue.
 
typedef TfHashMap< TfType, TypedDataFactory, TfHashDataFactoryMap
 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 TsTypeRegistryGetInstance ()
 Return the single instance of TsTypeRegistry.
 

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

◆ DataFactoryMap

Map from TfTypes to TypedDataFactories.

Definition at line 66 of file typeRegistry.h.

◆ TypedDataFactory

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.

Member Function Documentation

◆ GetInstance()

static TS_API TsTypeRegistry & GetInstance ( )
inlinestatic

Return the single instance of TsTypeRegistry.

Definition at line 55 of file typeRegistry.h.

◆ InitializeDataHolder()

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.

◆ IsSupportedType()

TS_API bool IsSupportedType ( const TfType type) const

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

◆ RegisterTypedDataFactory()

void RegisterTypedDataFactory ( TypedDataFactory  factory)
inline

Registers a TypedDataFactory for a particular type.

Definition at line 70 of file typeRegistry.h.

Friends And Related Function Documentation

◆ TfSingleton< TsTypeRegistry >

friend class TfSingleton< TsTypeRegistry >
friend

Definition at line 89 of file typeRegistry.h.


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