mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-12-25 10:01:38 +08:00
added missing #include
This commit is contained in:
parent
29bdaad85b
commit
56ecb35ce9
@ -33,6 +33,7 @@
|
|||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <memory>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
/** \brief tag type to configure JKQTPDataCache for thread-safety
|
/** \brief tag type to configure JKQTPDataCache for thread-safety
|
||||||
@ -106,7 +107,7 @@ struct JKQTPDataCache {
|
|||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
if (m_maxEntries>0 && m_cache.size()>=static_cast<size_t>(m_maxEntries)) cleanCache_notThreadSafe();
|
if (m_maxEntries>0 && m_cache.size()>=static_cast<size_t>(m_maxEntries)) cleanCache_notThreadSafe();
|
||||||
m_cacheLastUseTimestamps.emplace(cacheKey, std::make_shared<std::atomic<int64_t>>(currenTimestamp()));
|
m_cacheLastUseTimestamps.emplace(cacheKey, std::make_shared<std::atomic<int64_t> >(currenTimestamp()));
|
||||||
const auto newData=m_generateData(key);
|
const auto newData=m_generateData(key);
|
||||||
m_cache.emplace(cacheKey,newData);
|
m_cache.emplace(cacheKey,newData);
|
||||||
return newData;
|
return newData;
|
||||||
@ -124,7 +125,7 @@ struct JKQTPDataCache {
|
|||||||
if (m_maxEntries>0 && m_cache.size()>=static_cast<size_t>(m_maxEntries)) cleanCache_notThreadSafe();
|
if (m_maxEntries>0 && m_cache.size()>=static_cast<size_t>(m_maxEntries)) cleanCache_notThreadSafe();
|
||||||
const auto newData=m_generateData(key);
|
const auto newData=m_generateData(key);
|
||||||
m_cache.emplace(cacheKey,newData);
|
m_cache.emplace(cacheKey,newData);
|
||||||
m_cacheLastUseTimestamps.emplace(cacheKey, std::make_shared<std::atomic<int64_t>>(currenTimestamp()));
|
m_cacheLastUseTimestamps.emplace(cacheKey, std::make_shared<std::atomic<int64_t> >(currenTimestamp()));
|
||||||
return newData;
|
return newData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,7 +183,7 @@ private:
|
|||||||
const int m_maxEntries;
|
const int m_maxEntries;
|
||||||
const double m_retainFraction;
|
const double m_retainFraction;
|
||||||
std::unordered_map<TKey, TData> m_cache;
|
std::unordered_map<TKey, TData> m_cache;
|
||||||
std::unordered_map<TKey, std::shared_ptr<std::atomic<int64_t>>> m_cacheLastUseTimestamps;
|
std::unordered_map<TKey, std::shared_ptr<std::atomic<int64_t> > > m_cacheLastUseTimestamps;
|
||||||
mutable QReadWriteLock m_mutex;
|
mutable QReadWriteLock m_mutex;
|
||||||
const std::function<TData(TKeyInSignature)> m_generateData;
|
const std::function<TData(TKeyInSignature)> m_generateData;
|
||||||
};
|
};
|
||||||
|
@ -137,7 +137,7 @@ JKQTPExpected<QColor, JKQTPCSSParser::GeneralError> JKQTPCSSParser::parseColor(b
|
|||||||
return {JKQTPUnexpected, UnconvertobleError("#"+hex, "HEX-RGB value", pos) };
|
return {JKQTPUnexpected, UnconvertobleError("#"+hex, "HEX-RGB value", pos) };
|
||||||
}
|
}
|
||||||
} else if (CurrentToken.is(Token::TokenType::NAME)) {
|
} else if (CurrentToken.is(Token::TokenType::NAME)) {
|
||||||
static QMap<QString,QPair<int,int>> rgbFuncs={
|
static QMap<QString,QPair<int,int> > rgbFuncs={
|
||||||
{"rgb", QPair<int,int>(3,4)},
|
{"rgb", QPair<int,int>(3,4)},
|
||||||
{"rgba",QPair<int,int>(4,4)},
|
{"rgba",QPair<int,int>(4,4)},
|
||||||
{"hsl",QPair<int,int>(3,4)},
|
{"hsl",QPair<int,int>(3,4)},
|
||||||
|
Loading…
Reference in New Issue
Block a user