forked from jacyara/GenESyS-Reborn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Assign.h
79 lines (69 loc) · 1.92 KB
/
Assign.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Assign.h
* Author: cancian
*
* Created on 31 de Agosto de 2018, 10:10
*/
#ifndef ASSIGN_H
#define ASSIGN_H
#include "ModelComponent.h"
#include "Model.h"
class Assign : public ModelComponent {
public:
enum class DestinationType { /* TODO: +- an enun is not a good idea. Should be a list of possible classes, so TypeOf could be set */
Attribute, Variable
};
class Assignment {
public:
Assignment(DestinationType destinationType, std::string destination, std::string expression) {
this->_destinationType = destinationType;
this->_destination = destination;
this->_expression = expression;
};
public:
void setDestination(std::string _destination) {
this->_destination = _destination;
}
std::string getDestination() const {
return _destination;
}
void setDestinationType(DestinationType _destinationType) {
this->_destinationType = _destinationType;
}
DestinationType getDestinationType() const {
return _destinationType;
}
void setExpression(std::string _expression) {
this->_expression = _expression;
}
std::string getExpression() const {
return _expression;
}
private:
DestinationType _destinationType = DestinationType::Attribute;
std::string _destination = "";
std::string _expression = "";
};
public:
Assign(Model* model);
Assign(const Assign& orig);
virtual ~Assign();
public:
virtual std::string show();
public:
List<Assignment*>* getAssignments() const;
protected:
virtual void _execute(Entity* entity);
virtual void _loadInstance(std::list<std::string> words);
virtual std::list<std::string>* _saveInstance();
virtual bool _verifySymbols(std::string* errorMessage);
private:
private:
List<Assignment*>* _assignments = new List<Assignment*>();
};
#endif /* ASSIGN_H */