-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexecutor.h
52 lines (39 loc) · 1.04 KB
/
executor.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
#ifndef PLC_EMULATOR__EXECUTOR_H_
#define PLC_EMULATOR__EXECUTOR_H_
#include <vector>
#include <unordered_map>
#include "variable.h"
#include "pou_container.h"
namespace plc_emulator {
class Config;
class ResourceImpl;
class Task;
class Executor {
private:
ConfigImpl *config_;
Variable *exec_pou_var_;
ResourceImpl *associated_resource_;
PouContainer *code_container_;
bool initialized_;
Task *associated_task_;
public:
Executor(ConfigImpl *config,
ResourceImpl *associated_resource,
Task *associated_task)
: config_(config),
exec_pou_var_(nullptr),
associated_resource_(associated_resource),
code_container_(nullptr),
initialized_(false),
associated_task_(associated_task) {};
void SetExecPouVariable(Variable *exec_pou_var);
void Run();
void Cleanup();
void RunInstruction(InstructionContainer &instruction_container);
bool IsCrSet();
void SaveCpuRegisters();
void RestoreCpuRegisters();
void ResetCpuRegisters();
};
}
#endif //PLC_EMULATOR__EXECUTOR_H_