##// END OF EJS Templates
Variable update signal forwards variable ID...
Variable update signal forwards variable ID Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

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