Loading...
Searching...
No Matches
VdfExecutionTypeRegistry Class Reference

Manages low-level value type functionality used within execution. More...

#include <executionTypeRegistry.h>

Public Member Functions

 VdfExecutionTypeRegistry (const VdfExecutionTypeRegistry &)=delete
 
VdfExecutionTypeRegistryoperator= (const VdfExecutionTypeRegistry &)=delete
 
template<typename T >
const T & GetFallback () const
 Returns the registered fallback value for T from the registry.
 

Static Public Member Functions

static VDF_API VdfExecutionTypeRegistryGetInstance ()
 Returns the VdfExecutionTypeRegistry singleton instance.
 
template<typename T >
static TfType Define (const T &fallback)
 Registers T with execution's runtime type dispatch system.
 
template<typename T , typename B >
static TfType Define (const T &fallback)
 Registers T with execution's runtime type dispatch system as a derived type of B.
 
template<typename T >
static TfType CheckForRegistration (const char *const additionalErrorMsg=nullptr)
 Checks if T is defined as an execution value type.
 
static VDF_API TfType CheckForRegistration (const std::type_info &typeInfo, const char *const additionalErrorMsg)
 Checks if ti is defined as an execution value type.
 
static VDF_API VdfVector CreateEmptyVector (TfType type)
 Create an empty VdfVector holding empty data of the given TfType.
 
static VDF_API void FillVector (TfType type, size_t numElements, VdfVector *vector)
 Fills vector with the fallback value registered for the given type.
 

Friends

class TfSingleton< VdfExecutionTypeRegistry >
 

Detailed Description

Manages low-level value type functionality used within execution.

All types used as values in execution must be registered with VdfExecutionTypeRegistry::Define.

All API is thread safe.

Definition at line 37 of file executionTypeRegistry.h.

Member Function Documentation

◆ CheckForRegistration() [1/2]

static TfType CheckForRegistration ( const char *const  additionalErrorMsg = nullptr)
inlinestatic

Checks if T is defined as an execution value type.

Returns the TfType of T. If the check fails, a fatal error will be issued. The intent is to make sure that all required types are registered at the time this method is called.

Use additionalErrorMsg to append a custom message if a fatal error is emitted.

Definition at line 90 of file executionTypeRegistry.h.

◆ CheckForRegistration() [2/2]

static VDF_API TfType CheckForRegistration ( const std::type_info &  typeInfo,
const char *const  additionalErrorMsg 
)
static

Checks if ti is defined as an execution value type.

This method will issue a fatal error if the type isn't registered.

◆ CreateEmptyVector()

static VDF_API VdfVector CreateEmptyVector ( TfType  type)
static

Create an empty VdfVector holding empty data of the given TfType.

Note this creates an empty vector, not a fallback-valued vector. See also VdfTypedVector for creating empty vectors by type.

◆ Define() [1/2]

TfType Define ( const T &  fallback)
static

Registers T with execution's runtime type dispatch system.

fallback is required because execution supports types that are not default constructible as well as types for which a default-constructed value is not the desired fallback value.

This call will also define T with TfType if it is not registered yet.

Definition at line 216 of file executionTypeRegistry.h.

◆ Define() [2/2]

TfType Define ( const T &  fallback)
static

Registers T with execution's runtime type dispatch system as a derived type of B.

Definition at line 235 of file executionTypeRegistry.h.

◆ FillVector()

static VDF_API void FillVector ( TfType  type,
size_t  numElements,
VdfVector vector 
)
static

Fills vector with the fallback value registered for the given type.

◆ GetFallback()

const T & GetFallback
inline

Returns the registered fallback value for T from the registry.

It is a fatal error to query types that are not registered.

Definition at line 276 of file executionTypeRegistry.h.

◆ GetInstance()

static VDF_API VdfExecutionTypeRegistry & GetInstance ( )
static

Returns the VdfExecutionTypeRegistry singleton instance.

Friends And Related Function Documentation

◆ TfSingleton< VdfExecutionTypeRegistry >

friend class TfSingleton< VdfExecutionTypeRegistry >
friend

Definition at line 115 of file executionTypeRegistry.h.


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