##// END OF EJS Templates
Wait for the end of an acquisition to validate an operation (3)...
Wait for the end of an acquisition to validate an operation (3) If an operation is to validate, waits the end of the acquisition

File last commit:

r1004:15899f42a907
r1248:7541b71e5b78
Show More
VariableCacheStrategyFactory.h
46 lines | 1.3 KiB | text/x-c | CLexer
/ core / include / Variable / VariableCacheStrategyFactory.h
Alexandre Leroux
Updates cache strategy
r771 #ifndef SCIQLOP_VARIABLECACHESTRATEGYFACTORY_H
#define SCIQLOP_VARIABLECACHESTRATEGYFACTORY_H
#include <memory>
#include <stdexcept>
#include "VariableCacheStrategy.h"
#include "VariableSingleThresholdCacheStrategy.h"
#include <QLoggingCategory>
#include <QString>
Q_LOGGING_CATEGORY(LOG_VariableCacheStrategyFactory, "VariableCacheStrategyFactory")
enum class CacheStrategy { SingleThreshold, TwoThreashold };
class VariableCacheStrategyFactory {
using cacheStratPtr = std::unique_ptr<VariableCacheStrategy>;
public:
static cacheStratPtr createCacheStrategy(CacheStrategy specificStrategy)
{
switch (specificStrategy) {
case CacheStrategy::SingleThreshold: {
return std::unique_ptr<VariableCacheStrategy>{
new VariableSingleThresholdCacheStrategy{}};
break;
}
case CacheStrategy::TwoThreashold: {
qCCritical(LOG_VariableCacheStrategyFactory())
<< QObject::tr("cache strategy not implemented yet");
break;
}
default:
qCCritical(LOG_VariableCacheStrategyFactory())
<< QObject::tr("Unknown cache strategy");
}
Alexandre Leroux
Removes compilation warnings (with Meson)
r1004
return nullptr;
Alexandre Leroux
Updates cache strategy
r771 }
};
#endif // VARIABLECACHESTRATEGYFACTORY_H