##// END OF EJS Templates
Changes structure of data hold by the item...
Changes structure of data hold by the item - The data are now set as a QHash instead of a QVector. Each data has a QVariant value and is associated to a key - Changes the constructor and adds a constructor that takes only a name

File last commit:

r331:d786589b2e4c
r342:2fbf66a7ca8a
Show More
VariableCacheController.h
46 lines | 1.3 KiB | text/x-c | CLexer
/ core / include / Variable / VariableCacheController.h
#ifndef SCIQLOP_VARIABLECACHECONTROLLER_H
#define SCIQLOP_VARIABLECACHECONTROLLER_H
#include <QLoggingCategory>
#include <QObject>
#include <Data/SqpDateTime.h>
#include <QLoggingCategory>
#include <Common/spimpl.h>
Q_DECLARE_LOGGING_CATEGORY(LOG_VariableCacheController)
class Variable;
Q_DECLARE_LOGGING_CATEGORY(LOG_VariableCacheController)
/// This class aims to store in the cache all of the dateTime already requested to the variable.
class VariableCacheController : public QObject {
Q_OBJECT
public:
explicit VariableCacheController(QObject *parent = 0);
void addDateTime(std::shared_ptr<Variable> variable, const SqpDateTime &dateTime);
/// Clears cache concerning a variable
void clear(std::shared_ptr<Variable> variable) noexcept;
/// Return all of the SqpDataTime part of the dateTime whose are not in the cache
QVector<SqpDateTime> provideNotInCacheDateTimeList(std::shared_ptr<Variable> variable,
const SqpDateTime &dateTime);
QVector<SqpDateTime> dateCacheList(std::shared_ptr<Variable> variable) const noexcept;
void displayCache(std::shared_ptr<Variable> variable) const;
private:
class VariableCacheControllerPrivate;
spimpl::unique_impl_ptr<VariableCacheControllerPrivate> impl;
};
#endif // SCIQLOP_VARIABLECACHECONTROLLER_H