// 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 IBackgroundResultWriter.h
//!
//! @brief Defines @ref omni::graph::exec::unstable::IBackgroundResultWriter.
#pragma once

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

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

// forward declarations needed by interface declaration
class ExecutionTask;
class IBackgroundResultWriter;
class IBackgroundResultWriter_abi;

//! Functor interface used to write the result of a background task.
class IBackgroundResultWriter_abi
    : public omni::core::Inherits<omni::graph::exec::unstable::IBase,
                                  OMNI_TYPE_ID("omni.graph.exec.unstable.IBackgroundResultWriter")>
{
protected:
    //! Write the result.
    virtual Status write_abi(OMNI_ATTR("in, out, not_null, throw_if_null, ref") ExecutionTask* info) noexcept = 0;
};

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

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

// generated API declaration
#define OMNI_BIND_INCLUDE_INTERFACE_DECL
#include <omni/graph/exec/unstable/IBackgroundResultWriter.gen.h>

//! @copydoc omni::graph::exec::unstable::IBackgroundResultWriter_abi
class omni::graph::exec::unstable::IBackgroundResultWriter
    : public omni::core::Generated<omni::graph::exec::unstable::IBackgroundResultWriter_abi>
{
};

// generated API implementation
#define OMNI_BIND_INCLUDE_INTERFACE_IMPL
#include <omni/graph/exec/unstable/IBackgroundResultWriter.gen.h>
