20 #ifndef INCLUDED_SC_INC_LOOKUPCACHE_HXX
21 #define INCLUDED_SC_INC_LOOKUPCACHE_HXX
27 #include <unordered_map>
73 if (mbAlloc && mbString)
90 mbAlloc = mbString =
false;
97 mbAlloc = mbString =
true;
98 mpStr =
new OUString( rStr);
121 const QueryCriteria & rCriteria,
124 SCROW lookup(
const QueryCriteria & rCriteria )
const;
133 const QueryCriteria & rCriteria,
135 const bool bAvailable );
159 mnRow( rAddress.
Row()),
160 mnTab( rAddress.
Tab()),
174 return (static_cast<size_t>(r.
mnTab) << 24) ^
175 (
static_cast<size_t>(r.
meOp) << 22) ^
176 static_cast<size_t>(r.
mnRow);
187 maCriteria( rCriteria),
193 std::unordered_map< QueryKey, QueryCriteriaAndResult, QueryKey::Hash >
maQueryMap;
ScLookupCacheMap & mCacheMap
virtual ~ScLookupCache() override
QueryKey(const ScAddress &rAddress, const QueryOp eOp)
size_t hashStartColumn() const
Hash start column and start and end rows.
Query not found in cache.
Different criteria for same query position exists.
size_t operator()(const QueryKey &r) const
Lookup cache for one range used with interpreter functions such as VLOOKUP and MATCH.
virtual void Notify(const SfxHint &rHint) override
Remove from document structure and delete (!) cache on modify hint.
QueryOp getQueryOp() const
QueryCriteria(const ScQueryEntry &rEntry)
QueryCriteriaAndResult(const QueryCriteria &rCriteria, const ScAddress &rAddress)
const ScRange & getRange() const
QueryCriteria & operator=(const QueryCriteria &r)=delete
bool insert(const ScAddress &rResultAddress, const QueryCriteria &rCriteria, const ScAddress &rQueryAddress, const bool bAvailable)
Insert query and result.
void setString(const OUString &rStr)
ScLookupCache(ScDocument *pDoc, const ScRange &rRange, ScLookupCacheMap &cacheMap)
MUST be new'd because Notify() deletes.
bool operator==(const QueryCriteria &r) const
ScLookupCacheMap & getCacheMap() const
std::unordered_map< ScRange, std::unique_ptr< ScLookupCache >, ScLookupCache::Hash > aCacheMap
size_t operator()(const ScRange &rRange) const
Criteria not available in lookup range.
ScLookupCache & operator=(const ScLookupCache &)=delete
Result lookup(ScAddress &o_rResultAddress, const QueryCriteria &rCriteria, const ScAddress &rQueryAddress) const
bool isEmptyStringQuery() const
void setDouble(double fVal)
bool operator==(const QueryKey &r) const
Each instance of this struct represents a single filtering criteria.
std::unordered_map< QueryKey, QueryCriteriaAndResult, QueryKey::Hash > maQueryMap