-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjoblist.h
More file actions
66 lines (49 loc) · 1.61 KB
/
joblist.h
File metadata and controls
66 lines (49 loc) · 1.61 KB
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
/*
<one line to give the library's name and an idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef JOBLIST_H
#define JOBLIST_H
#define SLAVENAME "slave"
#include <vector>
typedef unsigned int uint;
enum Instr { SET = 0x1, GET = 0x2, REGSET = 0x4, INC = 0x8, ADD = 0x10, PRINT = 0x20, WAIT = 0x40, GET_RESP = 0x80, MARKER = 0x100 };
enum MsgId { INIT = 0x1, RESUME = 0x2, NORMAL = 0x4, STATE = 0x8 };
enum WaitFor { WAIT_NONE = 0, WAIT_GET = 0x1, WAIT_VAL = 0x2 };
struct Oper {
Instr instr;
int arg;
};
struct Msg {
uint who;
uint laport;
Oper oper;
};
struct HaltState {
int instrNo;
int halt;
uint lamport;
uint obj;
uint reg;
};
class JobList : public std::vector<Oper> {
public:
JobList();
/**
* Metoda przepisująca bufor (adres) do wektora
*/
void fill(Oper *buffer, size_t n);
const Oper *data();
};
#endif // JOBLIST_H