VariableController.h
51 lines
| 1.3 KiB
| text/x-c
|
CLexer
Alexandre Leroux
|
r106 | #ifndef SCIQLOP_VARIABLECONTROLLER_H | ||
#define SCIQLOP_VARIABLECONTROLLER_H | ||||
#include <QLoggingCategory> | ||||
#include <QObject> | ||||
#include <Common/spimpl.h> | ||||
Alexandre Leroux
|
r154 | class IDataProvider; | ||
r179 | class TimeController; | |||
Alexandre Leroux
|
r108 | class Variable; | ||
Alexandre Leroux
|
r143 | class VariableModel; | ||
Alexandre Leroux
|
r106 | Q_DECLARE_LOGGING_CATEGORY(LOG_VariableController) | ||
/** | ||||
* @brief The VariableController class aims to handle the variables in SciQlop. | ||||
*/ | ||||
class VariableController : public QObject { | ||||
Q_OBJECT | ||||
public: | ||||
explicit VariableController(QObject *parent = 0); | ||||
virtual ~VariableController(); | ||||
Alexandre Leroux
|
r154 | VariableModel *variableModel() noexcept; | ||
r179 | void setTimeController(TimeController *timeController) noexcept; | |||
Alexandre Leroux
|
r154 | signals: | ||
/// Signal emitted when a variable has been created | ||||
void variableCreated(std::shared_ptr<Variable> variable); | ||||
public slots: | ||||
Alexandre Leroux
|
r108 | /** | ||
Alexandre Leroux
|
r154 | * Creates a new variable and adds it to the model | ||
Alexandre Leroux
|
r108 | * @param name the name of the new variable | ||
Alexandre Leroux
|
r154 | * @param provider the data provider for the new variable | ||
Alexandre Leroux
|
r108 | */ | ||
Alexandre Leroux
|
r154 | void createVariable(const QString &name, std::shared_ptr<IDataProvider> provider) noexcept; | ||
Alexandre Leroux
|
r108 | |||
Alexandre Leroux
|
r106 | void initialize(); | ||
void finalize(); | ||||
private: | ||||
void waitForFinish(); | ||||
class VariableControllerPrivate; | ||||
spimpl::unique_impl_ptr<VariableControllerPrivate> impl; | ||||
}; | ||||
#endif // SCIQLOP_VARIABLECONTROLLER_H | ||||