Add evaluator
diff --git a/ide/Cell.cpp b/ide/Cell.cpp
index 2fd964b..c49466d 100644
--- a/ide/Cell.cpp
+++ b/ide/Cell.cpp
@@ -1,8 +1,15 @@
#include "Cell.h"
+QHash<QUuid, Cell *> Cell::_cellUuids = QHash<QUuid, Cell*>();
+
+Cell::~Cell()
+{
+ _cellUuids.remove(_uuid);
+}
+
Cell::Cell(QObject *parent) : QObject(parent)
{
-
+ _cellUuids[_uuid] = this;
}
Cell::Cell(const Cell ©, QObject *parent)
@@ -36,6 +43,16 @@
return _result;
}
+QUuid Cell::uuid() const
+{
+ return _uuid;
+}
+
+int Cell::status() const
+{
+ return _status;
+}
+
void Cell::setCode(QString code)
{
_code = code;
@@ -47,3 +64,17 @@
_result = result;
emit resultChanged(result);
}
+
+void Cell::setStatus(int status)
+{
+ _status = status;
+ emit statusChanged(status);
+}
+
+Cell *Cell::cellFromUuid(QUuid uuid)
+{
+ if (_cellUuids.contains(uuid))
+ return _cellUuids[uuid];
+ else
+ return nullptr;
+}