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


//! Interface for monitoring and handling changes in bundles and attributes.
//!
//! The IBundleChanges_abi is an interface that provides methods for checking whether bundles and attributes
//! have been modified, and cleaning them if they have been modified. This is particularly useful in scenarios
//! where it's crucial to track changes and maintain the state of bundles and attributes.
//!
//! This interface provides several methods for checking and cleaning modifications, each catering to different
//! use cases such as handling single bundles, multiple bundles, attributes, or specific attributes of a single bundle.
//!
//! The methods of this interface return a BundleChangeType enumeration that indicates whether the checked entity
//! (bundle or attribute) has been modified.
template <>
class omni::core::Generated<omni::graph::core::IBundleChanges_abi> : public omni::graph::core::IBundleChanges_abi
{
public:
    OMNI_PLUGIN_INTERFACE("omni::graph::core::IBundleChanges")

    //! @brief Activate tracking for specific bundle on its attributes and children.
    //! @param handle to the specific bundles to enable change tracking.
    //! @return An omni::core::Result indicating the success of the operation.
    omni::core::Result activateChangeTracking(const omni::graph::core::BundleHandle& handle) noexcept;

    //! @brief Deactivate tracking for specific bundle on its attributes and children.
    //! @param handle to the specific bundles to enable change tracking.
    //! @return An omni::core::Result indicating the success of the operation.
    omni::core::Result deactivateChangeTracking(const omni::graph::core::BundleHandle& handle) noexcept;

    //! @brief Retrieves the change status of an array of bundles.
    //!
    //! This method is used to check if any of the bundles in the provided array have been modified.
    //!
    //! The count parameter indicates the size of the bundles array, as well as the changes output array.
    //!
    //! @param bundles An array of handles to the specific bundles to check for modifications.
    //! @param count The number of bundle handles in the array.
    //! @param changes An array that will be filled with BundleChangeType values for each bundle.
    //!
    //! @returns An omni::core::Result indicating the success of the operation.
    omni::core::Result getChangesForBundles(const omni::graph::core::ConstBundleHandle* const bundles,
                                            size_t count,
                                            omni::graph::core::BundleChangeType* const changes);

    //! @brief Retrieves the change status of an array of attributes.
    //!
    //! This method is used to check if any of the attributes in the provided array have been modified.
    //!
    //! The count parameter indicates the size of the attributes array, as well as the changes output array.
    //!
    //! @param attributes An array of handles to the attributes to check for modifications.
    //! @param count The number of attribute handles in the array.
    //! @param changes An array that will be filled with BundleChangeType values for each attribute.
    //!
    //! @returns An omni::core::Result indicating the success of the operation.
    omni::core::Result getChangesForAttributes(const omni::graph::core::ConstAttributeDataHandle* const attributes,
                                               size_t count,
                                               omni::graph::core::BundleChangeType* const changes);

    //! Clears all recorded changes.
    //!
    //! This method is used to clear or reset all the recorded changes of the bundles and attributes.
    //! It can be used when the changes have been processed and need to be discarded.
    //!
    //! An omni::core::Result indicating the success of the operation.
    omni::core::Result clearChanges() noexcept;
};

#endif

#ifndef OMNI_BIND_INCLUDE_INTERFACE_DECL

inline omni::core::Result omni::core::Generated<omni::graph::core::IBundleChanges_abi>::activateChangeTracking(
    const omni::graph::core::BundleHandle& handle) noexcept
{
    return activateChangeTracking_abi(handle);
}

inline omni::core::Result omni::core::Generated<omni::graph::core::IBundleChanges_abi>::deactivateChangeTracking(
    const omni::graph::core::BundleHandle& handle) noexcept
{
    return deactivateChangeTracking_abi(handle);
}

inline omni::core::Result omni::core::Generated<omni::graph::core::IBundleChanges_abi>::getChangesForBundles(
    const omni::graph::core::ConstBundleHandle* const bundles,
    size_t count,
    omni::graph::core::BundleChangeType* const changes)
{
    OMNI_THROW_IF_ARG_NULL(bundles);
    OMNI_THROW_IF_ARG_NULL(changes);
    auto return_ = getChangesForBundles_abi(bundles, count, changes);
    return return_;
}

inline omni::core::Result omni::core::Generated<omni::graph::core::IBundleChanges_abi>::getChangesForAttributes(
    const omni::graph::core::ConstAttributeDataHandle* const attributes,
    size_t count,
    omni::graph::core::BundleChangeType* const changes)
{
    OMNI_THROW_IF_ARG_NULL(attributes);
    OMNI_THROW_IF_ARG_NULL(changes);
    auto return_ = getChangesForAttributes_abi(attributes, count, changes);
    return return_;
}

inline omni::core::Result omni::core::Generated<omni::graph::core::IBundleChanges_abi>::clearChanges() noexcept
{
    return clearChanges_abi();
}

#endif

#undef OMNI_BIND_INCLUDE_INTERFACE_DECL
#undef OMNI_BIND_INCLUDE_INTERFACE_IMPL
