-
Notifications
You must be signed in to change notification settings - Fork 1
/
transition.h
60 lines (54 loc) · 1.87 KB
/
transition.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
/*!
* \file transition.h
* \author Simon Coakley
* \date 2012
* \copyright Copyright (c) 2012 University of Sheffield
* \brief Header file for transition function
*/
#ifndef TRANSITION_H_
#define TRANSITION_H_
#include "./mpre.h"
#include "./mpost.h"
#include "./state.h"
#include "./memorymodel.h"
#include "./condition.h"
#include "./communication.h"
class Transition {
public:
Transition();
Transition(State * cs, QString n, State * ns);
Transition(State * cs, Communication i, Mpre pre,
QString n, Mpost post, Communication o, State * ns);
void setCurrentState(State * cs) { myCurrentState = cs; }
State * currentState() const { return myCurrentState; }
void setInput(Communication i) { myInput = i; }
Communication input() const { return myInput; }
void setMpre(Mpre pre) { myMpre = pre; }
Mpre mpre() const { return myMpre; }
void setName(QString n) { myName = n; }
QString name() const { return myName; }
void setMpost(Mpost post) { myMpost = post; }
Mpost mpost() const { return myMpost; }
void setOutput(Communication o) { myOutput = o; }
Communication output() const { return myOutput; }
void setNextState(State * ns) { myNextState = ns; }
State * nextState() const { return myNextState; }
Mpre * getMprePointer() { return &myMpre; }
void setCondition(Condition c) { myCondition = c; }
Condition condition() const { return myCondition; }
void setDescription(QString s) { myDescription = s; }
QString description() const { return myDescription; }
bool passesCondition(MemoryModel * memory);
void updateMemory(MemoryModel * memory);
private:
State * myCurrentState;
Communication myInput;
Mpre myMpre;
QString myName;
Mpost myMpost;
Communication myOutput;
State * myNextState;
Condition myCondition;
QString myDescription;
};
#endif // TRANSITION_H_