carb/Interface.h
File members: carb/Interface.h
// Copyright (c) 2018-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.
//
#pragma once
#include "Version.h"
#include <type_traits>
namespace carb
{
struct InterfaceDesc
{
const char* name = nullptr;
Version version = { 0, 0 };
};
static_assert(std::is_standard_layout<InterfaceDesc>::value, "Invalid assumption");
} // namespace carb
#define CARB_PLUGIN_INTERFACE(name, major, minor) \
\
static constexpr 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"