// Copyright (c) 2022, 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


//! Common state for graph builders.
//!
//! *TODO* We will use this class to introduce reporting from graph transformation pipeline back to the application.
template <>
class omni::core::Generated<omni::graph::exec::unstable::IGraphBuilderContext_abi>
    : public omni::graph::exec::unstable::IGraphBuilderContext_abi
{
public:
    OMNI_PLUGIN_INTERFACE("omni::graph::exec::unstable::IGraphBuilderContext")

    //! Current construction version.
    //!
    //! Incremented after each pass pipeline run to include definitions that were created before the run.
    omni::graph::exec::unstable::Stamp getConstructionStamp() noexcept;

    //! Return owner of all graphs this builder touches
    //!
    //! The returned @ref omni::graph::exec::unstable::IGraph will *not* have
    //! @ref omni::core::IObject::acquire() called before being returned.
    omni::graph::exec::unstable::IGraph* getGraph() noexcept;

    //! To be overriden by application specific class to enable reporting from transformation pipeline.
    void report(const char* diagnose) noexcept;

    //! Run transformation pipeline
    void runTransformations(omni::core::ObjectParam<omni::graph::exec::unstable::INodeGraphDef> nodeGraphDef) noexcept;
};

#endif

#ifndef OMNI_BIND_INCLUDE_INTERFACE_DECL

inline omni::graph::exec::unstable::Stamp omni::core::Generated<
    omni::graph::exec::unstable::IGraphBuilderContext_abi>::getConstructionStamp() noexcept
{
    return getConstructionStamp_abi();
}

inline omni::graph::exec::unstable::IGraph* omni::core::Generated<
    omni::graph::exec::unstable::IGraphBuilderContext_abi>::getGraph() noexcept
{
    return getGraph_abi();
}

inline void omni::core::Generated<omni::graph::exec::unstable::IGraphBuilderContext_abi>::report(const char* diagnose) noexcept
{
    report_abi(diagnose);
}

inline void omni::core::Generated<omni::graph::exec::unstable::IGraphBuilderContext_abi>::runTransformations(
    omni::core::ObjectParam<omni::graph::exec::unstable::INodeGraphDef> nodeGraphDef) noexcept
{
    runTransformations_abi(nodeGraphDef.get());
}

#endif

#undef OMNI_BIND_INCLUDE_INTERFACE_DECL
#undef OMNI_BIND_INCLUDE_INTERFACE_IMPL
