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

#include <typeRegistry.h>

Public Member Functions

 ExecTypeRegistry (ExecTypeRegistry const &)=delete
 
ExecTypeRegistryoperator= (ExecTypeRegistry const &)=delete
 
 ~ExecTypeRegistry ()
 
template<typename ValueType >
TfType CheckForRegistration () const
 
EXEC_API VdfVector CreateVector (const VtValue &value) const
 Construct a VdfVector whose value is copied from value. More...
 
EXEC_API Exec_ValueExtractor GetExtractor (TfType type) const
 

Static Public Member Functions

static EXEC_API const
ExecTypeRegistry
GetInstance ()
 
template<typename ValueType >
static void RegisterType (const ValueType &fallback)
 

Friends

class TfSingleton< ExecTypeRegistry >
 

Detailed Description

Singleton used to register and access value types used by exec computations.

Value types that are used for exec computation input and output values must be registered with this registry.

The registry is initialized with all value types that Sdf suports for attribute and metadata values.

Definition at line 45 of file typeRegistry.h.

Constructor & Destructor Documentation

ExecTypeRegistry::ExecTypeRegistry ( ExecTypeRegistry const &  )
delete
ExecTypeRegistry::~ExecTypeRegistry ( )

Member Function Documentation

template<typename ValueType >
TfType ExecTypeRegistry::CheckForRegistration ( ) const
inline

Confirms that ValueType has been registered.

If ValueType has been registered with the ExecTypeRegistry, the corresponding TfType is returned.

Warning
If ValueType has not been registerd, a fatal error is emitted.

Definition at line 120 of file typeRegistry.h.

EXEC_API VdfVector ExecTypeRegistry::CreateVector ( const VtValue value) const

Construct a VdfVector whose value is copied from value.

EXEC_API Exec_ValueExtractor ExecTypeRegistry::GetExtractor ( TfType  type) const

Returns an extractor that produces a VtValue from values held in execution.

Note that type is the type that should be held in the VtValue extraction result. This is distinct from the execution data-flow type.

static EXEC_API const ExecTypeRegistry& ExecTypeRegistry::GetInstance ( )
static

Provides access to the singleton instance, first ensuring it is constructed.

ExecTypeRegistry& ExecTypeRegistry::operator= ( ExecTypeRegistry const &  )
delete
template<typename ValueType >
static void ExecTypeRegistry::RegisterType ( const ValueType &  fallback)
inlinestatic

Registers ValueType as a value type that exec computations can use for input and output values, with the fallback value fallback.

In any circumstance that requires a fallback value, i.e., when an arbitrary value of type ValueType must be produced, fallback will be used.

All types that can be used to author attribute and metadata values in USD are known to exec by default. User-defined types must be registered using this function.

Note
Exec value types must be equality comparable.
Warning
If a given ValueType is registered more than once, all calls must specify the same fallback; otherwise, which fallback value wins is indeterminate. If an equality operator is defined for ValueType, that operator will be used to verify that all fallback values have the same value. Otherwise, multiple registrations are allowed, with no verification that the fallback values match.

Example

```cpp struct CustomType { int i; std::string s;

friend bool operator==(const CustomType &a, const CustomType &b) { return a.i == b.i && a.s == b.s; } };

TF_REGISTRY_FUNCTION(ExecTypeRegistry) { ExecTypeRegistry::RegisterType(CustomType{}); } ```

Definition at line 101 of file typeRegistry.h.

Friends And Related Function Documentation

Definition at line 142 of file typeRegistry.h.


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