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


//! Node graph definition interface for OmniGraph graph.
//!
//! This interface allows us to reason about OmniGraph graphs during graph transformation phase and access authoring
//! graph associated with this definition.
template <>
class omni::core::Generated<omni::graph::core::unstable::IGenericNodeGraphDef_abi>
    : public omni::graph::core::unstable::IGenericNodeGraphDef_abi
{
public:
    OMNI_PLUGIN_INTERFACE("omni::graph::core::unstable::IGenericNodeGraphDef")

    //! Returns a handle to authoring graph associated with this definition.
    omni::graph::core::GraphObj getAuthoringGraph() noexcept;

    //! Returns True if this graph is used as part of instancing pipeline, false otherwise.
    //!
    //! @note   We will most likely remove this before making this interface stable
    bool isInstanced() noexcept;

    //! Returns execution node associated with a given authoring node, or nullptr
    //! if no association was discovered in this definition.
    //!
    //! The returned @ref INode will *not* have @ref omni::core::IObject::acquire() called before being
    //! returned.
    omni::graph::exec::unstable::INode* getExecutionNode(const omni::graph::core::NodeObj& nodeObj) noexcept;

    //! Construct the graph.
    //!
    //! Construction can happen for entire execution graph or only affected by a topological change definitions.
    void build(omni::core::ObjectParam<omni::graph::exec::unstable::IGraphBuilder> builder) noexcept;

    //! Inspect the state of the graph
    bool inspect(omni::core::ObjectParam<inspect::IInspector> inspector) noexcept;

    //! Acquire internal information about bucketing of instances for vectorized execution
    //!
    //! Arguments must not be @c nullptr.
    void getInstanceInfo(const omni::graph::exec::unstable::ExecutionTask& info,
                         omni::graph::core::InstanceIndex& retBaseInstanceIndex,
                         size_t& retNumberOfInstances) noexcept;
};

#endif

#ifndef OMNI_BIND_INCLUDE_INTERFACE_DECL

inline omni::graph::core::GraphObj omni::core::Generated<
    omni::graph::core::unstable::IGenericNodeGraphDef_abi>::getAuthoringGraph() noexcept
{
    return getAuthoringGraph_abi();
}

inline bool omni::core::Generated<omni::graph::core::unstable::IGenericNodeGraphDef_abi>::isInstanced() noexcept
{
    return isInstanced_abi();
}

inline omni::graph::exec::unstable::INode* omni::core::Generated<
    omni::graph::core::unstable::IGenericNodeGraphDef_abi>::getExecutionNode(const omni::graph::core::NodeObj& nodeObj) noexcept
{
    return getExecutionNode_abi(&nodeObj);
}

inline void omni::core::Generated<omni::graph::core::unstable::IGenericNodeGraphDef_abi>::build(
    omni::core::ObjectParam<omni::graph::exec::unstable::IGraphBuilder> builder) noexcept
{
    build_abi(builder.get());
}

inline bool omni::core::Generated<omni::graph::core::unstable::IGenericNodeGraphDef_abi>::inspect(
    omni::core::ObjectParam<inspect::IInspector> inspector) noexcept
{
    return inspect_abi(inspector.get());
}

inline void omni::core::Generated<omni::graph::core::unstable::IGenericNodeGraphDef_abi>::getInstanceInfo(
    const omni::graph::exec::unstable::ExecutionTask& info,
    omni::graph::core::InstanceIndex& retBaseInstanceIndex,
    size_t& retNumberOfInstances) noexcept
{
    getInstanceInfo_abi(&info, &retBaseInstanceIndex, &retNumberOfInstances);
}

#endif

#undef OMNI_BIND_INCLUDE_INTERFACE_DECL
#undef OMNI_BIND_INCLUDE_INTERFACE_IMPL
