-
Notifications
You must be signed in to change notification settings - Fork 0
/
EnumDefinition.java
103 lines (82 loc) · 2.3 KB
/
EnumDefinition.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package com.destranix.glslang;
import com.destranix.glslang.Main.String_Int;
public class EnumDefinition extends EnumParameters {
private final int constructorIndex;
public EnumDefinition() {
super(PoisonClass.singleton);
this.constructorIndex = 0;
load();
}
protected EnumDefinition(byte[] ptr) {
super(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.EnumDefinition();
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 set(int ceil, String_Int name, byte[] ep) {
Main.EnumDefinition_set(ptr, ceil, name, ep);
}
public void set(int ceil, String_Int name, byte[] ep, boolean mask) {
Main.EnumDefinition_set(ptr, ceil, name, ep, mask);
}
public void setOperands(OperandParameters op) {
Main.EnumDefinition_setOperands(ptr, op.getPtr());
}
public void setCeiling(int v) {
Main.EnumDefinition_setCeiling(ptr, v);
}
public void setBitmask(boolean v) {
Main.EnumDefinition_setBitmask(ptr, v);
}
public void setGetName(String_Int v) {
Main.EnumDefinition_setGetName(ptr, v);
}
public void setEnumParams(EnumParameters v) {
Main.EnumDefinition_setEnumParams(ptr, v.getPtr());
}
public void setOperandParams(OperandParameters v) {
Main.EnumDefinition_setOperandParams(ptr, v.getPtr());
}
public int getCeiling() {
return Main.EnumDefinition_getCeiling(ptr);
}
public boolean getBitmask() {
return Main.EnumDefinition_getBitmask(ptr);
}
public String_Int getGetName() {
return fromPtr(Main.EnumDefinition_getGetName(ptr), Main.CString_Int.class);
}
public EnumParameters getEnumParams() {
return fromPtr(Main.EnumDefinition_getEnumParams(ptr), EnumParameters.class);
}
public OperandParameters getOperandParams() {
return fromPtr(Main.EnumDefinition_getOperandParams(ptr), OperandParameters.class);
}
}