// 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.
//
// --------- Warning: This is a build system generated file. ----------
//

//! @file
//!
//! @brief This file was generated by <i>omni.bind</i>.

#include <omni/core/Interface.h>
#include <omni/core/OmniAttr.h>
#include <omni/core/ResultError.h>

#include <functional>
#include <type_traits>
#include <utility>

#ifndef OMNI_BIND_INCLUDE_INTERFACE_IMPL


//! Runs registered passes.
//!
//! The role of pass pipeline is to populate and prepare the execution graph. The base implementation runs passes based
//! on the type and registration order. Most applications will define their own pass pipeline to control how the
//! execution graph is generated.
//!
//! See @ref  groupOmniGraphExecPasses for more pass related functionality.
template <>
class omni::core::Generated<omni::graph::exec::unstable::IPassPipeline_abi>
    : public omni::graph::exec::unstable::IPassPipeline_abi
{
public:
    OMNI_PLUGIN_INTERFACE("omni::graph::exec::unstable::IPassPipeline")

    //! Test if pipeline needs to rebuild (mostly for its acceleration structures).
    bool needsConstruction() noexcept;

    //! Build the pipeline (mostly for its acceleration structures).
    void construct();

    //! Test if pipeline needs to run (after topology changes in the graph).
    bool needsExecute(const omni::graph::exec::unstable::Stamp& globalTopology) noexcept;

    //! Execute the graph transformations pipeline
    void execute(omni::core::ObjectParam<omni::graph::exec::unstable::IGraphBuilderContext> builderContext,
                 omni::core::ObjectParam<omni::graph::exec::unstable::INodeGraphDef> nodeGraphDef);
};

#endif

#ifndef OMNI_BIND_INCLUDE_INTERFACE_DECL

inline bool omni::core::Generated<omni::graph::exec::unstable::IPassPipeline_abi>::needsConstruction() noexcept
{
    return needsConstruction_abi();
}

inline void omni::core::Generated<omni::graph::exec::unstable::IPassPipeline_abi>::construct()
{
    OMNI_THROW_IF_FAILED(construct_abi());
}

inline bool omni::core::Generated<omni::graph::exec::unstable::IPassPipeline_abi>::needsExecute(
    const omni::graph::exec::unstable::Stamp& globalTopology) noexcept
{
    return needsExecute_abi(globalTopology);
}

inline void omni::core::Generated<omni::graph::exec::unstable::IPassPipeline_abi>::execute(
    omni::core::ObjectParam<omni::graph::exec::unstable::IGraphBuilderContext> builderContext,
    omni::core::ObjectParam<omni::graph::exec::unstable::INodeGraphDef> nodeGraphDef)
{
    OMNI_THROW_IF_ARG_NULL(builderContext);
    OMNI_THROW_IF_ARG_NULL(nodeGraphDef);
    OMNI_THROW_IF_FAILED(execute_abi(builderContext.get(), nodeGraphDef.get()));
}

#endif

#undef OMNI_BIND_INCLUDE_INTERFACE_DECL
#undef OMNI_BIND_INCLUDE_INTERFACE_IMPL
