captureScheduleFunction#

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

template<typename Fn>
auto omni::graph::exec::unstable::captureScheduleFunction(
Fn &&fn,
) noexcept -> decltype(detail::ScheduleFunctionHelper<Fn>::capture(std::forward<Fn>(fn)))#

Helper function to efficiently capture an invocable object (i.e. std::function, function ptr, IScheduleFunction*).

Suitable when capturing the invocable object in a lambda to be passed to a scheduler.

Use this function when an IScheduleFunction will be invoked at a later time by a scheduler. This function will call omni::core::IObject::acquire() on the IScheduleFunction.

If an invocable object that is not a IScheduleFunction is passed to this function, std::move() will be called.