#pragma once #include struct StringCache { TP_NOCOPYMOVE(StringCache); [[nodiscard]] bool Contains(const TiltedPhoques::String&) const noexcept; [[nodiscard]] std::optional operator[](const TiltedPhoques::String&) const noexcept; [[nodiscard]] std::optional operator[](uint32_t) const noexcept; uint32_t Add(const TiltedPhoques::String&) noexcept; [[nodiscard]] void AddWanted(const TiltedPhoques::String&) noexcept; [[nodiscard]] size_t Size() const noexcept; [[nodiscard]] StringCacheUpdate Serialize(uint32_t& aStartId) const noexcept; [[nodiscard]] void Deserialize(const StringCacheUpdate& aMessage) noexcept; void Clear() noexcept; bool ProcessDirty() noexcept; void ClearDirty() noexcept; static StringCache& Get() noexcept; private: TiltedPhoques::Vector m_idToString; mutable TiltedPhoques::Set m_wantedStrings; TiltedPhoques::Map m_stringToId; StringCache(); };