SlotMap benchmark
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 5m20s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 5m17s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 5m55s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Has been cancelled
Bigfoot / Clang Format Checks (push) Has been cancelled
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Has been cancelled

This commit is contained in:
2026-05-16 01:53:43 +02:00
parent acdbfb505e
commit 943597202b
8 changed files with 649 additions and 241 deletions
@@ -19,7 +19,7 @@ namespace Bigfoot
template<class TYPE,
class VERSION_TYPE = std::uint32_t,
class INDEX_TYPE = std::uint32_t,
std::enable_if_t<std::is_integral_v<VERSION_TYPE> && std::is_integral_v<INDEX_TYPE>, bool> = true>
std::enable_if_t<std::is_unsigned_v<VERSION_TYPE> && std::is_unsigned_v<INDEX_TYPE>, bool> = true>
class SlotMap
{
public:
@@ -43,42 +43,42 @@ class SlotMap
static constexpr IndexType MAX_INDEX = std::numeric_limits<IndexType>::max();
SlotKey(const VersionType p_version, const IndexType p_index):
constexpr SlotKey(const VersionType p_version, const IndexType p_index):
m_key((static_cast<std::uint64_t>(p_version) << INDEX_BIT_COUNT) |
(static_cast<std::uint64_t>(p_index) & INDEX_MASK))
{
}
SlotKey():
constexpr SlotKey():
SlotKey(INVALID_VERSION, 0)
{
}
SlotKey(const SlotKey& p_slotKey) = default;
SlotKey(SlotKey&& p_slotKey) = default;
constexpr SlotKey(const SlotKey& p_slotKey) = default;
constexpr SlotKey(SlotKey&& p_slotKey) = default;
~SlotKey() = default;
constexpr ~SlotKey() = default;
bool Valid() const
constexpr bool Valid() const
{
return Version() != INVALID_VERSION;
}
VersionType Version() const
constexpr VersionType Version() const
{
return static_cast<VersionType>(m_key >> INDEX_BIT_COUNT);
}
IndexType Index() const
constexpr IndexType Index() const
{
return static_cast<IndexType>(m_key & INDEX_MASK);
}
SlotKey& operator=(const SlotKey& p_slotKey) = default;
SlotKey& operator=(SlotKey&& p_slotKey) = default;
constexpr SlotKey& operator=(const SlotKey& p_slotKey) = default;
constexpr SlotKey& operator=(SlotKey&& p_slotKey) = default;
[[nodiscard]]
bool operator==(const SlotKey& p_other) const = default;
constexpr bool operator==(const SlotKey& p_other) const = default;
private:
std::uint64_t m_key;