omni::ext::subscribeToExtensionEnable

Defined in omni/ext/ExtensionsUtils.h

inline std::pair<IHookHolderPtr, IHookHolderPtr> omni::ext::subscribeToExtensionEnable(ExtensionManager *manager, const std::function<void(const char *extId)> &onEnable, const std::function<void(const char *extId)> &onDisable = nullptr, const char *extFullName = "", const char *hookName = nullptr)

A wrapper function to subscribe to extension enable (and optionally disable) events.

Parameters
  • manager – The ExtensionManager instance

  • onEnable – The std::function that captures the invocable to call on enable (may be empty). If the extension is already enabled, this is invoked immediately

  • onDisable – The std::function that captures the invocable to call on disable (may be empty)

  • extFullName – See IExtensionManagerHooks::createExtensionStateChangeHook()

  • hookName – See IExtensionManagerHooks::createExtensionStateChangeHook()

Returns

a std::pair of IHookHolderPtr objects (first represents the enable holder and second represents the disable holder)