#pragma once #include #include #include #include #include namespace pdfengine { class OCRCache { public: static OCRCache& instance(); void put(const std::string& imageHash, const OCRPage& ocrPage); [[nodiscard]] std::optional get(const std::string& imageHash) const; void clear(); [[nodiscard]] size_t size() const; private: OCRCache() = default; mutable std::mutex m_mutex; std::unordered_map m_cache; }; } // namespace pdfengine