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


//! Top-level container for storing the Execution Framework's graph of graphs.
//!
//! @ref omni::graph::exec::unstable::IGraph is the top-level container used to store the graph of graphs.  This
//! top-level container is referred to as the <i>execution graph</i>.
//!
//! @ref omni::graph::exec::unstable::IGraph's responsibilities include:
//!
//! - Tracking if the graph is currently being constructed.  See @ref omni::graph::exec::unstable::IGraph::inBuild().
//!
//! - Tracking gross changes to the topologies of graphs within the execution graph.  This is done with the <i>global
//!   topology stamp</i> (see @ref omni::graph::exec::unstable::IGraph::getGlobalTopologyStamp()).  Each time a topology
//!   is invalidated, the global topology stamp is incremented.  Consumers of the execution graph can use this stamp to
//!   detect changes in the graph.  See @rstref{Graph Invalidation <ef_graph_invalidation>} for details.
//!
//! - Owning and providing access to the top level graph definition (see @ref
//!   omni::graph::exec::unstable::IGraph::getNodeGraphDef()).  The root node of the top-level graph definition is the
//!   root of execution graph.  @ref omni::graph::exec::unstable::IGraph is the only container, other than @ref
//!   omni::graph::exec::unstable::INode, that attaches to definitions.
//!
//! See @rstref{Graph Concepts <ef_graph_concepts>} for more information on how @ref omni::graph::exec::unstable::IGraph
//! fits into the Execution Framework.
//!
//! See @ref omni::graph::exec::unstable::Graph for a concrete implementation of this interface.
template <>
class omni::core::Generated<omni::graph::exec::unstable::IGraph_abi> : public omni::graph::exec::unstable::IGraph_abi
{
public:
    OMNI_PLUGIN_INTERFACE("omni::graph::exec::unstable::IGraph")

    //! Access the top-level node graph definition.
    //!
    //! The returned @ref omni::graph::exec::unstable::INodeGraphDef will *not* have
    //! @ref omni::core::IObject::acquire() called before being returned.
    //!
    //! @thread_safety This method is thread safe.  The returned pointer will be valid for the lifetime of this @ref
    //! omni::graph::exec::unstable::IGraph.
    omni::graph::exec::unstable::INodeGraphDef* getNodeGraphDef() noexcept;

    //! Name set on the graph during construction.
    //!
    //! @thread_safety This method is thread safe.  The returned pointer will be valid for the lifetime of this @ref
    //! omni::graph::exec::unstable::IGraph.
    const omni::graph::exec::unstable::ConstName& getName() noexcept;

    //! Return global topology of the graph. Useful when detecting that graph transformation pipeline needs to run.
    //!
    //! See @rstref{Graph Invalidation <ef_graph_invalidation>} to understand how this stamp is used to detect changes
    //! in the graph.
    //!
    //! @thread_safety This method is thread safe.  The returned pointer will be valid for the lifetime of this @ref
    //! omni::graph::exec::unstable::IGraph.  It is up to the caller to mutate the stamp in a thread safe manner.
    omni::graph::exec::unstable::Stamp* getGlobalTopologyStamp() noexcept;

    //! Return @c true if a @ref omni::graph::exec::unstable::IGraphBuilder is currently building a part of this graph.
    //!
    //! @thread_safety This method is thread safe.
    bool inBuild() noexcept;

    //! Mark that an @ref omni::graph::exec::unstable::IGraphBuilder is currently building a part of this graph.
    //!
    //! Each builder should call @c _setInBuild(true) followed by @c _setInBuild(false) once building is complete. Since
    //! multiple builders can be active at a time, it is safe for this method to be called multiple times.
    //!
    //! This method should only be called by @ref omni::graph::exec::unstable::IGraphBuilder.
    //!
    //! @thread_safety This method is thread safe.
    void _setInBuild(bool inBuild) noexcept;
};

#endif

#ifndef OMNI_BIND_INCLUDE_INTERFACE_DECL

inline omni::graph::exec::unstable::INodeGraphDef* omni::core::Generated<
    omni::graph::exec::unstable::IGraph_abi>::getNodeGraphDef() noexcept
{
    return getNodeGraphDef_abi();
}

inline const omni::graph::exec::unstable::ConstName& omni::core::Generated<omni::graph::exec::unstable::IGraph_abi>::getName() noexcept
{
    return *(getName_abi());
}

inline omni::graph::exec::unstable::Stamp* omni::core::Generated<
    omni::graph::exec::unstable::IGraph_abi>::getGlobalTopologyStamp() noexcept
{
    return getGlobalTopologyStamp_abi();
}

inline bool omni::core::Generated<omni::graph::exec::unstable::IGraph_abi>::inBuild() noexcept
{
    return inBuild_abi();
}

inline void omni::core::Generated<omni::graph::exec::unstable::IGraph_abi>::_setInBuild(bool inBuild) noexcept
{
    _setInBuild_abi(inBuild);
}

#endif

#undef OMNI_BIND_INCLUDE_INTERFACE_DECL
#undef OMNI_BIND_INCLUDE_INTERFACE_IMPL
