// Copyright (c) 2021-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 <omni/core/ResultError.h>

#include <functional>
#include <type_traits>
#include <utility>

#ifndef OMNI_BIND_INCLUDE_INTERFACE_IMPL


//! Base class for object inspection requests.
template <>
class omni::core::Generated<omni::inspect::IInspectMemoryUse_abi> : public omni::inspect::IInspectMemoryUse_abi
{
public:
    OMNI_PLUGIN_INTERFACE("omni::inspect::IInspectMemoryUse")

    /** Add a block of used memory
     * Returns false if the memory was not recorded (e.g. because it was already recorded)
     *
     * @param[in] ptr Pointer to the memory location being logged as in-use
     * @param[in] bytesUsed Number of bytes in use at that location
     */
    bool useMemory(const void* ptr, size_t bytesUsed) noexcept;

    /** Reset the memory usage data to a zero state
     */
    void reset() noexcept;

    /** @returns the total number of bytes of memory used since creation or the last call to reset().
     */
    size_t totalUsed() noexcept;
};

#endif

#ifndef OMNI_BIND_INCLUDE_INTERFACE_DECL

inline bool omni::core::Generated<omni::inspect::IInspectMemoryUse_abi>::useMemory(const void* ptr,
                                                                                   size_t bytesUsed) noexcept
{
    return useMemory_abi(ptr, bytesUsed);
}

inline void omni::core::Generated<omni::inspect::IInspectMemoryUse_abi>::reset() noexcept
{
    reset_abi();
}

inline size_t omni::core::Generated<omni::inspect::IInspectMemoryUse_abi>::totalUsed() noexcept
{
    return totalUsed_abi();
}

#endif

#undef OMNI_BIND_INCLUDE_INTERFACE_DECL
#undef OMNI_BIND_INCLUDE_INTERFACE_IMPL
