ProportionalCacheStrategy.h
24 lines
| 816 B
| text/x-c
|
CLexer
r12 | #ifndef SCIQLOP_PROPORTIONALCACHESTRATEGY_H | |||
#define SCIQLOP_PROPORTIONALCACHESTRATEGY_H | ||||
r0 | ||||
#include "Settings/SqpSettingsDefs.h" | ||||
#include "VariableCacheStrategy.h" | ||||
/// This class aims to hande the cache strategy. | ||||
r9 | class SCIQLOP_CORE_EXPORT ProportionalCacheStrategy : public VariableCacheStrategy { | |||
r0 | public: | |||
r9 | ProportionalCacheStrategy() = default; | |||
r0 | ||||
r9 | DateTimeRange computeRange(const DateTimeRange ¤tCacheRange, | |||
r0 | const DateTimeRange &rangeRequested) override | |||
{ | ||||
r9 | Q_UNUSED(currentCacheRange); | |||
r0 | auto toleranceFactor = SqpSettings::toleranceValue( | |||
GENERAL_TOLERANCE_AT_UPDATE_KEY, GENERAL_TOLERANCE_AT_UPDATE_DEFAULT_VALUE); | ||||
r10 | return rangeRequested*(1.+toleranceFactor); | |||
r0 | } | |||
}; | ||||
r12 | #endif // SCIQLOP_PROPORTIONALCACHESTRATEGY_H | |||