carb/variant/IVariant.h

File members: carb/variant/IVariant.h

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

#pragma once

#include "../Interface.h"
#include "VariantTypes.h"

namespace carb
{

namespace variant
{

struct IVariant
{
    CARB_PLUGIN_INTERFACE("carb::variant::IVariant", 0, 1)

    const VTable*(CARB_ABI* getVTable)(RString type) noexcept;

    bool(CARB_ABI* registerType)(const VTable* vtable) noexcept;

    bool(CARB_ABI* unregisterType)(RString type) noexcept;

    VariantArray*(CARB_ABI* internalCreateArray)(const Variant* p, size_t count);

    CARB_NODISCARD VariantArrayPtr createArray(const Variant* p = nullptr, size_t count = 0);

    VariantMap*(CARB_ABI* internalCreateMap)();

    CARB_NODISCARD VariantMapPtr createMap();
};

} // namespace variant
} // namespace carb

#include "IVariant.inl"