Program Listing for carb/Interface.h

↰ Return to documentation for carb/Interface.h

// Copyright (c) 2018-2021, 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.
//

#pragma once

#include "Version.h"

namespace carb
{
struct InterfaceDesc
{
    const char* name = nullptr;
    Version version = { 0, 0 };
};
} // namespace carb

#define CARB_PLUGIN_INTERFACE(name, major, minor)                                                                      \
                                                                                                                \
    static carb::InterfaceDesc getInterfaceDesc()                                                                      \
    {                                                                                                                  \
        return carb::InterfaceDesc{ name, { major, minor } };                                                          \
    }

// note that this needs to be included last to avoid a circular include dependency in
// 'carb/Defines.h'.  A lot of source files and tests depend on 'carb/Interface.h'
// also pulling in 'carb/Defines.h'.  Since nothing here strictly requires 'Defines.h',
// we'll just defer it's include until everything else useful in here has been defined.
#include "Defines.h"