Refactoring Reference #1
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: OFF) (push) Failing after 5m34s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: ON) (push) Failing after 5m5s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Failing after 5m6s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Failing after 5m5s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: OFF) (push) Failing after 5m3s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: ON) (push) Failing after 5m6s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Failing after 5m11s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Failing after 5m4s
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: OFF) (push) Failing after 5m8s
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: ON) (push) Failing after 5m4s
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Failing after 5m7s
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Failing after 5m5s
Bigfoot / Clang Format Checks (push) Failing after 1m44s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: OFF) (push) Failing after 5m34s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: ON) (push) Failing after 5m5s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Failing after 5m6s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Failing after 5m5s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: OFF) (push) Failing after 5m3s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: ON) (push) Failing after 5m6s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Failing after 5m11s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Failing after 5m4s
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: OFF) (push) Failing after 5m8s
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: ON) (push) Failing after 5m4s
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Failing after 5m7s
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Failing after 5m5s
Bigfoot / Clang Format Checks (push) Failing after 1m44s
This commit is contained in:
@@ -7,7 +7,6 @@
|
|||||||
#ifndef BIGFOOT_ENGINE_ASSET_ASSET_HPP
|
#ifndef BIGFOOT_ENGINE_ASSET_ASSET_HPP
|
||||||
#define BIGFOOT_ENGINE_ASSET_ASSET_HPP
|
#define BIGFOOT_ENGINE_ASSET_ASSET_HPP
|
||||||
#include <Engine/Asset/Asset_generated.hpp>
|
#include <Engine/Asset/Asset_generated.hpp>
|
||||||
#include <Engine/Asset/Reference_generated.hpp>
|
|
||||||
#include <Engine/EngineAssertHandler.hpp>
|
#include <Engine/EngineAssertHandler.hpp>
|
||||||
|
|
||||||
#include <EASTL/span.h>
|
#include <EASTL/span.h>
|
||||||
@@ -25,6 +24,8 @@ class Asset
|
|||||||
using FLAT_ASSET = typename ASSET::FLAT;
|
using FLAT_ASSET = typename ASSET::FLAT;
|
||||||
|
|
||||||
Asset():
|
Asset():
|
||||||
|
m_hardRefCount(0),
|
||||||
|
m_softRefCount(0),
|
||||||
m_header(::Flat::Bigfoot::AssetHeaderT {.uuid = UUID {},
|
m_header(::Flat::Bigfoot::AssetHeaderT {.uuid = UUID {},
|
||||||
.name = eastl::string {},
|
.name = eastl::string {},
|
||||||
.type_id = GetTypeID(),
|
.type_id = GetTypeID(),
|
||||||
@@ -59,6 +60,38 @@ class Asset
|
|||||||
|
|
||||||
~Asset() = default;
|
~Asset() = default;
|
||||||
|
|
||||||
|
void IncrementHardRefCount()
|
||||||
|
{
|
||||||
|
m_hardRefCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DecrementHardRefCount()
|
||||||
|
{
|
||||||
|
m_hardRefCount--;
|
||||||
|
}
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
|
std::uint32_t GetHardRefCount() const
|
||||||
|
{
|
||||||
|
return m_hardRefCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
void IncrementSoftRefCount()
|
||||||
|
{
|
||||||
|
m_softRefCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DecrementSoftRefCount()
|
||||||
|
{
|
||||||
|
m_hardRefCount--;
|
||||||
|
}
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
|
std::uint32_t GetSoftRefCount() const
|
||||||
|
{
|
||||||
|
return m_softRefCount;
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
const ::Flat::Bigfoot::AssetHeaderT& GetHeader() const
|
const ::Flat::Bigfoot::AssetHeaderT& GetHeader() const
|
||||||
{
|
{
|
||||||
@@ -123,6 +156,9 @@ class Asset
|
|||||||
Asset& operator=(Asset&& p_asset) = default;
|
Asset& operator=(Asset&& p_asset) = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
std::uint32_t m_hardRefCount;
|
||||||
|
std::uint32_t m_softRefCount;
|
||||||
|
|
||||||
::Flat::Bigfoot::AssetHeaderT m_header;
|
::Flat::Bigfoot::AssetHeaderT m_header;
|
||||||
typename FLAT_ASSET::NativeTableType m_asset;
|
typename FLAT_ASSET::NativeTableType m_asset;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,65 +8,11 @@
|
|||||||
#define BIGFOOT_ENGINE_ASSET_ASSETHELPER_HPP
|
#define BIGFOOT_ENGINE_ASSET_ASSETHELPER_HPP
|
||||||
#include <Engine/Asset/AssetContainer.hpp>
|
#include <Engine/Asset/AssetContainer.hpp>
|
||||||
#include <Engine/Asset/AssetLibrary.hpp>
|
#include <Engine/Asset/AssetLibrary.hpp>
|
||||||
#include <Engine/Asset/Reference.hpp>
|
|
||||||
#include <Engine/Asset/Reference_generated.hpp>
|
|
||||||
|
|
||||||
#define ASSET_SOFT_REF_DECL(AssetName, AssetType) \
|
#define ASSET_CONTAINER(AssetName, AssetType) \
|
||||||
namespace flatbuffers \
|
|
||||||
{ \
|
|
||||||
Flat::Bigfoot::SoftReference PackSoftReference##AssetName(const Bigfoot::SoftReference<AssetType>& p_softRef); \
|
|
||||||
Bigfoot::SoftReference<AssetType> UnPackSoftReference##AssetName(const Flat::Bigfoot::SoftReference& p_softRef); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ASSET_HARD_REF_DECL(AssetName, AssetType) \
|
|
||||||
namespace flatbuffers \
|
|
||||||
{ \
|
|
||||||
Flat::Bigfoot::HardReference PackHardReference##AssetName(const Bigfoot::HardReference<AssetType>& p_hardRef); \
|
|
||||||
Bigfoot::HardReference<AssetType> UnPackHardReference##AssetName(const Flat::Bigfoot::HardReference& p_hardRef); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ASSET_REF_DECL(AssetName, AssetType) \
|
|
||||||
ASSET_SOFT_REF_DECL(AssetName, AssetType) \
|
|
||||||
ASSET_HARD_REF_DECL(AssetName, AssetType)
|
|
||||||
|
|
||||||
/****************************************************************************************/
|
|
||||||
|
|
||||||
#define ASSET_SOFT_REF_IMPL(AssetName, AssetType) \
|
|
||||||
namespace flatbuffers \
|
|
||||||
{ \
|
|
||||||
Flat::Bigfoot::SoftReference PackSoftReference##AssetName(const Bigfoot::SoftReference<AssetType>& p_softRef) \
|
|
||||||
{ \
|
|
||||||
return {flatbuffers::Pack(p_softRef.GetUUID())}; \
|
|
||||||
} \
|
|
||||||
Bigfoot::SoftReference<AssetType> UnPackSoftReference##AssetName(const Flat::Bigfoot::SoftReference& p_softRef) \
|
|
||||||
{ \
|
|
||||||
return {flatbuffers::UnPack(p_softRef.uuid())}; \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ASSET_HARD_REF_IMPL(AssetName, AssetType) \
|
|
||||||
namespace flatbuffers \
|
|
||||||
{ \
|
|
||||||
Flat::Bigfoot::HardReference PackHardReference##AssetName(const Bigfoot::HardReference<AssetType>& p_hardRef) \
|
|
||||||
{ \
|
|
||||||
return {flatbuffers::Pack(p_hardRef.GetUUID())}; \
|
|
||||||
} \
|
|
||||||
Bigfoot::HardReference<AssetType> UnPackHardReference##AssetName(const Flat::Bigfoot::HardReference& p_hardRef) \
|
|
||||||
{ \
|
|
||||||
return {flatbuffers::UnPack(p_hardRef.uuid())}; \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ASSET_REF_IMPL(AssetName, AssetType) \
|
|
||||||
ASSET_SOFT_REF_IMPL(AssetName, AssetType) \
|
|
||||||
ASSET_HARD_REF_IMPL(AssetName, AssetType)
|
|
||||||
|
|
||||||
/****************************************************************************************/
|
|
||||||
|
|
||||||
#define ASSET_CONTAINER(AssetType) \
|
|
||||||
namespace Bigfoot \
|
namespace Bigfoot \
|
||||||
{ \
|
{ \
|
||||||
AssetContainer<AssetType> g_containerFor##AssetType; \
|
AssetContainer<AssetType> g_containerFor##AssetName; \
|
||||||
const bool g_insertedContainerFor##AssetType = g_assetLibrary.Insert(&g_containerFor##AssetType); \
|
const bool g_insertedContainerFor##AssetName = g_assetLibrary.Insert(&g_containerFor##AssetName); \
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
native_include "Engine/Asset/Reference.hpp";
|
|
||||||
|
|
||||||
include "System/UUID/UUID.fbs";
|
|
||||||
|
|
||||||
namespace Flat.Bigfoot;
|
|
||||||
|
|
||||||
struct HardReference
|
|
||||||
{
|
|
||||||
uuid:UUID;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct SoftReference
|
|
||||||
{
|
|
||||||
uuid:UUID;
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
#ifndef BIGFOOT_ENGINE_ASSET_REFERENCE_HPP
|
#ifndef BIGFOOT_ENGINE_ASSET_REFERENCE_HPP
|
||||||
#define BIGFOOT_ENGINE_ASSET_REFERENCE_HPP
|
#define BIGFOOT_ENGINE_ASSET_REFERENCE_HPP
|
||||||
#include <Engine/Asset/AssetContainer.hpp>
|
#include <Engine/Asset/AssetLibrary.hpp>
|
||||||
|
|
||||||
#include <System/UUID/UUID.hpp>
|
#include <System/UUID/UUID.hpp>
|
||||||
|
|
||||||
@@ -27,13 +27,15 @@ class HardReference
|
|||||||
}
|
}
|
||||||
|
|
||||||
HardReference(const HardReference& p_ref):
|
HardReference(const HardReference& p_ref):
|
||||||
m_uuid(p_ref.m_uuid)
|
m_uuid(p_ref.m_uuid),
|
||||||
|
m_slotKey(p_ref.m_slotKey)
|
||||||
{
|
{
|
||||||
Acquire();
|
Acquire();
|
||||||
}
|
}
|
||||||
|
|
||||||
HardReference(HardReference&& p_ref) noexcept:
|
HardReference(HardReference&& p_ref) noexcept:
|
||||||
m_uuid(std::exchange(p_ref.m_uuid, UUID::NULL_UUID))
|
m_uuid(std::exchange(p_ref.m_uuid, UUID::NULL_UUID)),
|
||||||
|
m_slotKey(std::exchange(p_ref.m_slotKey, typename SlotMap<ASSET>::SlotKey {}))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,6 +56,7 @@ class HardReference
|
|||||||
{
|
{
|
||||||
Release();
|
Release();
|
||||||
m_uuid = p_ref.m_uuid;
|
m_uuid = p_ref.m_uuid;
|
||||||
|
m_slotKey = p_ref.m_slotKey;
|
||||||
Acquire();
|
Acquire();
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
@@ -65,6 +68,7 @@ class HardReference
|
|||||||
{
|
{
|
||||||
Release();
|
Release();
|
||||||
m_uuid = std::exchange(p_ref.m_uuid, UUID::NULL_UUID);
|
m_uuid = std::exchange(p_ref.m_uuid, UUID::NULL_UUID);
|
||||||
|
std::exchange(p_ref.m_slotKey, typename SlotMap<ASSET>::SlotKey {});
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -78,21 +82,34 @@ class HardReference
|
|||||||
private:
|
private:
|
||||||
void Acquire()
|
void Acquire()
|
||||||
{
|
{
|
||||||
if (m_uuid)
|
if (AssetContainer<ASSET>* assetContainer = g_assetLibrary.Get<ASSET>() ; assetContainer && m_uuid)
|
||||||
{
|
{
|
||||||
// AssetContainer<ASSET>::Get().IncrementHardRefCount(m_uuid);
|
if (!m_slotKey.Valid())
|
||||||
|
{
|
||||||
|
m_slotKey = assetContainer->GetSlotKey(m_uuid);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ASSET* asset = assetContainer->Get(m_slotKey))
|
||||||
|
{
|
||||||
|
asset->IncrementHardRefCount();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Release()
|
void Release()
|
||||||
{
|
{
|
||||||
if (m_uuid)
|
if (AssetContainer<ASSET>* assetContainer = g_assetLibrary.Get<ASSET>(); assetContainer && m_uuid)
|
||||||
{
|
{
|
||||||
// AssetContainer<ASSET>::Get().DecrementHardRefCount(m_uuid);
|
// Acquire always happens before Release, so slot key should be valid
|
||||||
|
if (ASSET* asset = assetContainer->Get(m_slotKey))
|
||||||
|
{
|
||||||
|
asset->IncrementHardRefCount();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UUID m_uuid = UUID::NULL_UUID;
|
UUID m_uuid = UUID::NULL_UUID;
|
||||||
|
typename SlotMap<ASSET>::SlotKey m_slotKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class ASSET>
|
template<class ASSET>
|
||||||
@@ -108,13 +125,15 @@ class SoftReference
|
|||||||
}
|
}
|
||||||
|
|
||||||
SoftReference(const SoftReference& p_ref):
|
SoftReference(const SoftReference& p_ref):
|
||||||
m_uuid(p_ref.m_uuid)
|
m_uuid(p_ref.m_uuid),
|
||||||
|
m_slotKey(p_ref.m_slotKey)
|
||||||
{
|
{
|
||||||
Acquire();
|
Acquire();
|
||||||
}
|
}
|
||||||
|
|
||||||
SoftReference(SoftReference&& p_ref) noexcept:
|
SoftReference(SoftReference&& p_ref) noexcept:
|
||||||
m_uuid(std::exchange(p_ref.m_uuid, UUID::NULL_UUID))
|
m_uuid(std::exchange(p_ref.m_uuid, UUID::NULL_UUID)),
|
||||||
|
m_slotKey(std::exchange(p_ref.m_slotKey, typename SlotMap<ASSET>::SlotKey {}))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,6 +154,7 @@ class SoftReference
|
|||||||
{
|
{
|
||||||
Release();
|
Release();
|
||||||
m_uuid = p_ref.m_uuid;
|
m_uuid = p_ref.m_uuid;
|
||||||
|
m_slotKey = p_ref.m_slotKey;
|
||||||
Acquire();
|
Acquire();
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
@@ -146,6 +166,7 @@ class SoftReference
|
|||||||
{
|
{
|
||||||
Release();
|
Release();
|
||||||
m_uuid = std::exchange(p_ref.m_uuid, UUID::NULL_UUID);
|
m_uuid = std::exchange(p_ref.m_uuid, UUID::NULL_UUID);
|
||||||
|
m_slotKey = std::exchange(p_ref.m_slotKey, typename SlotMap<ASSET>::SlotKey {});
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -159,21 +180,34 @@ class SoftReference
|
|||||||
private:
|
private:
|
||||||
void Acquire()
|
void Acquire()
|
||||||
{
|
{
|
||||||
if (m_uuid)
|
if (AssetContainer<ASSET>* assetContainer = g_assetLibrary.Get<ASSET>(); assetContainer && m_uuid)
|
||||||
{
|
{
|
||||||
// AssetContainer<ASSET>::Get().IncrementSoftRefCount(m_uuid);
|
if (!m_slotKey.Valid())
|
||||||
|
{
|
||||||
|
m_slotKey = assetContainer->GetSlotKey(m_uuid);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ASSET* asset = assetContainer->Get(m_slotKey))
|
||||||
|
{
|
||||||
|
asset->IncrementSoftRefCount();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Release()
|
void Release()
|
||||||
{
|
{
|
||||||
if (m_uuid)
|
if (AssetContainer<ASSET>* assetContainer = g_assetLibrary.Get<ASSET>(); assetContainer && m_uuid)
|
||||||
{
|
{
|
||||||
// AssetContainer<ASSET>::Get().DecrementSoftRefCount(m_uuid);
|
// Acquire always happens before Release, so slot key should be valid
|
||||||
|
if (ASSET* asset = assetContainer->Get(m_slotKey))
|
||||||
|
{
|
||||||
|
asset->DecrementSoftRefCount();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UUID m_uuid = UUID::NULL_UUID;
|
UUID m_uuid = UUID::NULL_UUID;
|
||||||
|
typename SlotMap<ASSET>::SlotKey m_slotKey;
|
||||||
};
|
};
|
||||||
} // namespace Bigfoot
|
} // namespace Bigfoot
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,123 +0,0 @@
|
|||||||
// automatically generated by the FlatBuffers compiler, do not modify
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef FLATBUFFERS_GENERATED_REFERENCE_FLAT_BIGFOOT_H_
|
|
||||||
#define FLATBUFFERS_GENERATED_REFERENCE_FLAT_BIGFOOT_H_
|
|
||||||
|
|
||||||
#include "flatbuffers/flatbuffers.h"
|
|
||||||
|
|
||||||
// Ensure the included flatbuffers.h is the same version as when this file was
|
|
||||||
// generated, otherwise it may not be compatible.
|
|
||||||
static_assert(FLATBUFFERS_VERSION_MAJOR == 25 &&
|
|
||||||
FLATBUFFERS_VERSION_MINOR == 12 &&
|
|
||||||
FLATBUFFERS_VERSION_REVISION == 19,
|
|
||||||
"Non-compatible flatbuffers version included");
|
|
||||||
|
|
||||||
#include "Engine/Asset/Reference.hpp"
|
|
||||||
#include "System/UUID/UUID.hpp"
|
|
||||||
#include "Engine/Asset/Reference.hpp"
|
|
||||||
#include "System/UUID/UUID_generated.hpp"
|
|
||||||
|
|
||||||
#include "EASTL/unique_ptr.h"
|
|
||||||
#include "EASTL/string.h"
|
|
||||||
#include "EASTL/vector.h"
|
|
||||||
|
|
||||||
namespace Flat {
|
|
||||||
namespace Bigfoot {
|
|
||||||
|
|
||||||
struct HardReference;
|
|
||||||
|
|
||||||
struct SoftReference;
|
|
||||||
|
|
||||||
inline const ::flatbuffers::TypeTable *HardReferenceTypeTable();
|
|
||||||
|
|
||||||
inline const ::flatbuffers::TypeTable *SoftReferenceTypeTable();
|
|
||||||
|
|
||||||
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) HardReference FLATBUFFERS_FINAL_CLASS {
|
|
||||||
private:
|
|
||||||
Flat::Bigfoot::UUID uuid_;
|
|
||||||
|
|
||||||
public:
|
|
||||||
struct Traits;
|
|
||||||
static const ::flatbuffers::TypeTable *MiniReflectTypeTable() {
|
|
||||||
return HardReferenceTypeTable();
|
|
||||||
}
|
|
||||||
static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() {
|
|
||||||
return "Flat.Bigfoot.HardReference";
|
|
||||||
}
|
|
||||||
HardReference()
|
|
||||||
: uuid_() {
|
|
||||||
}
|
|
||||||
HardReference(const Flat::Bigfoot::UUID &_uuid)
|
|
||||||
: uuid_(_uuid) {
|
|
||||||
}
|
|
||||||
const Flat::Bigfoot::UUID &uuid() const {
|
|
||||||
return uuid_;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
FLATBUFFERS_STRUCT_END(HardReference, 16);
|
|
||||||
|
|
||||||
struct HardReference::Traits {
|
|
||||||
using type = HardReference;
|
|
||||||
};
|
|
||||||
|
|
||||||
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(1) SoftReference FLATBUFFERS_FINAL_CLASS {
|
|
||||||
private:
|
|
||||||
Flat::Bigfoot::UUID uuid_;
|
|
||||||
|
|
||||||
public:
|
|
||||||
struct Traits;
|
|
||||||
static const ::flatbuffers::TypeTable *MiniReflectTypeTable() {
|
|
||||||
return SoftReferenceTypeTable();
|
|
||||||
}
|
|
||||||
static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() {
|
|
||||||
return "Flat.Bigfoot.SoftReference";
|
|
||||||
}
|
|
||||||
SoftReference()
|
|
||||||
: uuid_() {
|
|
||||||
}
|
|
||||||
SoftReference(const Flat::Bigfoot::UUID &_uuid)
|
|
||||||
: uuid_(_uuid) {
|
|
||||||
}
|
|
||||||
const Flat::Bigfoot::UUID &uuid() const {
|
|
||||||
return uuid_;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
FLATBUFFERS_STRUCT_END(SoftReference, 16);
|
|
||||||
|
|
||||||
struct SoftReference::Traits {
|
|
||||||
using type = SoftReference;
|
|
||||||
};
|
|
||||||
|
|
||||||
inline const ::flatbuffers::TypeTable *HardReferenceTypeTable() {
|
|
||||||
static const ::flatbuffers::TypeCode type_codes[] = {
|
|
||||||
{ ::flatbuffers::ET_SEQUENCE, 0, 0 }
|
|
||||||
};
|
|
||||||
static const ::flatbuffers::TypeFunction type_refs[] = {
|
|
||||||
Flat::Bigfoot::UUIDTypeTable
|
|
||||||
};
|
|
||||||
static const int64_t values[] = { 0, 16 };
|
|
||||||
static const ::flatbuffers::TypeTable tt = {
|
|
||||||
::flatbuffers::ST_STRUCT, 1, type_codes, type_refs, nullptr, values, nullptr
|
|
||||||
};
|
|
||||||
return &tt;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline const ::flatbuffers::TypeTable *SoftReferenceTypeTable() {
|
|
||||||
static const ::flatbuffers::TypeCode type_codes[] = {
|
|
||||||
{ ::flatbuffers::ET_SEQUENCE, 0, 0 }
|
|
||||||
};
|
|
||||||
static const ::flatbuffers::TypeFunction type_refs[] = {
|
|
||||||
Flat::Bigfoot::UUIDTypeTable
|
|
||||||
};
|
|
||||||
static const int64_t values[] = { 0, 16 };
|
|
||||||
static const ::flatbuffers::TypeTable tt = {
|
|
||||||
::flatbuffers::ST_STRUCT, 1, type_codes, type_refs, nullptr, values, nullptr
|
|
||||||
};
|
|
||||||
return &tt;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Bigfoot
|
|
||||||
} // namespace Flat
|
|
||||||
|
|
||||||
#endif // FLATBUFFERS_GENERATED_REFERENCE_FLAT_BIGFOOT_H_
|
|
||||||
@@ -90,9 +90,9 @@ TEST_F(AssetFixture, AssetBTests)
|
|||||||
AssetB assetB;
|
AssetB assetB;
|
||||||
assetB.SetName(nameB);
|
assetB.SetName(nameB);
|
||||||
assetB.SetVersion(versionB);
|
assetB.SetVersion(versionB);
|
||||||
assetB.GetAsset().asset_a_ref = HardReference<AssetA> {assetA.GetHeader().uuid};
|
//assetB.GetAsset().asset_a_ref = HardReference<AssetA> {assetA.GetHeader().uuid};
|
||||||
assetB.GetAsset().asset_a_refs = {SoftReference<AssetA> {assetA.GetHeader().uuid},
|
//assetB.GetAsset().asset_a_refs = {SoftReference<AssetA> {assetA.GetHeader().uuid},
|
||||||
SoftReference<AssetA> {assetAA.GetHeader().uuid}};
|
// SoftReference<AssetA> {assetAA.GetHeader().uuid}};
|
||||||
|
|
||||||
const eastl::vector<std::byte> test = assetB.Save();
|
const eastl::vector<std::byte> test = assetB.Save();
|
||||||
|
|
||||||
@@ -112,13 +112,13 @@ TEST_F(AssetFixture, AssetBTests)
|
|||||||
EXPECT_EQ(assetB.GetHeader().version, versionB);
|
EXPECT_EQ(assetB.GetHeader().version, versionB);
|
||||||
EXPECT_EQ(assetB.GetHeader().version, assetB_dup.GetHeader().version);
|
EXPECT_EQ(assetB.GetHeader().version, assetB_dup.GetHeader().version);
|
||||||
|
|
||||||
EXPECT_EQ(assetB.GetAsset().asset_a_ref, HardReference<AssetA> {assetA.GetHeader().uuid});
|
//EXPECT_EQ(assetB.GetAsset().asset_a_ref, HardReference<AssetA> {assetA.GetHeader().uuid});
|
||||||
EXPECT_EQ(assetB.GetAsset().asset_a_ref, assetB_dup.GetAsset().asset_a_ref);
|
//EXPECT_EQ(assetB.GetAsset().asset_a_ref, assetB_dup.GetAsset().asset_a_ref);
|
||||||
|
|
||||||
EXPECT_EQ(assetB.GetAsset().asset_a_refs,
|
//EXPECT_EQ(assetB.GetAsset().asset_a_refs,
|
||||||
(eastl::vector<SoftReference<AssetA>> {SoftReference<AssetA> {assetA.GetHeader().uuid},
|
// (eastl::vector<SoftReference<AssetA>> {SoftReference<AssetA> {assetA.GetHeader().uuid},
|
||||||
SoftReference<AssetA> {assetAA.GetHeader().uuid}}));
|
// SoftReference<AssetA> {assetAA.GetHeader().uuid}}));
|
||||||
EXPECT_EQ(assetB.GetAsset().asset_a_refs, assetB_dup.GetAsset().asset_a_refs);
|
//EXPECT_EQ(assetB.GetAsset().asset_a_refs, assetB_dup.GetAsset().asset_a_refs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************************/
|
/****************************************************************************************/
|
||||||
@@ -153,9 +153,9 @@ TEST_F(AssetFixture, AssetCTests)
|
|||||||
AssetB assetB;
|
AssetB assetB;
|
||||||
assetB.SetName(nameB);
|
assetB.SetName(nameB);
|
||||||
assetB.SetVersion(versionB);
|
assetB.SetVersion(versionB);
|
||||||
assetB.GetAsset().asset_a_ref = HardReference<AssetA> {assetA.GetHeader().uuid};
|
//assetB.GetAsset().asset_a_ref = HardReference<AssetA> {assetA.GetHeader().uuid};
|
||||||
assetB.GetAsset().asset_a_refs = {SoftReference<AssetA> {assetA.GetHeader().uuid},
|
//assetB.GetAsset().asset_a_refs = {SoftReference<AssetA> {assetA.GetHeader().uuid},
|
||||||
SoftReference<AssetA> {assetAA.GetHeader().uuid}};
|
// SoftReference<AssetA> {assetAA.GetHeader().uuid}};
|
||||||
|
|
||||||
constexpr eastl::string_view nameC = "General";
|
constexpr eastl::string_view nameC = "General";
|
||||||
constexpr std::uint32_t versionC = 1;
|
constexpr std::uint32_t versionC = 1;
|
||||||
@@ -163,11 +163,11 @@ TEST_F(AssetFixture, AssetCTests)
|
|||||||
AssetC assetC;
|
AssetC assetC;
|
||||||
assetC.SetName(nameC);
|
assetC.SetName(nameC);
|
||||||
assetC.SetVersion(versionC);
|
assetC.SetVersion(versionC);
|
||||||
assetC.GetAsset().inner_table->asset_a_ref = HardReference<AssetA> {assetA.GetHeader().uuid};
|
//assetC.GetAsset().inner_table->asset_a_ref = HardReference<AssetA> {assetA.GetHeader().uuid};
|
||||||
assetC.GetAsset().inner_table->asset_a_refs = {HardReference<AssetA> {assetA.GetHeader().uuid},
|
//assetC.GetAsset().inner_table->asset_a_refs = {HardReference<AssetA> {assetA.GetHeader().uuid},
|
||||||
HardReference<AssetA> {assetAA.GetHeader().uuid}};
|
// HardReference<AssetA> {assetAA.GetHeader().uuid}};
|
||||||
assetC.GetAsset().asset_b_ref = HardReference<AssetB> {assetB.GetHeader().uuid};
|
//assetC.GetAsset().asset_b_ref = HardReference<AssetB> {assetB.GetHeader().uuid};
|
||||||
assetC.GetAsset().asset_b_refs = {SoftReference<AssetB> {assetB.GetHeader().uuid}};
|
//assetC.GetAsset().asset_b_refs = {SoftReference<AssetB> {assetB.GetHeader().uuid}};
|
||||||
|
|
||||||
const eastl::vector<std::byte> test = assetC.Save();
|
const eastl::vector<std::byte> test = assetC.Save();
|
||||||
|
|
||||||
@@ -187,19 +187,19 @@ TEST_F(AssetFixture, AssetCTests)
|
|||||||
EXPECT_EQ(assetC.GetHeader().version, versionC);
|
EXPECT_EQ(assetC.GetHeader().version, versionC);
|
||||||
EXPECT_EQ(assetC.GetHeader().version, assetC_dup.GetHeader().version);
|
EXPECT_EQ(assetC.GetHeader().version, assetC_dup.GetHeader().version);
|
||||||
|
|
||||||
EXPECT_EQ(assetC.GetAsset().asset_b_ref, HardReference<AssetB> {assetB.GetHeader().uuid});
|
//EXPECT_EQ(assetC.GetAsset().asset_b_ref, HardReference<AssetB> {assetB.GetHeader().uuid});
|
||||||
EXPECT_EQ(assetC.GetAsset().asset_b_ref, assetC_dup.GetAsset().asset_b_ref);
|
//EXPECT_EQ(assetC.GetAsset().asset_b_ref, assetC_dup.GetAsset().asset_b_ref);
|
||||||
|
|
||||||
EXPECT_EQ(assetC.GetAsset().asset_b_refs,
|
//EXPECT_EQ(assetC.GetAsset().asset_b_refs,
|
||||||
(eastl::vector<SoftReference<AssetB>> {SoftReference<AssetB> {assetB.GetHeader().uuid}}));
|
// (eastl::vector<SoftReference<AssetB>> {SoftReference<AssetB> {assetB.GetHeader().uuid}}));
|
||||||
EXPECT_EQ(assetC.GetAsset().asset_b_refs, assetC_dup.GetAsset().asset_b_refs);
|
//EXPECT_EQ(assetC.GetAsset().asset_b_refs, assetC_dup.GetAsset().asset_b_refs);
|
||||||
|
|
||||||
EXPECT_EQ(assetC.GetAsset().inner_table->asset_a_ref, HardReference<AssetA> {assetA.GetHeader().uuid});
|
//EXPECT_EQ(assetC.GetAsset().inner_table->asset_a_ref, HardReference<AssetA> {assetA.GetHeader().uuid});
|
||||||
EXPECT_EQ(assetC.GetAsset().inner_table->asset_a_ref, assetC_dup.GetAsset().inner_table->asset_a_ref);
|
//EXPECT_EQ(assetC.GetAsset().inner_table->asset_a_ref, assetC_dup.GetAsset().inner_table->asset_a_ref);
|
||||||
|
|
||||||
EXPECT_EQ(assetC.GetAsset().inner_table->asset_a_refs,
|
//EXPECT_EQ(assetC.GetAsset().inner_table->asset_a_refs,
|
||||||
(eastl::vector<HardReference<AssetA>> {HardReference<AssetA> {assetA.GetHeader().uuid},
|
// (eastl::vector<HardReference<AssetA>> {HardReference<AssetA> {assetA.GetHeader().uuid},
|
||||||
HardReference<AssetA> {assetAA.GetHeader().uuid}}));
|
// HardReference<AssetA> {assetAA.GetHeader().uuid}}));
|
||||||
EXPECT_EQ(assetC.GetAsset().inner_table->asset_a_refs, assetC_dup.GetAsset().inner_table->asset_a_refs);
|
//EXPECT_EQ(assetC.GetAsset().inner_table->asset_a_refs, assetC_dup.GetAsset().inner_table->asset_a_refs);
|
||||||
}
|
}
|
||||||
} // namespace Bigfoot
|
} // namespace Bigfoot
|
||||||
|
|||||||
@@ -8,4 +8,4 @@
|
|||||||
|
|
||||||
#include <Engine/Asset/AssetHelper.hpp>
|
#include <Engine/Asset/AssetHelper.hpp>
|
||||||
|
|
||||||
ASSET_CONTAINER(AssetA)
|
ASSET_CONTAINER(AssetA, ::Bigfoot::AssetA)
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
/*********************************************************************
|
|
||||||
* \file AssetARef.cpp
|
|
||||||
*
|
|
||||||
* \author Romain BOULLARD
|
|
||||||
* \date May 2026
|
|
||||||
*********************************************************************/
|
|
||||||
#include <AssetsForTesting/Asset/AssetARef.hpp>
|
|
||||||
|
|
||||||
ASSET_REF_IMPL(AssetA, ::Bigfoot::AssetA)
|
|
||||||
@@ -8,4 +8,4 @@
|
|||||||
|
|
||||||
#include <Engine/Asset/AssetHelper.hpp>
|
#include <Engine/Asset/AssetHelper.hpp>
|
||||||
|
|
||||||
ASSET_CONTAINER(AssetB)
|
ASSET_CONTAINER(AssetB, ::Bigfoot::AssetB)
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
/*********************************************************************
|
|
||||||
* \file AssetBRef.cpp
|
|
||||||
*
|
|
||||||
* \author Romain BOULLARD
|
|
||||||
* \date May 2026
|
|
||||||
*********************************************************************/
|
|
||||||
#include <AssetsForTesting/Asset/AssetBRef.hpp>
|
|
||||||
|
|
||||||
ASSET_REF_IMPL(AssetB, ::Bigfoot::AssetB)
|
|
||||||
@@ -8,4 +8,4 @@
|
|||||||
|
|
||||||
#include <Engine/Asset/AssetHelper.hpp>
|
#include <Engine/Asset/AssetHelper.hpp>
|
||||||
|
|
||||||
ASSET_CONTAINER(AssetC)
|
ASSET_CONTAINER(AssetC, ::Bigfoot::AssetC)
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
/*********************************************************************
|
|
||||||
* \file AssetCRef.cpp
|
|
||||||
*
|
|
||||||
* \author Romain BOULLARD
|
|
||||||
* \date May 2026
|
|
||||||
*********************************************************************/
|
|
||||||
#include <AssetsForTesting/Asset/AssetCRef.hpp>
|
|
||||||
|
|
||||||
ASSET_REF_IMPL(AssetC, ::Bigfoot::AssetC)
|
|
||||||
@@ -1,7 +1,3 @@
|
|||||||
include "Engine/Asset/Reference.fbs";
|
|
||||||
|
|
||||||
native_include "AssetsForTesting/Asset/AssetARef.hpp";
|
|
||||||
|
|
||||||
namespace Flat.Bigfoot;
|
namespace Flat.Bigfoot;
|
||||||
|
|
||||||
table AssetA
|
table AssetA
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
#ifndef BIGFOOT_ASSETSFORTESTING_ASSET_ASSETA_HPP
|
#ifndef BIGFOOT_ASSETSFORTESTING_ASSET_ASSETA_HPP
|
||||||
#define BIGFOOT_ASSETSFORTESTING_ASSET_ASSETA_HPP
|
#define BIGFOOT_ASSETSFORTESTING_ASSET_ASSETA_HPP
|
||||||
#include <Engine/Asset/Asset.hpp>
|
|
||||||
|
|
||||||
#include <AssetsForTesting/Asset/AssetA_generated.hpp>
|
#include <AssetsForTesting/Asset/AssetA_generated.hpp>
|
||||||
|
|
||||||
|
#include <Engine/Asset/Asset.hpp>
|
||||||
|
|
||||||
namespace Bigfoot
|
namespace Bigfoot
|
||||||
{
|
{
|
||||||
struct AssetATraits
|
struct AssetATraits
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
/*********************************************************************
|
|
||||||
* \file AssetARef.hpp
|
|
||||||
*
|
|
||||||
* \author Romain BOULLARD
|
|
||||||
* \date May 2026
|
|
||||||
*********************************************************************/
|
|
||||||
#ifndef BIGFOOT_ASSETSFORTESTING_ASSET_ASSETAREF_HPP
|
|
||||||
#define BIGFOOT_ASSETSFORTESTING_ASSET_ASSETAREF_HPP
|
|
||||||
#include <Engine/Asset/AssetHelper.hpp>
|
|
||||||
|
|
||||||
namespace Bigfoot
|
|
||||||
{
|
|
||||||
class AssetA;
|
|
||||||
} // namespace Bigfoot
|
|
||||||
|
|
||||||
ASSET_REF_DECL(AssetA, ::Bigfoot::AssetA)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
-6
@@ -13,12 +13,6 @@ static_assert(FLATBUFFERS_VERSION_MAJOR == 25 &&
|
|||||||
FLATBUFFERS_VERSION_REVISION == 19,
|
FLATBUFFERS_VERSION_REVISION == 19,
|
||||||
"Non-compatible flatbuffers version included");
|
"Non-compatible flatbuffers version included");
|
||||||
|
|
||||||
#include "Engine/Asset/Reference.hpp"
|
|
||||||
#include "System/UUID/UUID.hpp"
|
|
||||||
#include "Engine/Asset/Reference.hpp"
|
|
||||||
#include "AssetsForTesting/Asset/AssetARef.hpp"
|
|
||||||
#include "Engine/Asset/Reference_generated.hpp"
|
|
||||||
|
|
||||||
#include "EASTL/unique_ptr.h"
|
#include "EASTL/unique_ptr.h"
|
||||||
#include "EASTL/string.h"
|
#include "EASTL/string.h"
|
||||||
#include "EASTL/vector.h"
|
#include "EASTL/vector.h"
|
||||||
|
|||||||
@@ -1,15 +1,9 @@
|
|||||||
include "Engine/Asset/Reference.fbs";
|
|
||||||
|
|
||||||
include "AssetsForTesting/Asset/AssetA.fbs";
|
include "AssetsForTesting/Asset/AssetA.fbs";
|
||||||
|
|
||||||
native_include "AssetsForTesting/Asset/AssetBRef.hpp";
|
|
||||||
|
|
||||||
namespace Flat.Bigfoot;
|
namespace Flat.Bigfoot;
|
||||||
|
|
||||||
table AssetB
|
table AssetB
|
||||||
{
|
{
|
||||||
asset_a_ref: Flat.Bigfoot.HardReference (native_type: "::Bigfoot::HardReference<::Bigfoot::AssetA>", native_inline, native_type_pack_name: "HardReferenceAssetA");
|
|
||||||
asset_a_refs: [Flat.Bigfoot.SoftReference] (native_type: "::Bigfoot::SoftReference<::Bigfoot::AssetA>", native_inline, native_type_pack_name: "SoftReferenceAssetA");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
root_type AssetB;
|
root_type AssetB;
|
||||||
@@ -6,10 +6,10 @@
|
|||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
#ifndef BIGFOOT_ASSETSFORTESTING_ASSET_ASSETB_HPP
|
#ifndef BIGFOOT_ASSETSFORTESTING_ASSET_ASSETB_HPP
|
||||||
#define BIGFOOT_ASSETSFORTESTING_ASSET_ASSETB_HPP
|
#define BIGFOOT_ASSETSFORTESTING_ASSET_ASSETB_HPP
|
||||||
#include <Engine/Asset/Asset.hpp>
|
|
||||||
|
|
||||||
#include <AssetsForTesting/Asset/AssetB_generated.hpp>
|
#include <AssetsForTesting/Asset/AssetB_generated.hpp>
|
||||||
|
|
||||||
|
#include <Engine/Asset/Asset.hpp>
|
||||||
|
|
||||||
namespace Bigfoot
|
namespace Bigfoot
|
||||||
{
|
{
|
||||||
struct AssetBTraits
|
struct AssetBTraits
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
/*********************************************************************
|
|
||||||
* \file AssetBRef.hpp
|
|
||||||
*
|
|
||||||
* \author Romain BOULLARD
|
|
||||||
* \date May 2026
|
|
||||||
*********************************************************************/
|
|
||||||
#ifndef BIGFOOT_ASSETSFORTESTING_ASSET_ASSETBREF_HPP
|
|
||||||
#define BIGFOOT_ASSETSFORTESTING_ASSET_ASSETBREF_HPP
|
|
||||||
#include <Engine/Asset/AssetHelper.hpp>
|
|
||||||
|
|
||||||
namespace Bigfoot
|
|
||||||
{
|
|
||||||
class AssetB;
|
|
||||||
} // namespace Bigfoot
|
|
||||||
|
|
||||||
ASSET_REF_DECL(AssetB, ::Bigfoot::AssetB)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
+3
-48
@@ -13,12 +13,6 @@ static_assert(FLATBUFFERS_VERSION_MAJOR == 25 &&
|
|||||||
FLATBUFFERS_VERSION_REVISION == 19,
|
FLATBUFFERS_VERSION_REVISION == 19,
|
||||||
"Non-compatible flatbuffers version included");
|
"Non-compatible flatbuffers version included");
|
||||||
|
|
||||||
#include "Engine/Asset/Reference.hpp"
|
|
||||||
#include "System/UUID/UUID.hpp"
|
|
||||||
#include "Engine/Asset/Reference.hpp"
|
|
||||||
#include "AssetsForTesting/Asset/AssetARef.hpp"
|
|
||||||
#include "AssetsForTesting/Asset/AssetBRef.hpp"
|
|
||||||
#include "Engine/Asset/Reference_generated.hpp"
|
|
||||||
#include "AssetsForTesting/Asset/AssetA_generated.hpp"
|
#include "AssetsForTesting/Asset/AssetA_generated.hpp"
|
||||||
|
|
||||||
#include "EASTL/unique_ptr.h"
|
#include "EASTL/unique_ptr.h"
|
||||||
@@ -39,8 +33,6 @@ struct AssetBT : public ::flatbuffers::NativeTable {
|
|||||||
static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() {
|
static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() {
|
||||||
return "Flat.Bigfoot.AssetBT";
|
return "Flat.Bigfoot.AssetBT";
|
||||||
}
|
}
|
||||||
::Bigfoot::HardReference<::Bigfoot::AssetA> asset_a_ref{};
|
|
||||||
eastl::vector<::Bigfoot::SoftReference<::Bigfoot::AssetA>> asset_a_refs{};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AssetB FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
struct AssetB FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||||
@@ -53,22 +45,9 @@ struct AssetB FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
|||||||
static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() {
|
static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() {
|
||||||
return "Flat.Bigfoot.AssetB";
|
return "Flat.Bigfoot.AssetB";
|
||||||
}
|
}
|
||||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
|
||||||
VT_ASSET_A_REF = 4,
|
|
||||||
VT_ASSET_A_REFS = 6
|
|
||||||
};
|
|
||||||
const Flat::Bigfoot::HardReference *asset_a_ref() const {
|
|
||||||
return GetStruct<const Flat::Bigfoot::HardReference *>(VT_ASSET_A_REF);
|
|
||||||
}
|
|
||||||
const ::flatbuffers::Vector<const Flat::Bigfoot::SoftReference *> *asset_a_refs() const {
|
|
||||||
return GetPointer<const ::flatbuffers::Vector<const Flat::Bigfoot::SoftReference *> *>(VT_ASSET_A_REFS);
|
|
||||||
}
|
|
||||||
template <bool B = false>
|
template <bool B = false>
|
||||||
bool Verify(::flatbuffers::VerifierTemplate<B> &verifier) const {
|
bool Verify(::flatbuffers::VerifierTemplate<B> &verifier) const {
|
||||||
return VerifyTableStart(verifier) &&
|
return VerifyTableStart(verifier) &&
|
||||||
VerifyField<Flat::Bigfoot::HardReference>(verifier, VT_ASSET_A_REF, 1) &&
|
|
||||||
VerifyOffset(verifier, VT_ASSET_A_REFS) &&
|
|
||||||
verifier.VerifyVector(asset_a_refs()) &&
|
|
||||||
verifier.EndTable();
|
verifier.EndTable();
|
||||||
}
|
}
|
||||||
AssetBT *UnPack(const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
|
AssetBT *UnPack(const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
|
||||||
@@ -80,12 +59,6 @@ struct AssetBBuilder {
|
|||||||
typedef AssetB Table;
|
typedef AssetB Table;
|
||||||
::flatbuffers::FlatBufferBuilder &fbb_;
|
::flatbuffers::FlatBufferBuilder &fbb_;
|
||||||
::flatbuffers::uoffset_t start_;
|
::flatbuffers::uoffset_t start_;
|
||||||
void add_asset_a_ref(const Flat::Bigfoot::HardReference *asset_a_ref) {
|
|
||||||
fbb_.AddStruct(AssetB::VT_ASSET_A_REF, asset_a_ref);
|
|
||||||
}
|
|
||||||
void add_asset_a_refs(::flatbuffers::Offset<::flatbuffers::Vector<const Flat::Bigfoot::SoftReference *>> asset_a_refs) {
|
|
||||||
fbb_.AddOffset(AssetB::VT_ASSET_A_REFS, asset_a_refs);
|
|
||||||
}
|
|
||||||
explicit AssetBBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
|
explicit AssetBBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
|
||||||
: fbb_(_fbb) {
|
: fbb_(_fbb) {
|
||||||
start_ = fbb_.StartTable();
|
start_ = fbb_.StartTable();
|
||||||
@@ -98,12 +71,8 @@ struct AssetBBuilder {
|
|||||||
};
|
};
|
||||||
|
|
||||||
inline ::flatbuffers::Offset<AssetB> CreateAssetB(
|
inline ::flatbuffers::Offset<AssetB> CreateAssetB(
|
||||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
::flatbuffers::FlatBufferBuilder &_fbb) {
|
||||||
const Flat::Bigfoot::HardReference *asset_a_ref = nullptr,
|
|
||||||
::flatbuffers::Offset<::flatbuffers::Vector<const Flat::Bigfoot::SoftReference *>> asset_a_refs = 0) {
|
|
||||||
AssetBBuilder builder_(_fbb);
|
AssetBBuilder builder_(_fbb);
|
||||||
builder_.add_asset_a_refs(asset_a_refs);
|
|
||||||
builder_.add_asset_a_ref(asset_a_ref);
|
|
||||||
return builder_.Finish();
|
return builder_.Finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,8 +92,6 @@ inline AssetBT *AssetB::UnPack(const ::flatbuffers::resolver_function_t *_resolv
|
|||||||
inline void AssetB::UnPackTo(AssetBT *_o, const ::flatbuffers::resolver_function_t *_resolver) const {
|
inline void AssetB::UnPackTo(AssetBT *_o, const ::flatbuffers::resolver_function_t *_resolver) const {
|
||||||
(void)_o;
|
(void)_o;
|
||||||
(void)_resolver;
|
(void)_resolver;
|
||||||
{ auto _e = asset_a_ref(); if (_e) _o->asset_a_ref = ::flatbuffers::UnPackHardReferenceAssetA(*_e); }
|
|
||||||
{ auto _e = asset_a_refs(); if (_e) { _o->asset_a_refs.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->asset_a_refs[_i] = ::flatbuffers::UnPackSoftReferenceAssetA(*_e->Get(_i)); } } else { _o->asset_a_refs.resize(0); } }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline ::flatbuffers::Offset<AssetB> CreateAssetB(::flatbuffers::FlatBufferBuilder &_fbb, const AssetBT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
|
inline ::flatbuffers::Offset<AssetB> CreateAssetB(::flatbuffers::FlatBufferBuilder &_fbb, const AssetBT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
|
||||||
@@ -135,25 +102,13 @@ inline ::flatbuffers::Offset<AssetB> AssetB::Pack(::flatbuffers::FlatBufferBuild
|
|||||||
(void)_rehasher;
|
(void)_rehasher;
|
||||||
(void)_o;
|
(void)_o;
|
||||||
struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const AssetBT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
|
struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const AssetBT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
|
||||||
auto _asset_a_ref = ::flatbuffers::PackHardReferenceAssetA(_o->asset_a_ref);
|
|
||||||
auto _asset_a_refs = _fbb.CreateVectorOfNativeStructs<Flat::Bigfoot::SoftReference, ::Bigfoot::SoftReference<::Bigfoot::AssetA>>(_o->asset_a_refs.data(), _o->asset_a_refs.size(), ::flatbuffers::PackSoftReferenceAssetA);
|
|
||||||
return Flat::Bigfoot::CreateAssetB(
|
return Flat::Bigfoot::CreateAssetB(
|
||||||
_fbb,
|
_fbb);
|
||||||
&_asset_a_ref,
|
|
||||||
_asset_a_refs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const ::flatbuffers::TypeTable *AssetBTypeTable() {
|
inline const ::flatbuffers::TypeTable *AssetBTypeTable() {
|
||||||
static const ::flatbuffers::TypeCode type_codes[] = {
|
|
||||||
{ ::flatbuffers::ET_SEQUENCE, 0, 0 },
|
|
||||||
{ ::flatbuffers::ET_SEQUENCE, 1, 1 }
|
|
||||||
};
|
|
||||||
static const ::flatbuffers::TypeFunction type_refs[] = {
|
|
||||||
Flat::Bigfoot::HardReferenceTypeTable,
|
|
||||||
Flat::Bigfoot::SoftReferenceTypeTable
|
|
||||||
};
|
|
||||||
static const ::flatbuffers::TypeTable tt = {
|
static const ::flatbuffers::TypeTable tt = {
|
||||||
::flatbuffers::ST_TABLE, 2, type_codes, type_refs, nullptr, nullptr, nullptr
|
::flatbuffers::ST_TABLE, 0, nullptr, nullptr, nullptr, nullptr, nullptr
|
||||||
};
|
};
|
||||||
return &tt;
|
return &tt;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +1,15 @@
|
|||||||
include "Engine/Asset/Reference.fbs";
|
|
||||||
|
|
||||||
include "AssetsForTesting/Asset/AssetA.fbs";
|
include "AssetsForTesting/Asset/AssetA.fbs";
|
||||||
include "AssetsForTesting/Asset/AssetB.fbs";
|
include "AssetsForTesting/Asset/AssetB.fbs";
|
||||||
|
|
||||||
native_include "AssetsForTesting/Asset/AssetCRef.hpp";
|
|
||||||
|
|
||||||
namespace Flat.Bigfoot;
|
namespace Flat.Bigfoot;
|
||||||
|
|
||||||
table InnerTable
|
table InnerTable
|
||||||
{
|
{
|
||||||
asset_a_ref: Flat.Bigfoot.HardReference (native_type: "::Bigfoot::HardReference<::Bigfoot::AssetA>", native_inline, native_type_pack_name: "HardReferenceAssetA");
|
|
||||||
asset_a_refs: [Flat.Bigfoot.HardReference] (native_type: "::Bigfoot::HardReference<::Bigfoot::AssetA>", native_inline, native_type_pack_name: "HardReferenceAssetA");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
table AssetC
|
table AssetC
|
||||||
{
|
{
|
||||||
inner_table: InnerTable (required);
|
inner_table: InnerTable (required);
|
||||||
|
|
||||||
asset_b_ref: Flat.Bigfoot.HardReference (native_type: "::Bigfoot::HardReference<::Bigfoot::AssetB>", native_inline, native_type_pack_name: "HardReferenceAssetB");
|
|
||||||
asset_b_refs: [Flat.Bigfoot.SoftReference] (native_type: "::Bigfoot::SoftReference<::Bigfoot::AssetB>", native_inline, native_type_pack_name: "SoftReferenceAssetB");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
root_type AssetC;
|
root_type AssetC;
|
||||||
@@ -6,10 +6,10 @@
|
|||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
#ifndef BIGFOOT_ASSETSFORTESTING_ASSET_ASSETC_HPP
|
#ifndef BIGFOOT_ASSETSFORTESTING_ASSET_ASSETC_HPP
|
||||||
#define BIGFOOT_ASSETSFORTESTING_ASSET_ASSETC_HPP
|
#define BIGFOOT_ASSETSFORTESTING_ASSET_ASSETC_HPP
|
||||||
#include <Engine/Asset/Asset.hpp>
|
|
||||||
|
|
||||||
#include <AssetsForTesting/Asset/AssetC_generated.hpp>
|
#include <AssetsForTesting/Asset/AssetC_generated.hpp>
|
||||||
|
|
||||||
|
#include <Engine/Asset/Asset.hpp>
|
||||||
|
|
||||||
namespace Bigfoot
|
namespace Bigfoot
|
||||||
{
|
{
|
||||||
struct AssetCTraits
|
struct AssetCTraits
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
/*********************************************************************
|
|
||||||
* \file AssetCRef.hpp
|
|
||||||
*
|
|
||||||
* \author Romain BOULLARD
|
|
||||||
* \date May 2026
|
|
||||||
*********************************************************************/
|
|
||||||
#ifndef BIGFOOT_ASSETSFORTESTING_ASSET_ASSETCREF_HPP
|
|
||||||
#define BIGFOOT_ASSETSFORTESTING_ASSET_ASSETCREF_HPP
|
|
||||||
#include <Engine/Asset/AssetHelper.hpp>
|
|
||||||
|
|
||||||
namespace Bigfoot
|
|
||||||
{
|
|
||||||
class AssetC;
|
|
||||||
} // namespace Bigfoot
|
|
||||||
|
|
||||||
ASSET_REF_DECL(AssetC, ::Bigfoot::AssetC)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
+10
-92
@@ -13,13 +13,6 @@ static_assert(FLATBUFFERS_VERSION_MAJOR == 25 &&
|
|||||||
FLATBUFFERS_VERSION_REVISION == 19,
|
FLATBUFFERS_VERSION_REVISION == 19,
|
||||||
"Non-compatible flatbuffers version included");
|
"Non-compatible flatbuffers version included");
|
||||||
|
|
||||||
#include "Engine/Asset/Reference.hpp"
|
|
||||||
#include "System/UUID/UUID.hpp"
|
|
||||||
#include "Engine/Asset/Reference.hpp"
|
|
||||||
#include "AssetsForTesting/Asset/AssetARef.hpp"
|
|
||||||
#include "AssetsForTesting/Asset/AssetBRef.hpp"
|
|
||||||
#include "AssetsForTesting/Asset/AssetCRef.hpp"
|
|
||||||
#include "Engine/Asset/Reference_generated.hpp"
|
|
||||||
#include "AssetsForTesting/Asset/AssetA_generated.hpp"
|
#include "AssetsForTesting/Asset/AssetA_generated.hpp"
|
||||||
#include "AssetsForTesting/Asset/AssetB_generated.hpp"
|
#include "AssetsForTesting/Asset/AssetB_generated.hpp"
|
||||||
|
|
||||||
@@ -47,8 +40,6 @@ struct InnerTableT : public ::flatbuffers::NativeTable {
|
|||||||
static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() {
|
static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() {
|
||||||
return "Flat.Bigfoot.InnerTableT";
|
return "Flat.Bigfoot.InnerTableT";
|
||||||
}
|
}
|
||||||
::Bigfoot::HardReference<::Bigfoot::AssetA> asset_a_ref{};
|
|
||||||
eastl::vector<::Bigfoot::HardReference<::Bigfoot::AssetA>> asset_a_refs{};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct InnerTable FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
struct InnerTable FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||||
@@ -61,22 +52,9 @@ struct InnerTable FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
|||||||
static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() {
|
static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() {
|
||||||
return "Flat.Bigfoot.InnerTable";
|
return "Flat.Bigfoot.InnerTable";
|
||||||
}
|
}
|
||||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
|
||||||
VT_ASSET_A_REF = 4,
|
|
||||||
VT_ASSET_A_REFS = 6
|
|
||||||
};
|
|
||||||
const Flat::Bigfoot::HardReference *asset_a_ref() const {
|
|
||||||
return GetStruct<const Flat::Bigfoot::HardReference *>(VT_ASSET_A_REF);
|
|
||||||
}
|
|
||||||
const ::flatbuffers::Vector<const Flat::Bigfoot::HardReference *> *asset_a_refs() const {
|
|
||||||
return GetPointer<const ::flatbuffers::Vector<const Flat::Bigfoot::HardReference *> *>(VT_ASSET_A_REFS);
|
|
||||||
}
|
|
||||||
template <bool B = false>
|
template <bool B = false>
|
||||||
bool Verify(::flatbuffers::VerifierTemplate<B> &verifier) const {
|
bool Verify(::flatbuffers::VerifierTemplate<B> &verifier) const {
|
||||||
return VerifyTableStart(verifier) &&
|
return VerifyTableStart(verifier) &&
|
||||||
VerifyField<Flat::Bigfoot::HardReference>(verifier, VT_ASSET_A_REF, 1) &&
|
|
||||||
VerifyOffset(verifier, VT_ASSET_A_REFS) &&
|
|
||||||
verifier.VerifyVector(asset_a_refs()) &&
|
|
||||||
verifier.EndTable();
|
verifier.EndTable();
|
||||||
}
|
}
|
||||||
InnerTableT *UnPack(const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
|
InnerTableT *UnPack(const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
|
||||||
@@ -88,12 +66,6 @@ struct InnerTableBuilder {
|
|||||||
typedef InnerTable Table;
|
typedef InnerTable Table;
|
||||||
::flatbuffers::FlatBufferBuilder &fbb_;
|
::flatbuffers::FlatBufferBuilder &fbb_;
|
||||||
::flatbuffers::uoffset_t start_;
|
::flatbuffers::uoffset_t start_;
|
||||||
void add_asset_a_ref(const Flat::Bigfoot::HardReference *asset_a_ref) {
|
|
||||||
fbb_.AddStruct(InnerTable::VT_ASSET_A_REF, asset_a_ref);
|
|
||||||
}
|
|
||||||
void add_asset_a_refs(::flatbuffers::Offset<::flatbuffers::Vector<const Flat::Bigfoot::HardReference *>> asset_a_refs) {
|
|
||||||
fbb_.AddOffset(InnerTable::VT_ASSET_A_REFS, asset_a_refs);
|
|
||||||
}
|
|
||||||
explicit InnerTableBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
|
explicit InnerTableBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
|
||||||
: fbb_(_fbb) {
|
: fbb_(_fbb) {
|
||||||
start_ = fbb_.StartTable();
|
start_ = fbb_.StartTable();
|
||||||
@@ -106,12 +78,8 @@ struct InnerTableBuilder {
|
|||||||
};
|
};
|
||||||
|
|
||||||
inline ::flatbuffers::Offset<InnerTable> CreateInnerTable(
|
inline ::flatbuffers::Offset<InnerTable> CreateInnerTable(
|
||||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
::flatbuffers::FlatBufferBuilder &_fbb) {
|
||||||
const Flat::Bigfoot::HardReference *asset_a_ref = nullptr,
|
|
||||||
::flatbuffers::Offset<::flatbuffers::Vector<const Flat::Bigfoot::HardReference *>> asset_a_refs = 0) {
|
|
||||||
InnerTableBuilder builder_(_fbb);
|
InnerTableBuilder builder_(_fbb);
|
||||||
builder_.add_asset_a_refs(asset_a_refs);
|
|
||||||
builder_.add_asset_a_ref(asset_a_ref);
|
|
||||||
return builder_.Finish();
|
return builder_.Finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,8 +96,6 @@ struct AssetCT : public ::flatbuffers::NativeTable {
|
|||||||
return "Flat.Bigfoot.AssetCT";
|
return "Flat.Bigfoot.AssetCT";
|
||||||
}
|
}
|
||||||
eastl::unique_ptr<Flat::Bigfoot::InnerTableT> inner_table{};
|
eastl::unique_ptr<Flat::Bigfoot::InnerTableT> inner_table{};
|
||||||
::Bigfoot::HardReference<::Bigfoot::AssetB> asset_b_ref{};
|
|
||||||
eastl::vector<::Bigfoot::SoftReference<::Bigfoot::AssetB>> asset_b_refs{};
|
|
||||||
AssetCT() = default;
|
AssetCT() = default;
|
||||||
AssetCT(const AssetCT &o);
|
AssetCT(const AssetCT &o);
|
||||||
AssetCT(AssetCT&&) FLATBUFFERS_NOEXCEPT = default;
|
AssetCT(AssetCT&&) FLATBUFFERS_NOEXCEPT = default;
|
||||||
@@ -147,27 +113,16 @@ struct AssetC FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
|||||||
return "Flat.Bigfoot.AssetC";
|
return "Flat.Bigfoot.AssetC";
|
||||||
}
|
}
|
||||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||||
VT_INNER_TABLE = 4,
|
VT_INNER_TABLE = 4
|
||||||
VT_ASSET_B_REF = 6,
|
|
||||||
VT_ASSET_B_REFS = 8
|
|
||||||
};
|
};
|
||||||
const Flat::Bigfoot::InnerTable *inner_table() const {
|
const Flat::Bigfoot::InnerTable *inner_table() const {
|
||||||
return GetPointer<const Flat::Bigfoot::InnerTable *>(VT_INNER_TABLE);
|
return GetPointer<const Flat::Bigfoot::InnerTable *>(VT_INNER_TABLE);
|
||||||
}
|
}
|
||||||
const Flat::Bigfoot::HardReference *asset_b_ref() const {
|
|
||||||
return GetStruct<const Flat::Bigfoot::HardReference *>(VT_ASSET_B_REF);
|
|
||||||
}
|
|
||||||
const ::flatbuffers::Vector<const Flat::Bigfoot::SoftReference *> *asset_b_refs() const {
|
|
||||||
return GetPointer<const ::flatbuffers::Vector<const Flat::Bigfoot::SoftReference *> *>(VT_ASSET_B_REFS);
|
|
||||||
}
|
|
||||||
template <bool B = false>
|
template <bool B = false>
|
||||||
bool Verify(::flatbuffers::VerifierTemplate<B> &verifier) const {
|
bool Verify(::flatbuffers::VerifierTemplate<B> &verifier) const {
|
||||||
return VerifyTableStart(verifier) &&
|
return VerifyTableStart(verifier) &&
|
||||||
VerifyOffsetRequired(verifier, VT_INNER_TABLE) &&
|
VerifyOffsetRequired(verifier, VT_INNER_TABLE) &&
|
||||||
verifier.VerifyTable(inner_table()) &&
|
verifier.VerifyTable(inner_table()) &&
|
||||||
VerifyField<Flat::Bigfoot::HardReference>(verifier, VT_ASSET_B_REF, 1) &&
|
|
||||||
VerifyOffset(verifier, VT_ASSET_B_REFS) &&
|
|
||||||
verifier.VerifyVector(asset_b_refs()) &&
|
|
||||||
verifier.EndTable();
|
verifier.EndTable();
|
||||||
}
|
}
|
||||||
AssetCT *UnPack(const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
|
AssetCT *UnPack(const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
|
||||||
@@ -182,12 +137,6 @@ struct AssetCBuilder {
|
|||||||
void add_inner_table(::flatbuffers::Offset<Flat::Bigfoot::InnerTable> inner_table) {
|
void add_inner_table(::flatbuffers::Offset<Flat::Bigfoot::InnerTable> inner_table) {
|
||||||
fbb_.AddOffset(AssetC::VT_INNER_TABLE, inner_table);
|
fbb_.AddOffset(AssetC::VT_INNER_TABLE, inner_table);
|
||||||
}
|
}
|
||||||
void add_asset_b_ref(const Flat::Bigfoot::HardReference *asset_b_ref) {
|
|
||||||
fbb_.AddStruct(AssetC::VT_ASSET_B_REF, asset_b_ref);
|
|
||||||
}
|
|
||||||
void add_asset_b_refs(::flatbuffers::Offset<::flatbuffers::Vector<const Flat::Bigfoot::SoftReference *>> asset_b_refs) {
|
|
||||||
fbb_.AddOffset(AssetC::VT_ASSET_B_REFS, asset_b_refs);
|
|
||||||
}
|
|
||||||
explicit AssetCBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
|
explicit AssetCBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
|
||||||
: fbb_(_fbb) {
|
: fbb_(_fbb) {
|
||||||
start_ = fbb_.StartTable();
|
start_ = fbb_.StartTable();
|
||||||
@@ -202,12 +151,8 @@ struct AssetCBuilder {
|
|||||||
|
|
||||||
inline ::flatbuffers::Offset<AssetC> CreateAssetC(
|
inline ::flatbuffers::Offset<AssetC> CreateAssetC(
|
||||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||||
::flatbuffers::Offset<Flat::Bigfoot::InnerTable> inner_table = 0,
|
::flatbuffers::Offset<Flat::Bigfoot::InnerTable> inner_table = 0) {
|
||||||
const Flat::Bigfoot::HardReference *asset_b_ref = nullptr,
|
|
||||||
::flatbuffers::Offset<::flatbuffers::Vector<const Flat::Bigfoot::SoftReference *>> asset_b_refs = 0) {
|
|
||||||
AssetCBuilder builder_(_fbb);
|
AssetCBuilder builder_(_fbb);
|
||||||
builder_.add_asset_b_refs(asset_b_refs);
|
|
||||||
builder_.add_asset_b_ref(asset_b_ref);
|
|
||||||
builder_.add_inner_table(inner_table);
|
builder_.add_inner_table(inner_table);
|
||||||
return builder_.Finish();
|
return builder_.Finish();
|
||||||
}
|
}
|
||||||
@@ -228,8 +173,6 @@ inline InnerTableT *InnerTable::UnPack(const ::flatbuffers::resolver_function_t
|
|||||||
inline void InnerTable::UnPackTo(InnerTableT *_o, const ::flatbuffers::resolver_function_t *_resolver) const {
|
inline void InnerTable::UnPackTo(InnerTableT *_o, const ::flatbuffers::resolver_function_t *_resolver) const {
|
||||||
(void)_o;
|
(void)_o;
|
||||||
(void)_resolver;
|
(void)_resolver;
|
||||||
{ auto _e = asset_a_ref(); if (_e) _o->asset_a_ref = ::flatbuffers::UnPackHardReferenceAssetA(*_e); }
|
|
||||||
{ auto _e = asset_a_refs(); if (_e) { _o->asset_a_refs.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->asset_a_refs[_i] = ::flatbuffers::UnPackHardReferenceAssetA(*_e->Get(_i)); } } else { _o->asset_a_refs.resize(0); } }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline ::flatbuffers::Offset<InnerTable> CreateInnerTable(::flatbuffers::FlatBufferBuilder &_fbb, const InnerTableT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
|
inline ::flatbuffers::Offset<InnerTable> CreateInnerTable(::flatbuffers::FlatBufferBuilder &_fbb, const InnerTableT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
|
||||||
@@ -240,24 +183,16 @@ inline ::flatbuffers::Offset<InnerTable> InnerTable::Pack(::flatbuffers::FlatBuf
|
|||||||
(void)_rehasher;
|
(void)_rehasher;
|
||||||
(void)_o;
|
(void)_o;
|
||||||
struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const InnerTableT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
|
struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const InnerTableT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
|
||||||
auto _asset_a_ref = ::flatbuffers::PackHardReferenceAssetA(_o->asset_a_ref);
|
|
||||||
auto _asset_a_refs = _fbb.CreateVectorOfNativeStructs<Flat::Bigfoot::HardReference, ::Bigfoot::HardReference<::Bigfoot::AssetA>>(_o->asset_a_refs.data(), _o->asset_a_refs.size(), ::flatbuffers::PackHardReferenceAssetA);
|
|
||||||
return Flat::Bigfoot::CreateInnerTable(
|
return Flat::Bigfoot::CreateInnerTable(
|
||||||
_fbb,
|
_fbb);
|
||||||
&_asset_a_ref,
|
|
||||||
_asset_a_refs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline AssetCT::AssetCT(const AssetCT &o)
|
inline AssetCT::AssetCT(const AssetCT &o)
|
||||||
: inner_table((o.inner_table) ? new Flat::Bigfoot::InnerTableT(*o.inner_table) : nullptr),
|
: inner_table((o.inner_table) ? new Flat::Bigfoot::InnerTableT(*o.inner_table) : nullptr) {
|
||||||
asset_b_ref(o.asset_b_ref),
|
|
||||||
asset_b_refs(o.asset_b_refs) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline AssetCT &AssetCT::operator=(AssetCT o) FLATBUFFERS_NOEXCEPT {
|
inline AssetCT &AssetCT::operator=(AssetCT o) FLATBUFFERS_NOEXCEPT {
|
||||||
std::swap(inner_table, o.inner_table);
|
std::swap(inner_table, o.inner_table);
|
||||||
std::swap(asset_b_ref, o.asset_b_ref);
|
|
||||||
std::swap(asset_b_refs, o.asset_b_refs);
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -271,8 +206,6 @@ inline void AssetC::UnPackTo(AssetCT *_o, const ::flatbuffers::resolver_function
|
|||||||
(void)_o;
|
(void)_o;
|
||||||
(void)_resolver;
|
(void)_resolver;
|
||||||
{ auto _e = inner_table(); if (_e) { if(_o->inner_table) { _e->UnPackTo(_o->inner_table.get(), _resolver); } else { _o->inner_table = eastl::unique_ptr<Flat::Bigfoot::InnerTableT>(_e->UnPack(_resolver)); } } else if (_o->inner_table) { _o->inner_table.reset(); } }
|
{ auto _e = inner_table(); if (_e) { if(_o->inner_table) { _e->UnPackTo(_o->inner_table.get(), _resolver); } else { _o->inner_table = eastl::unique_ptr<Flat::Bigfoot::InnerTableT>(_e->UnPack(_resolver)); } } else if (_o->inner_table) { _o->inner_table.reset(); } }
|
||||||
{ auto _e = asset_b_ref(); if (_e) _o->asset_b_ref = ::flatbuffers::UnPackHardReferenceAssetB(*_e); }
|
|
||||||
{ auto _e = asset_b_refs(); if (_e) { _o->asset_b_refs.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->asset_b_refs[_i] = ::flatbuffers::UnPackSoftReferenceAssetB(*_e->Get(_i)); } } else { _o->asset_b_refs.resize(0); } }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline ::flatbuffers::Offset<AssetC> CreateAssetC(::flatbuffers::FlatBufferBuilder &_fbb, const AssetCT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
|
inline ::flatbuffers::Offset<AssetC> CreateAssetC(::flatbuffers::FlatBufferBuilder &_fbb, const AssetCT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
|
||||||
@@ -284,42 +217,27 @@ inline ::flatbuffers::Offset<AssetC> AssetC::Pack(::flatbuffers::FlatBufferBuild
|
|||||||
(void)_o;
|
(void)_o;
|
||||||
struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const AssetCT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
|
struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const AssetCT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
|
||||||
auto _inner_table = _o->inner_table ? CreateInnerTable(_fbb, _o->inner_table.get(), _rehasher) : 0;
|
auto _inner_table = _o->inner_table ? CreateInnerTable(_fbb, _o->inner_table.get(), _rehasher) : 0;
|
||||||
auto _asset_b_ref = ::flatbuffers::PackHardReferenceAssetB(_o->asset_b_ref);
|
|
||||||
auto _asset_b_refs = _fbb.CreateVectorOfNativeStructs<Flat::Bigfoot::SoftReference, ::Bigfoot::SoftReference<::Bigfoot::AssetB>>(_o->asset_b_refs.data(), _o->asset_b_refs.size(), ::flatbuffers::PackSoftReferenceAssetB);
|
|
||||||
return Flat::Bigfoot::CreateAssetC(
|
return Flat::Bigfoot::CreateAssetC(
|
||||||
_fbb,
|
_fbb,
|
||||||
_inner_table,
|
_inner_table);
|
||||||
&_asset_b_ref,
|
|
||||||
_asset_b_refs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const ::flatbuffers::TypeTable *InnerTableTypeTable() {
|
inline const ::flatbuffers::TypeTable *InnerTableTypeTable() {
|
||||||
static const ::flatbuffers::TypeCode type_codes[] = {
|
|
||||||
{ ::flatbuffers::ET_SEQUENCE, 0, 0 },
|
|
||||||
{ ::flatbuffers::ET_SEQUENCE, 1, 0 }
|
|
||||||
};
|
|
||||||
static const ::flatbuffers::TypeFunction type_refs[] = {
|
|
||||||
Flat::Bigfoot::HardReferenceTypeTable
|
|
||||||
};
|
|
||||||
static const ::flatbuffers::TypeTable tt = {
|
static const ::flatbuffers::TypeTable tt = {
|
||||||
::flatbuffers::ST_TABLE, 2, type_codes, type_refs, nullptr, nullptr, nullptr
|
::flatbuffers::ST_TABLE, 0, nullptr, nullptr, nullptr, nullptr, nullptr
|
||||||
};
|
};
|
||||||
return &tt;
|
return &tt;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const ::flatbuffers::TypeTable *AssetCTypeTable() {
|
inline const ::flatbuffers::TypeTable *AssetCTypeTable() {
|
||||||
static const ::flatbuffers::TypeCode type_codes[] = {
|
static const ::flatbuffers::TypeCode type_codes[] = {
|
||||||
{ ::flatbuffers::ET_SEQUENCE, 0, 0 },
|
{ ::flatbuffers::ET_SEQUENCE, 0, 0 }
|
||||||
{ ::flatbuffers::ET_SEQUENCE, 0, 1 },
|
|
||||||
{ ::flatbuffers::ET_SEQUENCE, 1, 2 }
|
|
||||||
};
|
};
|
||||||
static const ::flatbuffers::TypeFunction type_refs[] = {
|
static const ::flatbuffers::TypeFunction type_refs[] = {
|
||||||
Flat::Bigfoot::InnerTableTypeTable,
|
Flat::Bigfoot::InnerTableTypeTable
|
||||||
Flat::Bigfoot::HardReferenceTypeTable,
|
|
||||||
Flat::Bigfoot::SoftReferenceTypeTable
|
|
||||||
};
|
};
|
||||||
static const ::flatbuffers::TypeTable tt = {
|
static const ::flatbuffers::TypeTable tt = {
|
||||||
::flatbuffers::ST_TABLE, 3, type_codes, type_refs, nullptr, nullptr, nullptr
|
::flatbuffers::ST_TABLE, 1, type_codes, type_refs, nullptr, nullptr, nullptr
|
||||||
};
|
};
|
||||||
return &tt;
|
return &tt;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -112,7 +112,7 @@ function(bigfoot_compile_flatbuffers)
|
|||||||
--force-empty
|
--force-empty
|
||||||
--cpp-ptr-type "eastl::unique_ptr"
|
--cpp-ptr-type "eastl::unique_ptr"
|
||||||
--cpp-str-type "eastl::string"
|
--cpp-str-type "eastl::string"
|
||||||
--cpp-vec-type "eastl::vector"
|
--cpp-vector-type "eastl::vector"
|
||||||
--cpp-include "EASTL/unique_ptr.h"
|
--cpp-include "EASTL/unique_ptr.h"
|
||||||
--cpp-include "EASTL/string.h"
|
--cpp-include "EASTL/string.h"
|
||||||
--cpp-include "EASTL/vector.h"
|
--cpp-include "EASTL/vector.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user