// Copyright (c) 2022, 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 <functional>
#include <type_traits>
#include <utility>

#ifndef OMNI_BIND_INCLUDE_INTERFACE_IMPL


//! Provide read only access to recursive bundles.
//!
template <>
class omni::core::Generated<omni::graph::core::IConstBundle2_abi> : public omni::graph::core::IConstBundle2_abi
{
public:
    OMNI_PLUGIN_INTERFACE("omni::graph::core::IConstBundle2")

    //! Return true if this bundle is valid, false otherwise.
    bool isValid() noexcept;

    //! Return the context of this bundle.
    omni::graph::core::GraphContextObj getContext() noexcept;

    //! Return Handle to this bundle. Invalid handle is returned if this bundle is invalid.
    omni::graph::core::ConstBundleHandle getConstHandle() noexcept;

    //! Return full path of this bundle.
    carb::flatcache::PathC getPath() noexcept;

    //! Return name of this bundle
    omni::graph::core::NameToken getName() noexcept;

    //! Return handle to the parent of this bundle. Invalid handle is returned if bundle has no parent.
    omni::graph::core::ConstBundleHandle getConstParentBundle() noexcept;

    //! @brief Get the names and types of all attributes in this bundle.
    //!
    //! This method operates in two modes: **query mode** or **get mode**.
    //!
    //! **Query mode** is enabled when names and types are `nullptr`. When in this mode, *nameAndTypeCount
    //! will be populated with the number of attributes in the bundle.
    //!
    //! **Get mode** is enabled when names or types is not `nullptr`. Upon entering the function, *nameAndTypeCount
    //! stores the number of entries in names and types. In **Get mode** names are not nullptr, names array is populated
    //! with attribute names. In **Get mode** types are not nullptr, types array is populated with attribute types.
    //!
    //! @param names The names of the attributes.
    //! @param types The types of the attributes.
    //! @param nameAndTypeCount must not be `nullptr` in both modes.
    //! @return Success if executed successfully, Fail for unsuccessful execution, InvalidArgument if arguments are
    //!         invalid.
    omni::core::Result getAttributeNamesAndTypes(omni::graph::core::NameToken* const names,
                                                 omni::graph::core::Type* const types,
                                                 size_t* const nameAndTypeCount) noexcept;

    //! @brief Get read only handles to all attributes in this bundle.
    //!
    //! This method operates in two modes: **query mode** or **get mode**.
    //!
    //! **Query mode** is enabled when attributes is `nullptr`. When in this mode, *attributeCount
    //! will be populated with the number of attributes in the bundle.
    //!
    //! **Get mode** is enabled when attributes is not `nullptr`. Upon entering the function, *attributeCount
    //! stores the number of entries in attributes.
    //! In **Get mode** attributes are not nullptr, attributes array is populated with attribute handles in the bundle.
    //!
    //! @param attributes The buffer to store handles of the attributes in this bundle.
    //! @param attributeCount Size of attributes buffer. Must not be `nullptr` in both modes.
    //! @return Success if executed successfully, Fail for unsuccessful execution, InvalidArgument if arguments are
    //!         invalid.
    omni::core::Result getConstAttributes(omni::graph::core::ConstAttributeDataHandle* const attributes,
                                          size_t* const attributeCount) noexcept;

    //! @brief Search for read only handles of the attribute in this bundle by using attribute names.
    //!
    //! @param names The name of the attributes to be searched for.
    //! @param nameCount Size of names buffer.
    //! @param attributes The buffer to store handles of the attributes.
    //! @return Success if executed successfully, Fail for unsuccessful execution, InvalidArgument if arguments are
    //!         invalid.
    omni::core::Result getConstAttributesByName(const omni::graph::core::NameToken* const names,
                                                size_t nameCount,
                                                omni::graph::core::ConstAttributeDataHandle* const attributes) noexcept;

    //! @brief Get read only handles to all child bundles in this bundle.
    //!
    //! This method operates in two modes: **query mode** or **get mode**.
    //!
    //! **Query mode** is enabled when bundles is `nullptr`. When in this mode, *bundleCount
    //! will be populated with the number of bundles in the bundle.
    //!
    //! **Get mode** is enabled when bundles is not `nullptr`. Upon entering the function, *bundleCount
    //! stores the number of entries in bundles.
    //! In **Get mode** bundles are not nullptr, bundles array is populated with bundle handles in the bundle.
    //!
    //! @param bundles The buffer to save child bundle handles.
    //! @param bundleCount Size of the bundles buffer. Must not be `nullptr` in both modes.
    //! @return Success if executed successfully, Fail for unsuccessful execution, InvalidArgument if arguments are
    //!         invalid.
    omni::core::Result getConstChildBundles(omni::graph::core::ConstBundleHandle* const bundles,
                                            size_t* const bundleCount) noexcept;

    //! @brief Get read only handle to child bundle by index.
    //!
    //! @param bundleIndex Bundle index in range [0, childBundleCount).
    //! @param bundle Handle under the index. If bundle index is out of range, then invalid handle is returned.
    //! @return Success if executed successfully, Fail for unsuccessful execution, InvalidArgument if arguments are
    //!         invalid.
    omni::core::Result getConstChildBundle(size_t bundleIndex,
                                           omni::graph::core::ConstBundleHandle* const bundle) noexcept;

    //! @brief Lookup for read only handles to child bundles under specified names.
    //!
    //! For children that are not found invalid handles are returned.
    //!
    //! @param names The names of the child bundles in this bundle.
    //! @param nameCount The number of child bundles to be searched.
    //! @param foundBundles Output handles to the found bundles.
    //! @return Success if executed successfully, Fail for unsuccessful execution, InvalidArgument if arguments are
    //!         invalid.
    omni::core::Result getConstChildBundlesByName(const omni::graph::core::NameToken* const names,
                                                  size_t nameCount,
                                                  omni::graph::core::ConstBundleHandle* const foundBundles) noexcept;

    //! Return Const Bundle Handle to Metadata Storage
    omni::graph::core::ConstBundleHandle getConstMetadataStorage() noexcept;

    //! @brief Get the names and types of all bundle metadata fields in this bundle.
    //!
    //! This method operates in two modes: **query mode** or **get mode**.
    //!
    //! **Query mode** is enabled when fieldNames and fieldTypes are `nullptr`. When in this mode, *fieldCount
    //! will be populated with the number of metadata fields in this bundle.
    //!
    //! **Get mode** is enabled when fieldNames or fieldTypes is not `nullptr`. Upon entering the function,
    //! *fieldCount stores the number of entries in fieldNames and @p fieldTypes.
    //!
    //! In **Get mode** fieldNames are not `nullptr`, fieldNames array is populated with field names.
    //! In **Get mode** fieldTypes are not `nullptr`, fieldTypes array is populated with field types.
    //!
    //! @param fieldNames Output field names in this bundle.
    //! @param fieldTypes Output field types in this bundle.
    //! @param fieldCount must not be `nullptr` in both modes.
    //! @return Success if executed successfully, Fail for unsuccessful execution, InvalidArgument if arguments are
    //!         invalid.
    omni::core::Result getBundleMetadataNamesAndTypes(omni::graph::core::NameToken* const fieldNames,
                                                      omni::graph::core::Type* const fieldTypes,
                                                      size_t* const fieldCount) noexcept;

    //! @brief Search for field handles in this bundle by using field names.
    //!
    //!@param fieldNames Name of bundle metadata fields to be searched for.
    //!@param fieldCount Size of fieldNames and bundleMetadata arrays.
    //!@param bundleMetadata Handle to metadata fields in this bundle.
    //!@return Success if executed successfully, Fail for unsuccessful execution, InvalidArgument if arguments are
    //!        invalid.
    omni::core::Result getConstBundleMetadataByName(const omni::graph::core::NameToken* const fieldNames,
                                                    size_t fieldCount,
                                                    omni::graph::core::ConstAttributeDataHandle* const bundleMetadata) noexcept;

    //! @brief Get the names and types of all attribute metadata fields in the attribute.
    //!
    //! This method operates in two modes: **query mode** or **get mode**.
    //!
    //! **Query mode** is enabled when fieldNames and @p fieldTypes are `nullptr`. When in this mode, *fieldCount
    //! will be populated with the number of metadata fields in the attribute.
    //!
    //! **Get mode** is enabled when fieldNames or fieldTypes is not `nullptr`. Upon entering the function,
    //! *fieldCount stores the number of entries in fieldNames and fieldTypes.
    //!
    //! In **Get mode** fieldNames are not `nullptr`, fieldNames array is populated with field names.
    //! In **Get mode** fieldTypes are not `nullptr`, fieldTypes array is populated with field types.
    //!
    //! @param attribute Name of the attribute.
    //! @param fieldNames Output field names in the attribute.
    //! @param fieldTypes Output field types in the attribute.
    //! @param fieldCount must not be `nullptr` in both modes.
    //! @return Success if executed successfully, Fail for unsuccessful execution, InvalidArgument if arguments are
    //!         invalid.
    omni::core::Result getAttributeMetadataNamesAndTypes(omni::graph::core::NameToken attribute,
                                                         omni::graph::core::NameToken* const fieldNames,
                                                         omni::graph::core::Type* const fieldTypes,
                                                         size_t* const fieldCount) noexcept;

    //! @brief Search for read only field handles in the attribute by using field names.
    //!
    //! @param attribute The name of the attribute.
    //! @param fieldNames The names of attribute metadata fields to be searched for.
    //! @param fieldCount Size of fieldNames and attributeMetadata arrays.
    //! @param attributeMetadata Handles to attribute metadata fields in the attribute.
    //! @return Success if executed successfully, Fail for unsuccessful execution, InvalidArgument if arguments are
    //!         invalid.
    omni::core::Result getConstAttributeMetadataByName(
        omni::graph::core::NameToken attribute,
        const omni::graph::core::NameToken* const fieldNames,
        size_t fieldCount,
        omni::graph::core::ConstAttributeDataHandle* const attributeMetadata) noexcept;
};

#endif

#ifndef OMNI_BIND_INCLUDE_INTERFACE_DECL

inline bool omni::core::Generated<omni::graph::core::IConstBundle2_abi>::isValid() noexcept
{
    return isValid_abi();
}

inline omni::graph::core::GraphContextObj omni::core::Generated<omni::graph::core::IConstBundle2_abi>::getContext() noexcept
{
    return getContext_abi();
}

inline omni::graph::core::ConstBundleHandle omni::core::Generated<omni::graph::core::IConstBundle2_abi>::getConstHandle() noexcept
{
    return getConstHandle_abi();
}

inline carb::flatcache::PathC omni::core::Generated<omni::graph::core::IConstBundle2_abi>::getPath() noexcept
{
    return getPath_abi();
}

inline omni::graph::core::NameToken omni::core::Generated<omni::graph::core::IConstBundle2_abi>::getName() noexcept
{
    return getName_abi();
}

inline omni::graph::core::ConstBundleHandle omni::core::Generated<omni::graph::core::IConstBundle2_abi>::getConstParentBundle() noexcept
{
    return getConstParentBundle_abi();
}

inline omni::core::Result omni::core::Generated<omni::graph::core::IConstBundle2_abi>::getAttributeNamesAndTypes(
    omni::graph::core::NameToken* const names, omni::graph::core::Type* const types, size_t* const nameAndTypeCount) noexcept
{
    return getAttributeNamesAndTypes_abi(names, types, nameAndTypeCount);
}

inline omni::core::Result omni::core::Generated<omni::graph::core::IConstBundle2_abi>::getConstAttributes(
    omni::graph::core::ConstAttributeDataHandle* const attributes, size_t* const attributeCount) noexcept
{
    return getConstAttributes_abi(attributes, attributeCount);
}

inline omni::core::Result omni::core::Generated<omni::graph::core::IConstBundle2_abi>::getConstAttributesByName(
    const omni::graph::core::NameToken* const names,
    size_t nameCount,
    omni::graph::core::ConstAttributeDataHandle* const attributes) noexcept
{
    return getConstAttributesByName_abi(names, nameCount, attributes);
}

inline omni::core::Result omni::core::Generated<omni::graph::core::IConstBundle2_abi>::getConstChildBundles(
    omni::graph::core::ConstBundleHandle* const bundles, size_t* const bundleCount) noexcept
{
    return getConstChildBundles_abi(bundles, bundleCount);
}

inline omni::core::Result omni::core::Generated<omni::graph::core::IConstBundle2_abi>::getConstChildBundle(
    size_t bundleIndex, omni::graph::core::ConstBundleHandle* const bundle) noexcept
{
    return getConstChildBundle_abi(bundleIndex, bundle);
}

inline omni::core::Result omni::core::Generated<omni::graph::core::IConstBundle2_abi>::getConstChildBundlesByName(
    const omni::graph::core::NameToken* const names,
    size_t nameCount,
    omni::graph::core::ConstBundleHandle* const foundBundles) noexcept
{
    return getConstChildBundlesByName_abi(names, nameCount, foundBundles);
}

inline omni::graph::core::ConstBundleHandle omni::core::Generated<
    omni::graph::core::IConstBundle2_abi>::getConstMetadataStorage() noexcept
{
    return getConstMetadataStorage_abi();
}

inline omni::core::Result omni::core::Generated<omni::graph::core::IConstBundle2_abi>::getBundleMetadataNamesAndTypes(
    omni::graph::core::NameToken* const fieldNames, omni::graph::core::Type* const fieldTypes, size_t* const fieldCount) noexcept
{
    return getBundleMetadataNamesAndTypes_abi(fieldNames, fieldTypes, fieldCount);
}

inline omni::core::Result omni::core::Generated<omni::graph::core::IConstBundle2_abi>::getConstBundleMetadataByName(
    const omni::graph::core::NameToken* const fieldNames,
    size_t fieldCount,
    omni::graph::core::ConstAttributeDataHandle* const bundleMetadata) noexcept
{
    return getConstBundleMetadataByName_abi(fieldNames, fieldCount, bundleMetadata);
}

inline omni::core::Result omni::core::Generated<omni::graph::core::IConstBundle2_abi>::getAttributeMetadataNamesAndTypes(
    omni::graph::core::NameToken attribute,
    omni::graph::core::NameToken* const fieldNames,
    omni::graph::core::Type* const fieldTypes,
    size_t* const fieldCount) noexcept
{
    return getAttributeMetadataNamesAndTypes_abi(attribute, fieldNames, fieldTypes, fieldCount);
}

inline omni::core::Result omni::core::Generated<omni::graph::core::IConstBundle2_abi>::getConstAttributeMetadataByName(
    omni::graph::core::NameToken attribute,
    const omni::graph::core::NameToken* const fieldNames,
    size_t fieldCount,
    omni::graph::core::ConstAttributeDataHandle* const attributeMetadata) noexcept
{
    return getConstAttributeMetadataByName_abi(attribute, fieldNames, fieldCount, attributeMetadata);
}

#endif

#undef OMNI_BIND_INCLUDE_INTERFACE_DECL
#undef OMNI_BIND_INCLUDE_INTERFACE_IMPL
