##// END OF EJS Templates
Added basic cache tests for new VC...
Added basic cache tests for new VC Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r10:1c3b4c2c9c11
r11:d2d15e1be6f5
Show More
ProportionalCacheStrategy.h
24 lines | 849 B | text/x-c | CLexer
/ include / Variable / ProportionalCacheStrategy.h
#ifndef SCIQLOP_VARIABLESINGLETHRESHOLDCACHESTRATEGY_H
#define SCIQLOP_VARIABLESINGLETHRESHOLDCACHESTRATEGY_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_VARIABLESINGLETHRESHOLDCACHESTRATEGY_H