// Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//

//! @file IApplyOnEachFunction.h
//!
//! @brief Defines @ref omni::graph::exec::unstable::IApplyOnEachFunction.
#pragma once

#include <omni/graph/exec/unstable/IBase.h>

namespace omni
{
namespace graph
{
namespace exec
{
namespace unstable
{

class IApplyOnEachFunction_abi;
class IApplyOnEachFunction;
class ExecutionPath;

//! Interface wrapping a function (possibly with storage) to apply on all instantiations of a given definition.
class IApplyOnEachFunction_abi
    : public omni::core::Inherits<omni::graph::exec::unstable::IBase,
                                  OMNI_TYPE_ID("omni.graph.exec.unstable.IApplyOnEachFunction")>
{
protected:
    //! Invokes the wrapped function.
    virtual void invoke_abi(OMNI_ATTR("in, not_null, throw_if_null, ref") const ExecutionPath* path) noexcept = 0;
};

//! Smart pointer managing an instance of @ref IApplyOnEachFunction.
using ApplyOnEachFunctionPtr = omni::core::ObjectPtr<IApplyOnEachFunction>;

} // namespace unstable
} // namespace exec
} // namespace graph
} // namespace omni

#define OMNI_BIND_INCLUDE_INTERFACE_DECL
#include <omni/graph/exec/unstable/IApplyOnEachFunction.gen.h>

//! @copydoc omni::graph::exec::unstable::IApplyOnEachFunction_abi
//!
//! @ingroup groupOmniGraphExecInterfaces
class omni::graph::exec::unstable::IApplyOnEachFunction
    : public omni::core::Generated<omni::graph::exec::unstable::IApplyOnEachFunction_abi>
{
};

#include <omni/graph/exec/unstable/ExecutionPath.h>

#define OMNI_BIND_INCLUDE_INTERFACE_IMPL
#include <omni/graph/exec/unstable/IApplyOnEachFunction.gen.h>
