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

//! @file IInvalidationForwarder.h
//!
//! @brief Defines @ref omni::graph::exec::unstable::IInvalidationForwarder.
#pragma once

#include <omni/graph/exec/unstable/IBase.h>

namespace omni
{
namespace graph
{
namespace exec
{
namespace unstable
{

class IInvalidationForwarder_abi;
class IInvalidationForwarder;
class ITopology;

//! Interface wrapping a function (possibly with storage) to forward topology invalidation notices.
class IInvalidationForwarder_abi
    : public omni::core::Inherits<omni::graph::exec::unstable::IBase,
                                  OMNI_TYPE_ID("omni.graph.exec.unstable.IInvalidationForwarder")>
{
protected:
    //! Invokes the wrapped function.
    //!
    //! The given topology must not be @c nullptr.
    virtual void invoke_abi(OMNI_ATTR("not_null, throw_if_null") ITopology* topology) noexcept = 0;
};

//! Smart pointer managing an instance of @ref IInvalidationForwarder.
using InvalidationForwarderPtr = omni::core::ObjectPtr<IInvalidationForwarder>;

} // namespace unstable
} // namespace exec
} // namespace graph
} // namespace omni

#define OMNI_BIND_INCLUDE_INTERFACE_DECL
#include <omni/graph/exec/unstable/IInvalidationForwarder.gen.h>

//! @copydoc omni::graph::exec::unstable::IInvalidationForwarder_abi
//!
//! @ingroup groupOmniGraphExecInterfaces
class omni::graph::exec::unstable::IInvalidationForwarder
    : public omni::core::Generated<omni::graph::exec::unstable::IInvalidationForwarder_abi>
{
};

#include <omni/graph/exec/unstable/ITopology.h>

#define OMNI_BIND_INCLUDE_INTERFACE_IMPL
#include <omni/graph/exec/unstable/IInvalidationForwarder.gen.h>
