// 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/OmniAttr.h>
#include <omni/core/Interface.h>
#include <omni/core/ResultError.h>

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

#ifndef OMNI_BIND_INCLUDE_INTERFACE_IMPL


/** Interface to collect and retrieve information about the operating system. */
template <>
class omni::core::Generated<omni::platforminfo::IOsInfo_abi> : public omni::platforminfo::IOsInfo_abi
{
public:
    OMNI_PLUGIN_INTERFACE("omni::platforminfo::IOsInfo")

    /** Retrieves the processor architecture for this platform.
     *
     *  @returns An architecture name.  This will never be
     *           @ref omni::platforminfo::Architecture::eUnknown.
     *
     *  @thread_safety This call is thread safe.
     */
    omni::platforminfo::Architecture getArchitecture() noexcept;

    /** Retrieves an identifier for the current platform.
     *
     *  @returns An operating system name.  This will never be
     *           @ref omni::platforminfo::Os::eUnknown.
     *
     *  @thread_safety This call is thread safe.
     */
    omni::platforminfo::Os getOs() noexcept;

    /** Retrieves the OS version information.
     *
     *  @returns The operating system version numbers.  These will be retrieved from the system
     *           as directly as possible.  If possible, these will not be parsed from a string
     *           version of the operating system's name.
     *
     *  @thread_safety This call is thread safe.
     */
    omni::platforminfo::OsVersion getOsVersion() noexcept;

    /** Retrieves the name and version information for the system compositor.
     *
     *  @returns An object describing the active compositor.
     *
     *  @thread_safety This call is thread safe.
     */
    omni::platforminfo::CompositorInfo getCompositorInfo() noexcept;

    /** Retrieves the friendly printable name of the operating system.
     *
     *  @returns A string describing the operating system.  This is retrieved from the system and
     *           does not necessarily follow any specific formatting.  This may or may not contain
     *           specific version information.  This string is intended for display to users.
     *
     *  @thread_safety This call is thread safe.
     */
    const char* getPrettyName() noexcept;

    /** Retrieves the name of the operating system.
     *
     *  @returns A string describing the operating system.  This is retrieved from the system if
     *           possible and does not necessarily follow any specific formatting.  This may
     *           include different information than the 'pretty' name (though still identifying
     *           the same operating system version).  This string is more intended for logging
     *           or parsing purposes than display to the user.
     *
     *  @thread_safety This call is thread safe.
     */
    const char* getName() noexcept;

    /** Retrieves the operating system distribution name.
     *
     *  @returns The operating system distribution name.  For Windows 10 and up, this often
     *           contains the build's version name (ie: v1909).  For Linux, this contains the
     *           distro name (ie: "Ubuntu", "Gentoo", etc).
     *
     *  @thread_safety This call is thread safe.
     */
    const char* getDistroName() noexcept;

    /** Retrieves the operating system's build code name.
     *
     *  @returns The code name of the operating system's current version.  For Windows 10 and up,
     *           this is the Microsoft internal code name for each release (ie: "RedStone 5",
     *           "21H2", etc).  If possible it will be retrieved from the system.  If not
     *           available, a best guess will be made based on the build version number.  For
     *           Linux, this will be the build name of the current installed version (ie:
     *           "Bionic", "Xenial", etc).
     *
     *  @thread_safety This call is thread safe.
     */
    const char* getCodeName() noexcept;

    /** Retrieves the operating system's kernel version as a string.
     *
     *  @returns A string containing the OS's kernel version information.  There is no standard
     *           layout for a kernel version across platforms so this isn't split up into a
     *           struct of numeric values.  For example, Linux kernel versions often contain
     *           major-minor-hotfix-build_number-string components whereas Mac OS is typically
     *           just major-minor-hotfix.  Windows kernel versions are also often four values.
     *           This is strictly for informational purposes.  Splitting this up into numerical
     *           components is left as an exercise for the caller if needed.
     */
    const char* getKernelVersion() noexcept;
};

#endif

#ifndef OMNI_BIND_INCLUDE_INTERFACE_DECL

inline omni::platforminfo::Architecture omni::core::Generated<omni::platforminfo::IOsInfo_abi>::getArchitecture() noexcept
{
    return getArchitecture_abi();
}

inline omni::platforminfo::Os omni::core::Generated<omni::platforminfo::IOsInfo_abi>::getOs() noexcept
{
    return getOs_abi();
}

inline omni::platforminfo::OsVersion omni::core::Generated<omni::platforminfo::IOsInfo_abi>::getOsVersion() noexcept
{
    return getOsVersion_abi();
}

inline omni::platforminfo::CompositorInfo omni::core::Generated<omni::platforminfo::IOsInfo_abi>::getCompositorInfo() noexcept
{
    return getCompositorInfo_abi();
}

inline const char* omni::core::Generated<omni::platforminfo::IOsInfo_abi>::getPrettyName() noexcept
{
    return getPrettyName_abi();
}

inline const char* omni::core::Generated<omni::platforminfo::IOsInfo_abi>::getName() noexcept
{
    return getName_abi();
}

inline const char* omni::core::Generated<omni::platforminfo::IOsInfo_abi>::getDistroName() noexcept
{
    return getDistroName_abi();
}

inline const char* omni::core::Generated<omni::platforminfo::IOsInfo_abi>::getCodeName() noexcept
{
    return getCodeName_abi();
}

inline const char* omni::core::Generated<omni::platforminfo::IOsInfo_abi>::getKernelVersion() noexcept
{
    return getKernelVersion_abi();
}

#endif

#undef OMNI_BIND_INCLUDE_INTERFACE_DECL
#undef OMNI_BIND_INCLUDE_INTERFACE_IMPL
static_assert(std::is_standard_layout<omni::platforminfo::OsVersion>::value,
              "omni::platforminfo::OsVersion must be standard layout to be used in ONI ABI");
static_assert(std::is_standard_layout<omni::platforminfo::CompositorInfo>::value,
              "omni::platforminfo::CompositorInfo must be standard layout to be used in ONI ABI");
