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
|
||||
#define BIGFOOT_ENGINE_ASSET_ASSET_HPP
|
||||
#include <Engine/Asset/Asset_generated.hpp>
|
||||
#include <Engine/Asset/Reference_generated.hpp>
|
||||
#include <Engine/EngineAssertHandler.hpp>
|
||||
|
||||
#include <EASTL/span.h>
|
||||
@@ -25,6 +24,8 @@ class Asset
|
||||
using FLAT_ASSET = typename ASSET::FLAT;
|
||||
|
||||
Asset():
|
||||
m_hardRefCount(0),
|
||||
m_softRefCount(0),
|
||||
m_header(::Flat::Bigfoot::AssetHeaderT {.uuid = UUID {},
|
||||
.name = eastl::string {},
|
||||
.type_id = GetTypeID(),
|
||||
@@ -59,6 +60,38 @@ class Asset
|
||||
|
||||
~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]]
|
||||
const ::Flat::Bigfoot::AssetHeaderT& GetHeader() const
|
||||
{
|
||||
@@ -123,6 +156,9 @@ class Asset
|
||||
Asset& operator=(Asset&& p_asset) = default;
|
||||
|
||||
private:
|
||||
std::uint32_t m_hardRefCount;
|
||||
std::uint32_t m_softRefCount;
|
||||
|
||||
::Flat::Bigfoot::AssetHeaderT m_header;
|
||||
typename FLAT_ASSET::NativeTableType m_asset;
|
||||
};
|
||||
|
||||
@@ -8,65 +8,11 @@
|
||||
#define BIGFOOT_ENGINE_ASSET_ASSETHELPER_HPP
|
||||
#include <Engine/Asset/AssetContainer.hpp>
|
||||
#include <Engine/Asset/AssetLibrary.hpp>
|
||||
#include <Engine/Asset/Reference.hpp>
|
||||
#include <Engine/Asset/Reference_generated.hpp>
|
||||
|
||||
#define ASSET_SOFT_REF_DECL(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) \
|
||||
#define ASSET_CONTAINER(AssetName, AssetType) \
|
||||
namespace Bigfoot \
|
||||
{ \
|
||||
AssetContainer<AssetType> g_containerFor##AssetType; \
|
||||
const bool g_insertedContainerFor##AssetType = g_assetLibrary.Insert(&g_containerFor##AssetType); \
|
||||
AssetContainer<AssetType> g_containerFor##AssetName; \
|
||||
const bool g_insertedContainerFor##AssetName = g_assetLibrary.Insert(&g_containerFor##AssetName); \
|
||||
}
|
||||
#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
|
||||
#define BIGFOOT_ENGINE_ASSET_REFERENCE_HPP
|
||||
#include <Engine/Asset/AssetContainer.hpp>
|
||||
#include <Engine/Asset/AssetLibrary.hpp>
|
||||
|
||||
#include <System/UUID/UUID.hpp>
|
||||
|
||||
@@ -27,13 +27,15 @@ class HardReference
|
||||
}
|
||||
|
||||
HardReference(const HardReference& p_ref):
|
||||
m_uuid(p_ref.m_uuid)
|
||||
m_uuid(p_ref.m_uuid),
|
||||
m_slotKey(p_ref.m_slotKey)
|
||||
{
|
||||
Acquire();
|
||||
}
|
||||
|
||||
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();
|
||||
m_uuid = p_ref.m_uuid;
|
||||
m_slotKey = p_ref.m_slotKey;
|
||||
Acquire();
|
||||
}
|
||||
return *this;
|
||||
@@ -65,6 +68,7 @@ class HardReference
|
||||
{
|
||||
Release();
|
||||
m_uuid = std::exchange(p_ref.m_uuid, UUID::NULL_UUID);
|
||||
std::exchange(p_ref.m_slotKey, typename SlotMap<ASSET>::SlotKey {});
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -78,21 +82,34 @@ class HardReference
|
||||
private:
|
||||
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()
|
||||
{
|
||||
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;
|
||||
typename SlotMap<ASSET>::SlotKey m_slotKey;
|
||||
};
|
||||
|
||||
template<class ASSET>
|
||||
@@ -108,13 +125,15 @@ class SoftReference
|
||||
}
|
||||
|
||||
SoftReference(const SoftReference& p_ref):
|
||||
m_uuid(p_ref.m_uuid)
|
||||
m_uuid(p_ref.m_uuid),
|
||||
m_slotKey(p_ref.m_slotKey)
|
||||
{
|
||||
Acquire();
|
||||
}
|
||||
|
||||
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();
|
||||
m_uuid = p_ref.m_uuid;
|
||||
m_slotKey = p_ref.m_slotKey;
|
||||
Acquire();
|
||||
}
|
||||
return *this;
|
||||
@@ -146,6 +166,7 @@ class SoftReference
|
||||
{
|
||||
Release();
|
||||
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;
|
||||
}
|
||||
@@ -159,21 +180,34 @@ class SoftReference
|
||||
private:
|
||||
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()
|
||||
{
|
||||
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;
|
||||
typename SlotMap<ASSET>::SlotKey m_slotKey;
|
||||
};
|
||||
} // namespace Bigfoot
|
||||
#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.SetName(nameB);
|
||||
assetB.SetVersion(versionB);
|
||||
assetB.GetAsset().asset_a_ref = HardReference<AssetA> {assetA.GetHeader().uuid};
|
||||
assetB.GetAsset().asset_a_refs = {SoftReference<AssetA> {assetA.GetHeader().uuid},
|
||||
SoftReference<AssetA> {assetAA.GetHeader().uuid}};
|
||||
//assetB.GetAsset().asset_a_ref = HardReference<AssetA> {assetA.GetHeader().uuid};
|
||||
//assetB.GetAsset().asset_a_refs = {SoftReference<AssetA> {assetA.GetHeader().uuid},
|
||||
// SoftReference<AssetA> {assetAA.GetHeader().uuid}};
|
||||
|
||||
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, assetB_dup.GetHeader().version);
|
||||
|
||||
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, HardReference<AssetA> {assetA.GetHeader().uuid});
|
||||
//EXPECT_EQ(assetB.GetAsset().asset_a_ref, assetB_dup.GetAsset().asset_a_ref);
|
||||
|
||||
EXPECT_EQ(assetB.GetAsset().asset_a_refs,
|
||||
(eastl::vector<SoftReference<AssetA>> {SoftReference<AssetA> {assetA.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,
|
||||
// (eastl::vector<SoftReference<AssetA>> {SoftReference<AssetA> {assetA.GetHeader().uuid},
|
||||
// SoftReference<AssetA> {assetAA.GetHeader().uuid}}));
|
||||
//EXPECT_EQ(assetB.GetAsset().asset_a_refs, assetB_dup.GetAsset().asset_a_refs);
|
||||
}
|
||||
|
||||
/****************************************************************************************/
|
||||
@@ -153,9 +153,9 @@ TEST_F(AssetFixture, AssetCTests)
|
||||
AssetB assetB;
|
||||
assetB.SetName(nameB);
|
||||
assetB.SetVersion(versionB);
|
||||
assetB.GetAsset().asset_a_ref = HardReference<AssetA> {assetA.GetHeader().uuid};
|
||||
assetB.GetAsset().asset_a_refs = {SoftReference<AssetA> {assetA.GetHeader().uuid},
|
||||
SoftReference<AssetA> {assetAA.GetHeader().uuid}};
|
||||
//assetB.GetAsset().asset_a_ref = HardReference<AssetA> {assetA.GetHeader().uuid};
|
||||
//assetB.GetAsset().asset_a_refs = {SoftReference<AssetA> {assetA.GetHeader().uuid},
|
||||
// SoftReference<AssetA> {assetAA.GetHeader().uuid}};
|
||||
|
||||
constexpr eastl::string_view nameC = "General";
|
||||
constexpr std::uint32_t versionC = 1;
|
||||
@@ -163,11 +163,11 @@ TEST_F(AssetFixture, AssetCTests)
|
||||
AssetC assetC;
|
||||
assetC.SetName(nameC);
|
||||
assetC.SetVersion(versionC);
|
||||
assetC.GetAsset().inner_table->asset_a_ref = HardReference<AssetA> {assetA.GetHeader().uuid};
|
||||
assetC.GetAsset().inner_table->asset_a_refs = {HardReference<AssetA> {assetA.GetHeader().uuid},
|
||||
HardReference<AssetA> {assetAA.GetHeader().uuid}};
|
||||
assetC.GetAsset().asset_b_ref = HardReference<AssetB> {assetB.GetHeader().uuid};
|
||||
assetC.GetAsset().asset_b_refs = {SoftReference<AssetB> {assetB.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},
|
||||
// HardReference<AssetA> {assetAA.GetHeader().uuid}};
|
||||
//assetC.GetAsset().asset_b_ref = HardReference<AssetB> {assetB.GetHeader().uuid};
|
||||
//assetC.GetAsset().asset_b_refs = {SoftReference<AssetB> {assetB.GetHeader().uuid}};
|
||||
|
||||
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, assetC_dup.GetHeader().version);
|
||||
|
||||
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, HardReference<AssetB> {assetB.GetHeader().uuid});
|
||||
//EXPECT_EQ(assetC.GetAsset().asset_b_ref, assetC_dup.GetAsset().asset_b_ref);
|
||||
|
||||
EXPECT_EQ(assetC.GetAsset().asset_b_refs,
|
||||
(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,
|
||||
// (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().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, 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_refs,
|
||||
(eastl::vector<HardReference<AssetA>> {HardReference<AssetA> {assetA.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,
|
||||
// (eastl::vector<HardReference<AssetA>> {HardReference<AssetA> {assetA.GetHeader().uuid},
|
||||
// HardReference<AssetA> {assetAA.GetHeader().uuid}}));
|
||||
//EXPECT_EQ(assetC.GetAsset().inner_table->asset_a_refs, assetC_dup.GetAsset().inner_table->asset_a_refs);
|
||||
}
|
||||
} // namespace Bigfoot
|
||||
|
||||
@@ -8,4 +8,4 @@
|
||||
|
||||
#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>
|
||||
|
||||
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>
|
||||
|
||||
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;
|
||||
|
||||
table AssetA
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
*********************************************************************/
|
||||
#ifndef BIGFOOT_ASSETSFORTESTING_ASSET_ASSETA_HPP
|
||||
#define BIGFOOT_ASSETSFORTESTING_ASSET_ASSETA_HPP
|
||||
#include <Engine/Asset/Asset.hpp>
|
||||
|
||||
#include <AssetsForTesting/Asset/AssetA_generated.hpp>
|
||||
|
||||
#include <Engine/Asset/Asset.hpp>
|
||||
|
||||
namespace Bigfoot
|
||||
{
|
||||
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,
|
||||
"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/string.h"
|
||||
#include "EASTL/vector.h"
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
include "Engine/Asset/Reference.fbs";
|
||||
|
||||
include "AssetsForTesting/Asset/AssetA.fbs";
|
||||
|
||||
native_include "AssetsForTesting/Asset/AssetBRef.hpp";
|
||||
|
||||
namespace Flat.Bigfoot;
|
||||
|
||||
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;
|
||||
@@ -6,10 +6,10 @@
|
||||
*********************************************************************/
|
||||
#ifndef BIGFOOT_ASSETSFORTESTING_ASSET_ASSETB_HPP
|
||||
#define BIGFOOT_ASSETSFORTESTING_ASSET_ASSETB_HPP
|
||||
#include <Engine/Asset/Asset.hpp>
|
||||
|
||||
#include <AssetsForTesting/Asset/AssetB_generated.hpp>
|
||||
|
||||
#include <Engine/Asset/Asset.hpp>
|
||||
|
||||
namespace Bigfoot
|
||||
{
|
||||
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,
|
||||
"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 "EASTL/unique_ptr.h"
|
||||
@@ -39,8 +33,6 @@ struct AssetBT : public ::flatbuffers::NativeTable {
|
||||
static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() {
|
||||
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 {
|
||||
@@ -53,22 +45,9 @@ struct AssetB FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||
static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() {
|
||||
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>
|
||||
bool Verify(::flatbuffers::VerifierTemplate<B> &verifier) const {
|
||||
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();
|
||||
}
|
||||
AssetBT *UnPack(const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
|
||||
@@ -80,12 +59,6 @@ struct AssetBBuilder {
|
||||
typedef AssetB Table;
|
||||
::flatbuffers::FlatBufferBuilder &fbb_;
|
||||
::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)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
@@ -98,12 +71,8 @@ struct AssetBBuilder {
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<AssetB> CreateAssetB(
|
||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
const Flat::Bigfoot::HardReference *asset_a_ref = nullptr,
|
||||
::flatbuffers::Offset<::flatbuffers::Vector<const Flat::Bigfoot::SoftReference *>> asset_a_refs = 0) {
|
||||
::flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
AssetBBuilder builder_(_fbb);
|
||||
builder_.add_asset_a_refs(asset_a_refs);
|
||||
builder_.add_asset_a_ref(asset_a_ref);
|
||||
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 {
|
||||
(void)_o;
|
||||
(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) {
|
||||
@@ -135,25 +102,13 @@ inline ::flatbuffers::Offset<AssetB> AssetB::Pack(::flatbuffers::FlatBufferBuild
|
||||
(void)_rehasher;
|
||||
(void)_o;
|
||||
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(
|
||||
_fbb,
|
||||
&_asset_a_ref,
|
||||
_asset_a_refs);
|
||||
_fbb);
|
||||
}
|
||||
|
||||
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 = {
|
||||
::flatbuffers::ST_TABLE, 2, type_codes, type_refs, nullptr, nullptr, nullptr
|
||||
::flatbuffers::ST_TABLE, 0, nullptr, nullptr, nullptr, nullptr, nullptr
|
||||
};
|
||||
return &tt;
|
||||
}
|
||||
|
||||
@@ -1,24 +1,15 @@
|
||||
include "Engine/Asset/Reference.fbs";
|
||||
|
||||
include "AssetsForTesting/Asset/AssetA.fbs";
|
||||
include "AssetsForTesting/Asset/AssetB.fbs";
|
||||
|
||||
native_include "AssetsForTesting/Asset/AssetCRef.hpp";
|
||||
|
||||
namespace Flat.Bigfoot;
|
||||
|
||||
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
|
||||
{
|
||||
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;
|
||||
@@ -6,10 +6,10 @@
|
||||
*********************************************************************/
|
||||
#ifndef BIGFOOT_ASSETSFORTESTING_ASSET_ASSETC_HPP
|
||||
#define BIGFOOT_ASSETSFORTESTING_ASSET_ASSETC_HPP
|
||||
#include <Engine/Asset/Asset.hpp>
|
||||
|
||||
#include <AssetsForTesting/Asset/AssetC_generated.hpp>
|
||||
|
||||
#include <Engine/Asset/Asset.hpp>
|
||||
|
||||
namespace Bigfoot
|
||||
{
|
||||
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,
|
||||
"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/AssetB_generated.hpp"
|
||||
|
||||
@@ -47,8 +40,6 @@ struct InnerTableT : public ::flatbuffers::NativeTable {
|
||||
static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() {
|
||||
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 {
|
||||
@@ -61,22 +52,9 @@ struct InnerTable FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||
static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() {
|
||||
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>
|
||||
bool Verify(::flatbuffers::VerifierTemplate<B> &verifier) const {
|
||||
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();
|
||||
}
|
||||
InnerTableT *UnPack(const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
|
||||
@@ -88,12 +66,6 @@ struct InnerTableBuilder {
|
||||
typedef InnerTable Table;
|
||||
::flatbuffers::FlatBufferBuilder &fbb_;
|
||||
::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)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
@@ -106,12 +78,8 @@ struct InnerTableBuilder {
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<InnerTable> CreateInnerTable(
|
||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
const Flat::Bigfoot::HardReference *asset_a_ref = nullptr,
|
||||
::flatbuffers::Offset<::flatbuffers::Vector<const Flat::Bigfoot::HardReference *>> asset_a_refs = 0) {
|
||||
::flatbuffers::FlatBufferBuilder &_fbb) {
|
||||
InnerTableBuilder builder_(_fbb);
|
||||
builder_.add_asset_a_refs(asset_a_refs);
|
||||
builder_.add_asset_a_ref(asset_a_ref);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
@@ -128,8 +96,6 @@ struct AssetCT : public ::flatbuffers::NativeTable {
|
||||
return "Flat.Bigfoot.AssetCT";
|
||||
}
|
||||
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(const AssetCT &o);
|
||||
AssetCT(AssetCT&&) FLATBUFFERS_NOEXCEPT = default;
|
||||
@@ -147,27 +113,16 @@ struct AssetC FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||
return "Flat.Bigfoot.AssetC";
|
||||
}
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_INNER_TABLE = 4,
|
||||
VT_ASSET_B_REF = 6,
|
||||
VT_ASSET_B_REFS = 8
|
||||
VT_INNER_TABLE = 4
|
||||
};
|
||||
const Flat::Bigfoot::InnerTable *inner_table() const {
|
||||
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>
|
||||
bool Verify(::flatbuffers::VerifierTemplate<B> &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyOffsetRequired(verifier, VT_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();
|
||||
}
|
||||
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) {
|
||||
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)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
@@ -202,12 +151,8 @@ struct AssetCBuilder {
|
||||
|
||||
inline ::flatbuffers::Offset<AssetC> CreateAssetC(
|
||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
::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) {
|
||||
::flatbuffers::Offset<Flat::Bigfoot::InnerTable> inner_table = 0) {
|
||||
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);
|
||||
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 {
|
||||
(void)_o;
|
||||
(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) {
|
||||
@@ -240,24 +183,16 @@ inline ::flatbuffers::Offset<InnerTable> InnerTable::Pack(::flatbuffers::FlatBuf
|
||||
(void)_rehasher;
|
||||
(void)_o;
|
||||
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(
|
||||
_fbb,
|
||||
&_asset_a_ref,
|
||||
_asset_a_refs);
|
||||
_fbb);
|
||||
}
|
||||
|
||||
inline AssetCT::AssetCT(const AssetCT &o)
|
||||
: 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) {
|
||||
: inner_table((o.inner_table) ? new Flat::Bigfoot::InnerTableT(*o.inner_table) : nullptr) {
|
||||
}
|
||||
|
||||
inline AssetCT &AssetCT::operator=(AssetCT o) FLATBUFFERS_NOEXCEPT {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -271,8 +206,6 @@ inline void AssetC::UnPackTo(AssetCT *_o, const ::flatbuffers::resolver_function
|
||||
(void)_o;
|
||||
(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 = 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) {
|
||||
@@ -284,42 +217,27 @@ inline ::flatbuffers::Offset<AssetC> AssetC::Pack(::flatbuffers::FlatBufferBuild
|
||||
(void)_o;
|
||||
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 _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(
|
||||
_fbb,
|
||||
_inner_table,
|
||||
&_asset_b_ref,
|
||||
_asset_b_refs);
|
||||
_inner_table);
|
||||
}
|
||||
|
||||
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 = {
|
||||
::flatbuffers::ST_TABLE, 2, type_codes, type_refs, nullptr, nullptr, nullptr
|
||||
::flatbuffers::ST_TABLE, 0, nullptr, nullptr, nullptr, nullptr, nullptr
|
||||
};
|
||||
return &tt;
|
||||
}
|
||||
|
||||
inline const ::flatbuffers::TypeTable *AssetCTypeTable() {
|
||||
static const ::flatbuffers::TypeCode type_codes[] = {
|
||||
{ ::flatbuffers::ET_SEQUENCE, 0, 0 },
|
||||
{ ::flatbuffers::ET_SEQUENCE, 0, 1 },
|
||||
{ ::flatbuffers::ET_SEQUENCE, 1, 2 }
|
||||
{ ::flatbuffers::ET_SEQUENCE, 0, 0 }
|
||||
};
|
||||
static const ::flatbuffers::TypeFunction type_refs[] = {
|
||||
Flat::Bigfoot::InnerTableTypeTable,
|
||||
Flat::Bigfoot::HardReferenceTypeTable,
|
||||
Flat::Bigfoot::SoftReferenceTypeTable
|
||||
Flat::Bigfoot::InnerTableTypeTable
|
||||
};
|
||||
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;
|
||||
}
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ function(bigfoot_compile_flatbuffers)
|
||||
--force-empty
|
||||
--cpp-ptr-type "eastl::unique_ptr"
|
||||
--cpp-str-type "eastl::string"
|
||||
--cpp-vec-type "eastl::vector"
|
||||
--cpp-vector-type "eastl::vector"
|
||||
--cpp-include "EASTL/unique_ptr.h"
|
||||
--cpp-include "EASTL/string.h"
|
||||
--cpp-include "EASTL/vector.h"
|
||||
|
||||
Reference in New Issue
Block a user