omni/kit/exec/core/unstable/IExecutionGraphSettings.h

File members: omni/kit/exec/core/unstable/IExecutionGraphSettings.h

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

#pragma once

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

namespace omni
{
namespace kit
{
namespace exec
{
namespace core
{
namespace unstable
{

// forward declarations needed by interface declaration
class IExecutionGraphSettings;
class IExecutionGraphSettings_abi;

class IExecutionGraphSettings_abi
    : public omni::core::Inherits<graph::exec::unstable::IBase,
                                  OMNI_TYPE_ID("omni.kit.exec.core.unstable.IExecutionGraphSettings")>
{
protected:
    virtual bool shouldForceSerial_abi() noexcept = 0;

    virtual bool shouldForceParallel_abi() noexcept = 0;
};

inline IExecutionGraphSettings* getExecutionGraphSettings() noexcept;

} // namespace unstable
} // namespace core
} // namespace exec
} // namespace kit
} // namespace omni

// generated API declaration
#define OMNI_BIND_INCLUDE_INTERFACE_DECL
#include <omni/kit/exec/core/unstable/IExecutionGraphSettings.gen.h>

class omni::kit::exec::core::unstable::IExecutionGraphSettings
    : public omni::core::Generated<omni::kit::exec::core::unstable::IExecutionGraphSettings_abi>
{
};

// additional headers needed for API implementation
#include <omni/graph/exec/unstable/IDef.h>

inline omni::kit::exec::core::unstable::IExecutionGraphSettings* omni::kit::exec::core::unstable::getExecutionGraphSettings() noexcept
{
    // createType() always calls acquire() and returns an ObjectPtr to make sure release() is called. we don't want
    // to hold a ref here to avoid static destruction issues. here we allow the returned ObjectPtr to destruct
    // (after calling get()) to release our ref. we know the DLL in which the singleton was created is maintaining a
    // ref and will keep the singleton alive for the lifetime of the DLL.
    static auto* sSingleton = omni::core::createType<IExecutionGraphSettings>().get();
    return sSingleton;
}

// generated API implementation
#define OMNI_BIND_INCLUDE_INTERFACE_IMPL
#include <omni/kit/exec/core/unstable/IExecutionGraphSettings.gen.h>