##// END OF EJS Templates
Fixed tests due to async var creation, plus minor stuff...
Fixed tests due to async var creation, plus minor stuff A variable is created synchronously but its data is get in background so tests have now to wait until the variable is ready before checking its state. VC should have a [] operator, it's a model feature. The new data provider interface implies that each call only ask for one range, this has been reflected in its parameters. Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r30:02d2d8643fcb
r30:02d2d8643fcb
Show More
VariableController2.h
51 lines | 1.6 KiB | text/x-c | CLexer
#ifndef VARIABLECONTROLLER2_H
#define VARIABLECONTROLLER2_H
#include <memory>
#include <vector>
#include <set>
#include <QHash>
#include <QObject>
#include <QMutexLocker>
#include <QUuid>
#include <QByteArray>
#include <QItemSelectionModel>
#include <Common/spimpl.h>
#include <Variable/Variable.h>
#include <Data/IDataProvider.h>
#include "Data/DateTimeRange.h"
class VariableController2: public QObject
{
class VariableController2Private;
Q_OBJECT
spimpl::unique_impl_ptr<VariableController2Private> impl;
public:
explicit VariableController2();
std::shared_ptr<Variable> createVariable(const QString &name, const QVariantHash &metadata,
const std::shared_ptr<IDataProvider>& provider,
const DateTimeRange &range);
std::shared_ptr<Variable> cloneVariable(const std::shared_ptr<Variable>& variable);
void deleteVariable(const std::shared_ptr<Variable>& variable);
void changeRange(const std::shared_ptr<Variable>& variable, const DateTimeRange& r);
void asyncChangeRange(const std::shared_ptr<Variable>& variable, const DateTimeRange& r);
const std::vector<std::shared_ptr<Variable>> variables();
bool isReady(const std::shared_ptr<Variable>& variable);
bool isReady();
void synchronize(const std::shared_ptr<Variable>& var, const std::shared_ptr<Variable>& with);
const std::vector<std::shared_ptr<Variable>> variables(const std::vector<QUuid>& ids);
signals:
void variableAdded(const std::shared_ptr<Variable>&);
void variableDeleted(const std::shared_ptr<Variable>&);
};
#endif //VARIABLECONTROLLER2_H