// 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


//! Base class for populate passes.
//!
//! Register a populate pass with @ref OMNI_GRAPH_EXEC_REGISTER_POPULATE_PASS().  When registering a pass, a "name to
//! match" is also specified.  This name is the name of a node or definition on which the registered pass should
//! populate.
//!
//! Populate passes are typically the first pass type to run in the pass pipeline. When a node is encountered during
//! construction, only a single populate pass will get a chance to populate the newly discovered node. If no pass is
//! registered against the node's name, the node definition's name is used to find a population pass to run.
//!
//! Populate pass is allowed to attach a new definition to a node it runs on.
//!
//! Minimal rebuild of the execution graph topology should be considered by the pass each time it runs. Pass pipeline
//! leaves the responsibility of deciding if pass needs to run to the implementation. At minimum it can rely on
//! verifying that topology of @ref omni::graph::exec::unstable::NodeGraphDef it generated before is still valid or
//! @ref omni::graph::exec::unstable::NodeDef has not changed.
//!
//! See @ref  groupOmniGraphExecPasses for more pass related functionality.
template <>
class omni::core::Generated<omni::graph::exec::unstable::IPopulatePass_abi>
    : public omni::graph::exec::unstable::IPopulatePass_abi
{
public:
    OMNI_PLUGIN_INTERFACE("omni::graph::exec::unstable::IPopulatePass")

    //! Call from pass pipeline to apply graph transformations on a given node (definition or topology).
    void run(omni::core::ObjectParam<omni::graph::exec::unstable::IGraphBuilder> builder,
             omni::core::ObjectParam<omni::graph::exec::unstable::INode> node);
};

#endif

#ifndef OMNI_BIND_INCLUDE_INTERFACE_DECL

inline void omni::core::Generated<omni::graph::exec::unstable::IPopulatePass_abi>::run(
    omni::core::ObjectParam<omni::graph::exec::unstable::IGraphBuilder> builder,
    omni::core::ObjectParam<omni::graph::exec::unstable::INode> node)
{
    OMNI_THROW_IF_FAILED(run_abi(builder.get(), node.get()));
}

#endif

#undef OMNI_BIND_INCLUDE_INTERFACE_DECL
#undef OMNI_BIND_INCLUDE_INTERFACE_IMPL
