omni::ext::ExtensionStateChangeHookLambda
Defined in omni/ext/ExtensionsUtils.h
-
class ExtensionStateChangeHookLambda : public omni::ext::IExtensionStateChangeHook
A wrapper object to allow passing an invocable type (i.e.
lambda) as an extension hook.
Public Functions
-
inline ExtensionStateChangeHookLambda(const std::function<void(const char*, ExtensionStateChangeType)> &fn)
Constructor.
Note
Typically this is not constructed directly. Instead use createExtensionStateChangeHook().
- Parameters
fn – a
std::function
that will be called on extension state change. May be empty.
-
inline virtual void onStateChange(const char *extId, ExtensionStateChangeType type) override
State change handler function.
Note
Typically this is not called directly; it is called by ExtensionManager.
- Parameters
extId – The Extension ID that is changing
type – The ExtensionStateChangeType describing the state change
-
inline virtual size_t addRef() override
Atomically adds one to the reference count.
- Returns
The current reference count after one was added, though this value may change before read if other threads are also modifying the reference count. The return value is guaranteed to be non-zero.
-
inline virtual size_t release() override
Atomically subtracts one from the reference count.
If the result is zero, carb::deleteHandler() is called for
this
.- Returns
The current reference count after one was subtracted. If zero is returned, carb::deleteHandler() was called for
this
.
Public Static Functions
-
static inline constexpr carb::InterfaceDesc getInterfaceDesc() noexcept
Returns information about this interface.
Auto-generated by CARB_PLUGIN_INTERFACE() or CARB_PLUGIN_INTERFACE_EX.
- Returns
The carb::InterfaceDesc struct with information about this interface.
-
static inline constexpr carb::InterfaceDesc getLatestInterfaceDesc() noexcept
Returns information about the latest version of this interface.
Auto-generated by CARB_PLUGIN_INTERFACE() or CARB_PLUGIN_INTERFACE_EX.
- Returns
The carb::InterfaceDesc struct with information about the latest version of this interface.
-
inline ExtensionStateChangeHookLambda(const std::function<void(const char*, ExtensionStateChangeType)> &fn)