omni::core::InterfaceImplementation

Defined in omni/core/ITypeFactory.h

struct InterfaceImplementation

Describes a mapping from a chunk of code (i.e. implementation) to one or more interfaces.

Implementation are concrete classes that implement one or more interfaces.

This data structure is essential to the Omniverse type system, as it maps type names (i.e. strings) to chunks of code that can instantiate those types. With this, the Omniverse type system is able to map interface type names to implementations and implementation type names to specific implementations.

Public Members

const char *name

Name of the implementation. This must not be the name of an interface.

InterfaceImplementationCreateFn *createFn

Function that instantiates the implementation.

This function can be called concurrently on multiple threads

uint32_t version

Implementations have versions. By default, ITypeFactory will pick the implementation with the highest version number. This behavior can be overridden (see ITypeFactory).

This version number is not an “interface” version number. Interfaces are not versioned. Implementations, however, can be versioned. An implementation’s version number is used by ITypeFactory to pick the best implementation when instantiating an interface.

const char **interfacesImplemented

List of interfaces, that when requested to be instantiated by ITypeFactory (e.g. omni::core::createType()), should instantiate this implementation. Not all implemented interfaces should be listed here, only those interfaces you wish to instantiate via omni::core::createType().

Said differently, this is a list of interfaces, that when invoked with omni::core::createType(), should instantiate this implementation.

Which interfaces should be listed here is subtle topic. See Omniverse Native Interfaces for more details.

uint32_t interfacesImplementedCount

Number of interfaces implemented (size of interfacesImplemented). Pro-tip: Use CARB_COUNTOF32(interfacesImplemented).