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


//! Read-only object to encapsulate a channel filter's pattern and effects.
//!
//! A channel filter is a pattern matcher.  If a channel's name matches the pattern, the filter can set both the
//! channel's enabled flag and/or level.
template <>
class omni::core::Generated<omni::log::ILogChannelFilter_abi> : public omni::log::ILogChannelFilter_abi
{
public:
    OMNI_PLUGIN_INTERFACE("omni::log::ILogChannelFilter")

    //! Returns the channels pattern.  The returned memory is valid for the lifetime of this object.
    //!
    //! This method is thread safe.
    const char* getFilter() noexcept;

    //! Returns the desired enabled state for this filter.
    //!
    //! All parameters must not be nullptr.
    //!
    //! If *isUsed is false after calling this method, *isEnabled and *behavior should not be used.
    //!
    //! This method is thread safe.
    void getEnabled(bool* isEnabled, omni::log::SettingBehavior* behavior, bool* isUsed) noexcept;

    //! Returns the desired level for this filter.
    //!
    //! All parameters must not be nullptr.
    //!
    //! If *isUsed is false after calling this method, *level and *behavior should not be used.
    //!
    //! This method is thread safe.
    void getLevel(omni::log::Level* level, omni::log::SettingBehavior* behavior, bool* isUsed) noexcept;

    //! Given a channel name, returns if the channel name matches the filter's pattern.
    //!
    //! The matching algorithm used is implementation specific (e.g. regex, glob, etc).
    //!
    //! This method is thread safe.
    bool isMatch(const char* channel) noexcept;
};

#endif

#ifndef OMNI_BIND_INCLUDE_INTERFACE_DECL

inline const char* omni::core::Generated<omni::log::ILogChannelFilter_abi>::getFilter() noexcept
{
    return getFilter_abi();
}

inline void omni::core::Generated<omni::log::ILogChannelFilter_abi>::getEnabled(bool* isEnabled,
                                                                                omni::log::SettingBehavior* behavior,
                                                                                bool* isUsed) noexcept
{
    getEnabled_abi(isEnabled, behavior, isUsed);
}

inline void omni::core::Generated<omni::log::ILogChannelFilter_abi>::getLevel(omni::log::Level* level,
                                                                              omni::log::SettingBehavior* behavior,
                                                                              bool* isUsed) noexcept
{
    getLevel_abi(level, behavior, isUsed);
}

inline bool omni::core::Generated<omni::log::ILogChannelFilter_abi>::isMatch(const char* channel) noexcept
{
    return isMatch_abi(channel);
}

#endif

#undef OMNI_BIND_INCLUDE_INTERFACE_DECL
#undef OMNI_BIND_INCLUDE_INTERFACE_IMPL
