| 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 |
package h; |
| 47 |
|
| 48 |
import java.util.ArrayList; |
| 49 |
import java.util.List; |
| 50 |
|
| 51 |
import smetana.core.OFFSET; |
| 52 |
import smetana.core.UnsupportedArrayOfStruct2; |
| 53 |
import smetana.core.UnsupportedStructAndPtr; |
| 54 |
import smetana.core.__array_of_ptr__; |
| 55 |
import smetana.core.__ptr__; |
| 56 |
import smetana.core.__struct__; |
| 57 |
import smetana.core.size_t; |
| 58 |
import smetana.core.amiga.StarStruct; |
| 59 |
|
| 60 |
public class ST_Agraph_s extends UnsupportedStructAndPtr { |
| 61 |
|
| 62 |
public final ST_Agobj_s base = new ST_Agobj_s(this); |
| 63 |
public final ST_Agdesc_s desc = new ST_Agdesc_s(this); |
| 64 |
public final ST_dtlink_s link = new ST_dtlink_s(this); |
| 65 |
|
| 66 |
public ST_dt_s n_seq; |
| 67 |
public ST_dt_s n_id; |
| 68 |
public ST_dt_s e_seq; |
| 69 |
public ST_dt_s e_id; |
| 70 |
public ST_dt_s g_dict; |
| 71 |
public ST_Agraph_s parent; |
| 72 |
|
| 73 |
public ST_Agraph_s root; |
| 74 |
public ST_Agclos_s clos; |
| 75 |
|
| 76 |
private final StarStruct _parent; |
| 77 |
|
| 78 |
public ST_Agraph_s() { |
| 79 |
this(null); |
| 80 |
} |
| 81 |
|
| 82 |
public ST_Agraph_s(StarStruct parent) { |
| 83 |
this._parent = parent; |
| 84 |
} |
| 85 |
|
| 86 |
public StarStruct getParent() { |
| 87 |
return _parent; |
| 88 |
} |
| 89 |
|
| 90 |
@Override |
| 91 |
public ST_Agraph_s getStruct() { |
| 92 |
return this; |
| 93 |
} |
| 94 |
|
| 95 |
@Override |
| 96 |
public void setStruct(String fieldName, __struct__ newData) { |
| 97 |
if (fieldName.equals("desc")) { |
| 98 |
desc.copyDataFrom(newData); |
| 99 |
return; |
| 100 |
} |
| 101 |
super.setStruct(fieldName, newData); |
| 102 |
} |
| 103 |
|
| 104 |
@Override |
| 105 |
public ST_Agraph_s getPtr() { |
| 106 |
return this; |
| 107 |
} |
| 108 |
|
| 109 |
public static class Array extends UnsupportedArrayOfStruct2 implements __ptr__, __array_of_ptr__ { |
| 110 |
|
| 111 |
private final List<ST_Agraph_s> data; |
| 112 |
private final int pos; |
| 113 |
|
| 114 |
@Override |
| 115 |
public void setStruct(String fieldName, __struct__ data) { |
| 116 |
getStruct().setStruct(fieldName, data); |
| 117 |
} |
| 118 |
|
| 119 |
@Override |
| 120 |
public __ptr__ castTo(Class dest) { |
| 121 |
return getStruct().castTo(dest); |
| 122 |
} |
| 123 |
|
| 124 |
@Override |
| 125 |
public void setPtr(__ptr__ value) { |
| 126 |
this.data.set(pos, (ST_Agraph_s) value); |
| 127 |
} |
| 128 |
|
| 129 |
@Override |
| 130 |
public ST_Agraph_s getPtr() { |
| 131 |
return this.data.get(pos); |
| 132 |
} |
| 133 |
|
| 134 |
@Override |
| 135 |
public Array asPtr() { |
| 136 |
return this; |
| 137 |
} |
| 138 |
|
| 139 |
@Override |
| 140 |
public ST_Agraph_s getStruct() { |
| 141 |
return data.get(pos); |
| 142 |
} |
| 143 |
|
| 144 |
public Array(int size) { |
| 145 |
this.data = new ArrayList<ST_Agraph_s>(); |
| 146 |
this.pos = 0; |
| 147 |
for (int i = 0; i < size; i++) { |
| 148 |
data.add(null); |
| 149 |
} |
| 150 |
} |
| 151 |
|
| 152 |
public Array reallocJ(int newsize) { |
| 153 |
while (data.size() < newsize) { |
| 154 |
data.add(null); |
| 155 |
} |
| 156 |
return this; |
| 157 |
} |
| 158 |
|
| 159 |
public Array plus(int delta) { |
| 160 |
return plusJ(delta); |
| 161 |
} |
| 162 |
|
| 163 |
private Array(List<ST_Agraph_s> data, int pos) { |
| 164 |
this.data = data; |
| 165 |
this.pos = pos; |
| 166 |
} |
| 167 |
|
| 168 |
public ST_Agraph_s get(int i) { |
| 169 |
return this.data.get(pos + i); |
| 170 |
} |
| 171 |
|
| 172 |
public Array plusJ(int i) { |
| 173 |
return new Array(data, pos + i); |
| 174 |
} |
| 175 |
|
| 176 |
public int minus(Array other) { |
| 177 |
if (this.data != other.data) { |
| 178 |
throw new IllegalArgumentException(); |
| 179 |
} |
| 180 |
return this.pos - other.pos; |
| 181 |
} |
| 182 |
|
| 183 |
public Array move(int delta) { |
| 184 |
throw new UnsupportedOperationException(getClass().toString()); |
| 185 |
} |
| 186 |
|
| 187 |
public void realloc(size_t nb) { |
| 188 |
throw new UnsupportedOperationException(getClass().toString()); |
| 189 |
} |
| 190 |
|
| 191 |
public int comparePointerInternal(__array_of_ptr__ other) { |
| 192 |
throw new UnsupportedOperationException(getClass().toString()); |
| 193 |
} |
| 194 |
|
| 195 |
} |
| 196 |
|
| 197 |
@Override |
| 198 |
public Object addVirtualBytes(int virtualBytes) { |
| 199 |
if (virtualBytes == 0) { |
| 200 |
return this; |
| 201 |
} |
| 202 |
OFFSET offset = OFFSET.fromInt(virtualBytes); |
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
if (offset.toString().equals("h.ST_Agraph_s::link")) { |
| 207 |
return link; |
| 208 |
} |
| 209 |
System.err.println("offset156=" + offset); |
| 210 |
return super.addVirtualBytes(virtualBytes); |
| 211 |
} |
| 212 |
|
| 213 |
@Override |
| 214 |
public __ptr__ setPtr(String fieldName, __ptr__ newData) { |
| 215 |
if (fieldName.equals("clos")) { |
| 216 |
this.clos = (ST_Agclos_s) newData; |
| 217 |
return clos; |
| 218 |
} |
| 219 |
if (fieldName.equals("root")) { |
| 220 |
this.root = (ST_Agraph_s) newData; |
| 221 |
return root; |
| 222 |
} |
| 223 |
if (fieldName.equals("n_seq")) { |
| 224 |
this.n_seq = (ST_dt_s) newData; |
| 225 |
return n_seq; |
| 226 |
} |
| 227 |
if (fieldName.equals("n_id")) { |
| 228 |
this.n_id = (ST_dt_s) newData; |
| 229 |
return n_id; |
| 230 |
} |
| 231 |
if (fieldName.equals("e_seq")) { |
| 232 |
this.e_seq = (ST_dt_s) newData; |
| 233 |
return e_seq; |
| 234 |
} |
| 235 |
if (fieldName.equals("e_id")) { |
| 236 |
this.e_id = (ST_dt_s) newData; |
| 237 |
return e_id; |
| 238 |
} |
| 239 |
if (fieldName.equals("g_dict")) { |
| 240 |
this.g_dict = (ST_dt_s) newData; |
| 241 |
return g_dict; |
| 242 |
} |
| 243 |
if (fieldName.equals("parent")) { |
| 244 |
this.parent = (ST_Agraph_s) newData; |
| 245 |
return parent; |
| 246 |
} |
| 247 |
return super.setPtr(fieldName, newData); |
| 248 |
} |
| 249 |
|
| 250 |
@Override |
| 251 |
public __ptr__ castTo(Class dest) { |
| 252 |
if (dest == ST_Agobj_s.class) { |
| 253 |
return base; |
| 254 |
} |
| 255 |
if (dest == ST_Agraph_s.class) { |
| 256 |
return this; |
| 257 |
} |
| 258 |
return super.castTo(dest); |
| 259 |
} |
| 260 |
|
| 261 |
public ST_Agobj_s castTo_ST_Agobj_s() { |
| 262 |
return base; |
| 263 |
} |
| 264 |
|
| 265 |
@Override |
| 266 |
public boolean isSameThan(StarStruct other) { |
| 267 |
ST_Agraph_s other2 = (ST_Agraph_s) other; |
| 268 |
return this == other2; |
| 269 |
} |
| 270 |
|
| 271 |
public StarStruct from_link(ST_dtlink_s from) { |
| 272 |
if (from == link) { |
| 273 |
return this; |
| 274 |
} |
| 275 |
throw new IllegalArgumentException(); |
| 276 |
} |
| 277 |
|
| 278 |
|
| 279 |
|
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
|
| 293 |
} |
| 294 |
|
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
|
| 299 |
|
| 300 |
|
| 301 |
|
| 302 |
|
| 303 |
|
| 304 |
|
| 305 |
|