BigFile/Sasquatch #1

Merged
rboullard merged 100 commits from BigFile into Development 2026-09-01 16:32:02 +00:00
15 changed files with 29 additions and 170 deletions
Showing only changes of commit 4b07aa7fa2 - Show all commits
@@ -26,10 +26,10 @@ class AssetBase
protected:
AssetBase() = default;
AssetBase(const AssetBase& p_asset) = default;
AssetBase(const AssetBase& p_asset) = delete;
AssetBase(AssetBase&& p_asset) = default;
AssetBase& operator=(const AssetBase& p_asset) = default;
AssetBase& operator=(const AssetBase& p_asset) = delete;
AssetBase& operator=(AssetBase&& p_asset) = default;
};
@@ -52,11 +52,6 @@ class Asset: public AssetBase
m_header.type_name = eastl::string {GetTypeName()};
}
Asset(const Asset& p_asset) = default;
Asset(Asset&& p_asset) = default;
~Asset() = default;
/**
* Get the header of the asset
*
@@ -181,9 +176,6 @@ class Asset: public AssetBase
return FLAT_ASSET::GetFullyQualifiedName();
}
Asset& operator=(const Asset& p_asset) = default;
Asset& operator=(Asset&& p_asset) = default;
private:
/**
* The asset
@@ -24,13 +24,6 @@ namespace Bigfoot
class ContainerHandle
{
public:
ContainerHandle() = default;
ContainerHandle(const ContainerHandle& p_handle) = default;
ContainerHandle(ContainerHandle&& p_handle) = default;
~ContainerHandle() = default;
/*
* Get the HardRef count
*
@@ -121,9 +114,6 @@ class ContainerHandle
m_asset = p_asset;
}
ContainerHandle& operator=(const ContainerHandle& p_handle) = default;
ContainerHandle& operator=(ContainerHandle&& p_handle) = default;
private:
/*
* The HardRef count
@@ -191,7 +181,6 @@ class AssetContainerBase
}
}
AssetContainerBase& operator=(const AssetContainerBase& p_container) = delete;
AssetContainerBase& operator=(AssetContainerBase&& p_container) = delete;
protected:
@@ -210,7 +199,6 @@ class AssetContainerBase
AssetContainerBase() = default;
AssetContainerBase(const AssetContainerBase& p_container) = delete;
AssetContainerBase(AssetContainerBase&& p_container) = delete;
/*
@@ -292,13 +280,6 @@ class AssetContainer: public AssetContainerBase
using SlotMapKey = SlotMap::SlotMapKey;
public:
AssetContainer() = default;
AssetContainer(const AssetContainer& p_container) = delete;
AssetContainer(AssetContainer&& p_container) = delete;
~AssetContainer() = default;
/*
* Inserts an Asset to the AssetContainer
*
@@ -369,9 +350,6 @@ class AssetContainer: public AssetContainerBase
AssetContainerBase::Remove(p_uuid);
}
AssetContainer& operator=(const AssetContainer& p_container) = delete;
AssetContainer& operator=(AssetContainer&& p_container) = delete;
private:
/*
* The assets
@@ -22,8 +22,6 @@ class AssetLibrary
AssetLibrary(const AssetLibrary& p_library) = default;
AssetLibrary(AssetLibrary&& p_library) = delete;
~AssetLibrary() = default;
/**
* Insert an AssetContainer pointer to the library
*
@@ -199,14 +199,6 @@ class BigFile: public DataAccessor
*/
Column(const Request& p_request, const std::uint32_t p_index);
Column(const Column& p_column) = default;
Column(Column&& p_column) = default;
~Column() = default;
Column& operator=(const Column& p_column) = default;
Column& operator=(Column&& p_column) = default;
/*
* Get value as a int32
*
@@ -24,9 +24,6 @@ class File
*/
File(const eastl::string_view p_path);
File(const File& p_path) = default;
File(File&& p_path) = default;
/**
* Check if the file is relative to the current executable
*
@@ -75,11 +72,6 @@ class File
[[nodiscard]]
File ToAbsolute() const;
~File() = default;
File& operator=(const File& p_path) = default;
File& operator=(File&& p_path) = default;
private:
/**
* Constructor
@@ -17,9 +17,6 @@ class Time
public:
Time(const std::uint64_t p_epoch);
Time(const Time& p_time) = default;
Time(Time&& p_time) = default;
[[nodiscard]]
std::uint32_t GetYear() const;
@@ -44,11 +41,6 @@ class Time
[[nodiscard]]
std::uint64_t GetEpoch() const;
~Time() = default;
Time& operator=(const Time& p_time) = default;
Time& operator=(Time&& p_time) = default;
[[nodiscard]]
bool operator==(const Time& p_other) const
{
@@ -36,9 +36,6 @@ class UUID
*/
explicit UUID(const std::span<const std::byte, UUID_BYTE_SIZE> p_raw);
UUID(const UUID& p_uuid) = default;
UUID(UUID&& p_uuid) noexcept = default;
/**
* Gets the raw bytes of a UUID
*
@@ -55,13 +52,8 @@ class UUID
[[nodiscard]]
std::string ToString() const;
~UUID() = default;
operator bool() const;
UUID& operator=(const UUID& p_uuid) = default;
UUID& operator=(UUID&& p_uuid) noexcept = default;
[[nodiscard]]
bool operator==(const UUID& p_uuid) const;
[[nodiscard]]
@@ -61,11 +61,6 @@ class SlotMapKey
{
}
constexpr SlotMapKey(const SlotMapKey& p_slotKey) = default;
constexpr SlotMapKey(SlotMapKey&& p_slotKey) = default;
constexpr ~SlotMapKey() = default;
/**
* Check if the key is valid (Version different than INVALID_VERSION)
*
@@ -99,9 +94,6 @@ class SlotMapKey
return static_cast<IndexType>(m_key & INDEX_MASK);
}
constexpr SlotMapKey& operator=(const SlotMapKey& p_slotKey) = default;
constexpr SlotMapKey& operator=(SlotMapKey&& p_slotKey) = default;
[[nodiscard]]
constexpr bool operator==(const SlotMapKey& p_other) const = default;
@@ -128,13 +120,6 @@ class DenseSlotMap
using reverse_iterator = typename eastl::vector<T>::reverse_iterator;
using const_reverse_iterator = typename eastl::vector<T>::const_reverse_iterator;
DenseSlotMap() = default;
DenseSlotMap(const DenseSlotMap&) = default;
DenseSlotMap(DenseSlotMap&&) = default;
~DenseSlotMap() = default;
/**
* Check if the map has the key
*
@@ -372,9 +357,6 @@ class DenseSlotMap
return m_data.crend();
}
DenseSlotMap& operator=(const DenseSlotMap&) = default;
DenseSlotMap& operator=(DenseSlotMap&&) = default;
private:
/**
* Does the map have free slots (ie: indices that can be recyled)
@@ -702,13 +684,6 @@ class StableSlotMap
using reverse_iterator = eastl::reverse_iterator<iterator>;
using const_reverse_iterator = eastl::reverse_iterator<const_iterator>;
StableSlotMap() = default;
StableSlotMap(const StableSlotMap& p_map) = default;
StableSlotMap(StableSlotMap&& p_map) = default;
~StableSlotMap() = default;
/**
* Check if the map has the key
*
@@ -968,9 +943,6 @@ class StableSlotMap
return rend();
}
StableSlotMap& operator=(const StableSlotMap& p_map) = default;
StableSlotMap& operator=(StableSlotMap&& p_map) = default;
private:
/**
* Does the map have free slots (ie: indices that can be recyled)
@@ -22,14 +22,6 @@ class TaggedType
{
}
constexpr TaggedType(const TaggedType& p_taggedType) = default;
constexpr TaggedType(TaggedType&& p_taggedType) noexcept = default;
~TaggedType() = default;
constexpr TaggedType& operator=(const TaggedType& p_taggedType) = default;
constexpr TaggedType& operator=(TaggedType&& p_taggedType) noexcept = default;
constexpr TaggedType& operator=(const TYPE& p_value)
{
m_value = p_value;
@@ -42,11 +42,6 @@ class Version
{
}
Version(const Version& p_version) = default;
Version(Version&& p_version) = default;
~Version() = default;
/**
* Get the major part of the version.
*
@@ -105,9 +100,6 @@ class Version
[[nodiscard]]
std::string ToString() const;
constexpr Version& operator=(const Version& p_version) = default;
constexpr Version& operator=(Version&& p_version) = default;
[[nodiscard]]
constexpr auto operator<=>(const Version& p_version) const = default;
+26 -29
View File
@@ -16,13 +16,17 @@ class ContainerHandleFixture: public ::testing::Test
protected:
void SetUp() override
{
std::ignore = m_containerA.Insert(m_asset);
m_handle = m_containerA.AcquireContainerHandle(m_asset.GetHeader().uuid);
const auto key = m_containerA.Insert();
m_uuid = m_containerA.Get(key)->GetHeader().uuid;
m_handle = m_containerA.AcquireContainerHandle(m_uuid);
}
AssetA m_asset;
AssetContainer<AssetA> m_containerA;
UUID m_uuid;
ContainerHandle* m_handle;
};
@@ -37,7 +41,7 @@ TEST_F(ContainerHandleFixture, GetAsset_ShouldReturnTheAsset)
TEST_F(ContainerHandleFixture, GetAsset_ShouldReturnNullptrIfTheAssetHasBeenRemoved)
{
m_containerA.Remove(m_asset.GetHeader().uuid);
m_containerA.Remove(m_uuid);
EXPECT_EQ(m_handle->GetAsset(), nullptr);
}
@@ -93,37 +97,33 @@ class AssetContainerFixture: public ::testing::Test
TEST_F(AssetContainerFixture, Has_ShouldReturnTrueIfTheContainerHasTheAsset)
{
AssetA asset1;
std::ignore = m_containerA.Insert(asset1);
EXPECT_TRUE(m_containerA.Has(asset1.GetHeader().uuid));
const auto key = m_containerA.Insert();
EXPECT_TRUE(m_containerA.Has(m_containerA.Get(key)->GetHeader().uuid));
}
/****************************************************************************************/
TEST_F(AssetContainerFixture, Has_ShouldReturnFalseIfTheContainerDoesNotHaveTheAsset)
{
AssetA asset1;
EXPECT_FALSE(m_containerA.Has(asset1.GetHeader().uuid));
EXPECT_FALSE(m_containerA.Has(UUID {}));
}
/****************************************************************************************/
TEST_F(AssetContainerFixture, AcquireHandle_ShouldReturnTheAssociatedContainerHandle)
{
AssetA asset1;
std::ignore = m_containerA.Insert(asset1);
const auto key = m_containerA.Insert();
const ContainerHandle* handle = m_containerA.AcquireContainerHandle(asset1.GetHeader().uuid);
EXPECT_EQ(static_cast<const AssetA*>(handle->GetAsset())->GetHeader().uuid, asset1.GetHeader().uuid);
const ContainerHandle* handle = m_containerA.AcquireContainerHandle(m_containerA.Get(key)->GetHeader().uuid);
EXPECT_EQ(static_cast<const AssetA*>(handle->GetAsset())->GetHeader().uuid,
m_containerA.Get(key)->GetHeader().uuid);
}
/****************************************************************************************/
TEST_F(AssetContainerFixture, AcquireHandle_ShouldCreateTheAssociatedContainerHandleIfItDoesNotExists)
{
AssetA asset1;
const ContainerHandle* handle = m_containerA.AcquireContainerHandle(asset1.GetHeader().uuid);
const ContainerHandle* handle = m_containerA.AcquireContainerHandle(UUID {});
EXPECT_EQ(handle->GetAsset(), nullptr);
}
@@ -131,8 +131,7 @@ TEST_F(AssetContainerFixture, AcquireHandle_ShouldCreateTheAssociatedContainerHa
TEST_F(AssetContainerFixture, Insert_ShouldReturnValidAndUniqueSlotKeyOnInsert)
{
AssetA asset1;
const SlotMapKey slotKey = m_containerA.Insert(asset1);
const SlotMapKey slotKey = m_containerA.Insert();
EXPECT_TRUE(slotKey.Valid());
EXPECT_NE(slotKey, m_containerA.Insert());
}
@@ -141,20 +140,18 @@ TEST_F(AssetContainerFixture, Insert_ShouldReturnValidAndUniqueSlotKeyOnInsert)
TEST_F(AssetContainerFixture, Insert_ShouldReturnTheSameSlotKeyInCaseOfDuplicatedUUID)
{
AssetA asset;
const SlotMapKey slotKey = m_containerA.Insert(asset);
EXPECT_EQ(slotKey, m_containerA.Insert(asset));
const SlotMapKey slotKey = m_containerA.Insert();
EXPECT_EQ(slotKey, m_containerA.Insert());
}
/****************************************************************************************/
TEST_F(AssetContainerFixture, Get_ShouldReturnTheAssetWithTheSlotKey)
{
AssetA asset;
const SlotMapKey slotKey = m_containerA.Insert(asset);
const SlotMapKey slotKey = m_containerA.Insert();
EXPECT_EQ(m_containerA.Get(slotKey)->GetHeader().uuid, asset.GetHeader().uuid);
EXPECT_EQ(std::as_const(m_containerA).Get(slotKey)->GetHeader().uuid, asset.GetHeader().uuid);
EXPECT_NE(m_containerA.Get(slotKey), nullptr);
EXPECT_NE(std::as_const(m_containerA).Get(slotKey), nullptr);
}
/****************************************************************************************/
@@ -169,12 +166,12 @@ TEST_F(AssetContainerFixture, Get_ShouldReturnNullptrIfSlotKeyNotInContainer)
TEST_F(AssetContainerFixture, Remove_ShouldRemoveTheAsset)
{
AssetA asset;
const SlotMapKey slotKey = m_containerA.Insert(asset);
const SlotMapKey slotKey = m_containerA.Insert();
const UUID uuid = m_containerA.Get(slotKey)->GetHeader().uuid;
m_containerA.Remove(asset.GetHeader().uuid);
m_containerA.Remove(uuid);
EXPECT_EQ(m_containerA.Get(slotKey), nullptr);
EXPECT_FALSE(m_containerA.Has(asset.GetHeader().uuid));
EXPECT_FALSE(m_containerA.Has(uuid));
}
} // namespace Bigfoot
+1 -1
View File
@@ -194,7 +194,7 @@ TEST_F(BigFileFixture, Has_ShouldReturnTrueIfTheAssetExists)
TEST_F(BigFileFixture, Has_ShouldReturnFalseIfTheAssetDoesNotExist)
{
EXPECT_FALSE(m_bigFile.Has(UUID{}));
EXPECT_FALSE(m_bigFile.Has(UUID {}));
}
#endif
} // namespace Bigfoot
@@ -19,16 +19,6 @@ struct AssetATraits
class AssetA: public Asset<AssetATraits>
{
public:
AssetA() = default;
AssetA(const AssetA& p_asset) = default;
AssetA(AssetA&& p_asset) = default;
~AssetA() = default;
AssetA& operator=(const AssetA& p_asset) = default;
AssetA& operator=(AssetA&& p_asset) = default;
};
} // namespace Bigfoot
@@ -19,16 +19,6 @@ struct AssetBTraits
class AssetB: public Asset<AssetBTraits>
{
public:
AssetB() = default;
AssetB(const AssetB& p_asset) = delete;
AssetB(AssetB&& p_asset) = default;
~AssetB() = default;
AssetB& operator=(const AssetB& p_asset) = delete;
AssetB& operator=(AssetB&& p_asset) = default;
};
} // namespace Bigfoot
@@ -19,16 +19,6 @@ struct AssetCTraits
class AssetC: public Asset<AssetCTraits>
{
public:
AssetC() = default;
AssetC(const AssetC& p_asset) = delete;
AssetC(AssetC&& p_asset) = default;
~AssetC() = default;
AssetC& operator=(const AssetC& p_asset) = delete;
AssetC& operator=(AssetC&& p_asset) = default;
};
} // namespace Bigfoot