-
Notifications
You must be signed in to change notification settings - Fork 0
/
InstructionParameters.java
84 lines (68 loc) · 1.85 KB
/
InstructionParameters.java
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
79
80
81
82
83
84
package com.destranix.glslang;
public class InstructionParameters extends PointerBoundObject {
private final int constructorIndex;
public InstructionParameters() {
this.constructorIndex = 0;
load();
}
protected InstructionParameters(byte[] ptr) {
this.ptr = ptr;
this.constructorIndex = -1;
}
@Override
protected void load_intern() {
if (ptr == null) {
switch (constructorIndex) {
case -1:
throw new IllegalStateException(EXCEPTION_MSG_NOT_LOADABLE);
case 0:
ptr = Main.InstructionParameters();
break;
default:
throw new AssertionError("Reached unreachable state!");
}
}
}
@Override
protected void free_intern() {
if (ptr != null) {
switch (constructorIndex) {
case -1:
throw new IllegalStateException(EXCEPTION_MSG_NOT_FREEABLE);
case 0:
Main.delete(ptr);
ptr = null;
break;
default:
throw new AssertionError("Reached unreachable state!");
}
}
}
public void setResultAndType(boolean r, boolean t) {
Main.InstructionParameters_setResultAndType(ptr, r, t);
}
public boolean hasResult() {
return Main.InstructionParameters_hasResult(ptr);
}
public boolean hasType() {
return Main.InstructionParameters_hasType(ptr);
}
public void setOpDesc(String v) {
Main.InstructionParameters_setOpDesc(ptr, v);
}
public void setOpClass(OperandClass v) {
Main.InstructionParameters_setOpClass(ptr, v.getConstant());
}
public void setOperands(OperandParameters v) {
Main.InstructionParameters_setOperands(ptr, v.getPtr());
}
public String getOpDesc() {
return Main.InstructionParameters_getOpDesc(ptr);
}
public OperandClass getOpClass() {
return OperandClass.valueByConstant(Main.InstructionParameters_getOpClass(ptr));
}
public OperandParameters getOperands() {
return fromPtr(Main.InstructionParameters_getOperands(ptr), OperandParameters.class);
}
}