ScopedPassRegistration#

Fully qualified name: omni::graph::exec::unstable::ScopedPassRegistration

class ScopedPassRegistration#

Scoped object that registers a pass factory in its constructor and deregisters in the objects destructor.

Useful for temporarily registering IPassFactory, for example, in a unit test.

When registering a pass in a plugin, rather than using this object, prefer using one of the pass registration macros (e.g. OMNI_GRAPH_EXEC_REGISTER_POPULATE_PASS()). See Pass Registration for a list of registration macros.

Public Functions

template<typename Fn>
inline ScopedPassRegistration(
PassType type,
const char *name,
Fn &&fn,
const ConstName &nameToMatch = ConstName(),
PassPriority priority = 0,
)#

Constructor. Calls IPassRegistry::registerPass() in the global pass registry.

name must not be nullptr.

Use helper macros like OMNI_GRAPH_EXEC_REGISTER_POPULATE_PASS() rather than directly using this method. See Pass Registration for a list of registration macros. Constructor. Calls IPassRegistry::registerPass().

The given function should have the signature IPass*(IGraphBuilder*).

inline ScopedPassRegistration(
PassType type,
std::string &&name,
omni::core::ObjectParam<IPassFactory> factory,
const ConstName &nameToMatch = ConstName(),
PassPriority priority = 0,
)#

Constructor. Calls IPassRegistry::registerPass() in the global pass registry.

name must not be nullptr.

factory must not be nullptr.

Use helper macros like OMNI_GRAPH_EXEC_REGISTER_POPULATE_PASS() rather than directly using this method. See Pass Registration for a list of registration macros. Constructor. Calls IPassRegistry::registerPass().

inline ~ScopedPassRegistration() noexcept#

Destructor. Calls IPassRegistry::deregisterPass().