// Copyright (c) 2021-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 to the list of categories that a node type can belong to */
template <>
class omni::core::Generated<omni::graph::core::INodeCategories_abi> : public omni::graph::core::INodeCategories_abi
{
public:
    OMNI_PLUGIN_INTERFACE("omni::graph::core::INodeCategories")

    /**
     * Get the number of categories available
     *
     * @returns Count of fixed category types
     */
    size_t getCategoryCount() noexcept;

    /**
     * Get the list of available categories and their descriptions.
     *
     * The caller is responsible for allocating and destroying buffers large enough to hold "bufferSize" results.
     * If bufferSize > getCategoryCount() then the entries at the ends of the buffers will be filled with nullptr.
     *
     * @param[in] categoryNameBuffer List of category names
     * @param[in] categoryDescriptionBuffer List of category descriptions corresponding to the names
     * @param[in] bufferSize Number of entries to fill in the buffers
     *
     * @return true if the category buffer was successfully filled and the bufferSize matched the category count
     */
    bool getCategories(const char** categoryNameBuffer, const char** categoryDescriptionBuffer, size_t bufferSize) noexcept;

    /**
     * Define a new category
     *
     * @param[in] categoryName Name of the new category
     * @param[in] categoryDescription Description of the category
     *
     * @return false if there was already a category with the given name
     */
    bool defineCategory(const char* categoryName, const char* categoryDescription) noexcept;

    /**
     * Remove an existing category, mainly to manage the ones created by a node type for itself
     *
     * @param[in] categoryName Name of the category to remove
     *
     * @return false if there was no category with the given name
     */
    bool removeCategory(const char* categoryName) noexcept;
};

#endif

#ifndef OMNI_BIND_INCLUDE_INTERFACE_DECL

inline size_t omni::core::Generated<omni::graph::core::INodeCategories_abi>::getCategoryCount() noexcept
{
    return getCategoryCount_abi();
}

inline bool omni::core::Generated<omni::graph::core::INodeCategories_abi>::getCategories(
    const char** categoryNameBuffer, const char** categoryDescriptionBuffer, size_t bufferSize) noexcept
{
    return getCategories_abi(categoryNameBuffer, categoryDescriptionBuffer, bufferSize);
}

inline bool omni::core::Generated<omni::graph::core::INodeCategories_abi>::defineCategory(
    const char* categoryName, const char* categoryDescription) noexcept
{
    return defineCategory_abi(categoryName, categoryDescription);
}

inline bool omni::core::Generated<omni::graph::core::INodeCategories_abi>::removeCategory(const char* categoryName) noexcept
{
    return removeCategory_abi(categoryName);
}

#endif

#undef OMNI_BIND_INCLUDE_INTERFACE_DECL
#undef OMNI_BIND_INCLUDE_INTERFACE_IMPL
