/[gr2lib]/trunk/gr2lib/typedefs.cs
ViewVC logotype

Contents of /trunk/gr2lib/typedefs.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10 - (show annotations) (download)
Wed Jul 14 09:19:53 2010 UTC (9 years, 3 months ago) by william
File size: 16293 byte(s)
commit initial Granny2 typedefs, as structs -> these seem to be working

1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4
5 namespace gr2lib.core.typedefs
6 {
7 #region typedefs
8
9 #region public struct granny_uint32
10 public struct granny_uint32
11 {
12 public granny_uint32(System.UInt32 value)
13 {
14 this.realValue = value;
15 }
16 private System.UInt32 realValue;
17 public static implicit operator System.UInt32(granny_uint32 value)
18 {
19 return value.realValue;
20 }
21
22 public static implicit operator granny_uint32(System.UInt32 value)
23 {
24 return new granny_uint32(value);
25 }
26 };//System.UInt32
27 #endregion
28
29 #region public struct granny_uint16
30 public struct granny_uint16
31 {
32 public granny_uint16(System.UInt16 value)
33 {
34 this.realValue = value;
35 }
36 private System.UInt16 realValue;
37 public static implicit operator System.UInt16(granny_uint16 value)
38 {
39 return value.realValue;
40 }
41
42 public static implicit operator granny_uint16(System.UInt16 value)
43 {
44 return new granny_uint16(value);
45 }
46 };//System.UInt16;
47 #endregion
48
49 #region public struct granny_uint8
50 public struct granny_uint8
51 {
52 public granny_uint8(System.Byte value)
53 {
54 this.realValue = value;
55 }
56 private System.Byte realValue;
57 public static implicit operator System.Byte(granny_uint8 value)
58 {
59 return value.realValue;
60 }
61
62 public static implicit operator granny_uint8(System.Byte value)
63 {
64 return new granny_uint8(value);
65 }
66 public override string ToString()
67 {
68 return realValue.ToString();
69 }
70 }; //System.Byte;
71 #endregion
72
73 #region public struct granny_int32
74 public struct granny_int32
75 {
76 public granny_int32(System.Int32 value)
77 {
78 this.realValue = value;
79 }
80 private System.Int32 realValue;
81 public static implicit operator System.Int32(granny_int32 value)
82 {
83 return value.realValue;
84 }
85
86 public static implicit operator granny_int32(System.Int32 value)
87 {
88 return new granny_int32(value);
89 }
90 public override string ToString()
91 {
92 return realValue.ToString();
93 }
94 }; //System.Int32;
95 #endregion
96
97 #region public struct granny_int16
98 public struct granny_int16
99 {
100 public granny_int16(System.Int16 value)
101 {
102 this.realValue = value;
103 }
104 private System.Int16 realValue;
105 public static implicit operator System.Int16(granny_int16 value)
106 {
107 return value.realValue;
108 }
109
110 public static implicit operator granny_int16(System.Int16 value)
111 {
112 return new granny_int16(value);
113 }
114 public override string ToString()
115 {
116 return realValue.ToString();
117 }
118 };//System.Int16;
119 #endregion
120
121 #region public struct granny_int8
122 public struct granny_int8
123 {
124 public granny_int8(System.SByte value)
125 {
126 this.realValue = value;
127 }
128 private System.SByte realValue;
129 public static implicit operator System.SByte(granny_int8 value)
130 {
131 return value.realValue;
132 }
133
134 public static implicit operator granny_int8(System.SByte value)
135 {
136 return new granny_int8(value);
137 }
138 public override string ToString()
139 {
140 return realValue.ToString();
141 }
142 };//System.SByte;
143 #endregion
144
145 #region public struct granny_bool32
146 public struct granny_bool32
147 {
148 public granny_bool32(System.Int32 value)
149 {
150 this.realValue = value;
151 }
152 private System.Int32 realValue;
153 public static implicit operator System.Int32(granny_bool32 value)
154 {
155 return value.realValue;
156 }
157
158 public static implicit operator granny_bool32(System.Int32 value)
159 {
160 return new granny_bool32(value);
161 }
162 public override string ToString()
163 {
164 return realValue.ToString();
165 }
166 }; //System.Int32;
167 #endregion
168
169 #region public struct granny_real32
170 public struct granny_real32
171 {
172 public granny_real32(System.Single value)
173 {
174 this.realValue = value;
175 }
176 private System.Single realValue;
177 public static implicit operator System.Single(granny_real32 value)
178 {
179 return value.realValue;
180 }
181
182 public static implicit operator granny_real32(System.Single value)
183 {
184 return new granny_real32(value);
185 }
186 public override string ToString()
187 {
188 return realValue.ToString();
189 }
190 }; //System.Single;
191 #endregion
192
193 #region public struct granny_real16
194 public struct granny_real16
195 {
196 public granny_real16(System.UInt16 value)
197 {
198 this.realValue = value;
199 }
200 private System.UInt16 realValue;
201 public static implicit operator System.UInt16(granny_real16 value)
202 {
203 return value.realValue;
204 }
205
206 public static implicit operator granny_real16(System.UInt16 value)
207 {
208 return new granny_real16(value);
209 }
210 public override string ToString()
211 {
212 return realValue.ToString();
213 }
214 };//System.UInt16;
215 #endregion
216
217 #region public struct granny_uint32x
218 public struct granny_uint32x
219 {
220 public granny_uint32x(System.UInt32 value)
221 {
222 this.realValue = value;
223 }
224 private System.UInt32 realValue;
225 public static implicit operator System.UInt32(granny_uint32x value)
226 {
227 return value.realValue;
228 }
229
230 public static implicit operator granny_uint32x(System.UInt32 value)
231 {
232 return new granny_uint32x(value);
233 }
234 public override string ToString()
235 {
236 return realValue.ToString();
237 }
238 }; //System.UInt32;
239 #endregion
240
241 #region public struct granny_uint16x
242 public struct granny_uint16x
243 {
244 public granny_uint16x(System.UInt32 value)
245 {
246 this.realValue = value;
247 }
248 private System.UInt32 realValue;
249 public static implicit operator System.UInt32(granny_uint16x value)
250 {
251 return value.realValue;
252 }
253
254 public static implicit operator granny_uint16x(System.UInt32 value)
255 {
256 return new granny_uint16x(value);
257 }
258 public override string ToString()
259 {
260 return realValue.ToString();
261 }
262 };//System.UInt32;
263 #endregion
264
265 #region public struct granny_uint8x
266 public struct granny_uint8x
267 {
268 public granny_uint8x(System.UInt32 value)
269 {
270 this.realValue = value;
271 }
272 private System.UInt32 realValue;
273 public static implicit operator System.UInt32(granny_uint8x value)
274 {
275 return value.realValue;
276 }
277
278 public static implicit operator granny_uint8x(System.UInt32 value)
279 {
280 return new granny_uint8x(value);
281 }
282 public override string ToString()
283 {
284 return realValue.ToString();
285 }
286 };//System.UInt32;
287 #endregion
288
289 #region public struct granny_int32x
290 public struct granny_int32x
291 {
292 public granny_int32x(System.Int32 value)
293 {
294 this.realValue = value;
295 }
296 private System.Int32 realValue;
297 public static implicit operator System.Int32(granny_int32x value)
298 {
299 return value.realValue;
300 }
301
302 public static implicit operator granny_int32x(System.Int32 value)
303 {
304 return new granny_int32x(value);
305 }
306
307 public override string ToString()
308 {
309 return realValue.ToString();
310 }
311
312 }; //System.Int32;
313 #endregion
314
315 #region public struct granny_int16x
316 public struct granny_int16x
317 {
318 public granny_int16x(System.Int32 value)
319 {
320 this.realValue = value;
321 }
322 private System.Int32 realValue;
323 public static implicit operator System.Int32(granny_int16x value)
324 {
325 return value.realValue;
326 }
327
328 public static implicit operator granny_int16x(System.Int32 value)
329 {
330 return new granny_int16x(value);
331 }
332 public override string ToString()
333 {
334 return realValue.ToString();
335 }
336 };//System.Int32;
337 #endregion
338
339 #region public struct granny_int8x
340 public struct granny_int8x
341 {
342 public granny_int8x(System.Int32 value)
343 {
344 this.realValue = value;
345 }
346 private System.Int32 realValue;
347 public static implicit operator System.Int32(granny_int8x value)
348 {
349 return value.realValue;
350 }
351
352 public static implicit operator granny_int8x(System.Int32 value)
353 {
354 return new granny_int8x(value);
355 }
356 public override string ToString()
357 {
358 return realValue.ToString();
359 }
360 }; //System.Int32;
361 #endregion
362
363 #region public struct granny_bool32x
364 public struct granny_bool32x
365 {
366 public granny_bool32x(System.Int32 value)
367 {
368 this.realValue = value;
369 }
370 private System.Int32 realValue;
371 public static implicit operator System.Int32(granny_bool32x value)
372 {
373 return value.realValue;
374 }
375
376 public static implicit operator granny_bool32x(System.Int32 value)
377 {
378 return new granny_bool32x(value);
379 }
380 public override string ToString()
381 {
382 return realValue.ToString();
383 }
384 };//System.Int32;
385 #endregion
386
387 #region public struct granny_real64x
388 public struct granny_real64x
389 {
390 public granny_real64x(System.Double value)
391 {
392 this.realValue = value;
393 }
394 private System.Double realValue;
395 public static implicit operator System.Double(granny_real64x value)
396 {
397 return value.realValue;
398 }
399
400 public static implicit operator granny_real64x(System.Double value)
401 {
402 return new granny_real64x(value);
403 }
404 public override string ToString()
405 {
406 return realValue.ToString();
407 }
408 }; //System.Double;
409 #endregion
410
411 #region public struct granny_real32x
412 public struct granny_real32x
413 {
414 public granny_real32x(System.Single value)
415 {
416 this.realValue = value;
417 }
418 private System.Single realValue;
419 public static implicit operator System.Single(granny_real32x value)
420 {
421 return value.realValue;
422 }
423
424 public static implicit operator granny_real32x(System.Single value)
425 {
426 return new granny_real32x(value);
427 }
428 };//System.Single;
429 #endregion
430
431 #region public struct granny_triple
432 public struct granny_triple
433 {
434 unsafe public granny_triple(System.Single[] value)
435 {
436 this.realValue = value;
437 }
438 private unsafe System.Single[] realValue;
439 unsafe public static implicit operator System.Single[](granny_triple value)
440 {
441 return value.realValue;
442 }
443
444 unsafe public static implicit operator granny_triple(System.Single[] value)
445 {
446 return new granny_triple(value);
447 }
448 unsafe public override string ToString()
449 {
450 string val = "";
451 foreach (System.Single f in realValue)
452 {
453 val = val + "[" + f.ToString() + "]";
454 }
455 return val;
456 }
457 }; //System.Single;//[3]; // declare type -> unsafe fixed
458 #endregion
459
460 #region public struct granny_quad
461 public struct granny_quad
462 {
463 unsafe public granny_quad(System.Single[] value)
464 {
465 this.realValue = value;
466 }
467 private unsafe System.Single[] realValue;//[4];
468 unsafe public static implicit operator System.Single[](granny_quad value)
469 {
470 return value.realValue;
471 }
472
473 unsafe public static implicit operator granny_quad(System.Single[] value)
474 {
475 return new granny_quad(value);
476 }
477 unsafe public override string ToString()
478 {
479 string val = "";
480 foreach (System.Single f in realValue)
481 {
482 val = val + "[" + f.ToString() + "]";
483 }
484 return val;
485 }
486 };//System.Single;//[4]; // declare type -> unsafe fixed
487 #endregion
488
489 #region public struct granny_matrix_3x3
490 public struct granny_matrix_3x3
491 {
492 unsafe public granny_matrix_3x3(System.Single[,] value)
493 {
494 this.realValue = value;
495 }
496 private unsafe System.Single[,] realValue;
497 unsafe public static implicit operator System.Single[,](granny_matrix_3x3 value)
498 {
499 return value.realValue;
500 }
501
502 unsafe public static implicit operator granny_matrix_3x3(System.Single[,] value)
503 {
504 return new granny_matrix_3x3(value);
505 }
506 unsafe public override string ToString()
507 {
508 string val = "";
509 foreach (System.Single f in realValue)
510 {
511 val = val + "[" + f.ToString() + "]";
512 }
513 return val;
514 }
515 }; //System.Single;//[3][3]; // declare type -> unsafe fixed
516 #endregion
517
518 #region public struct granny_matrix_4x4
519 public struct granny_matrix_4x4
520 {
521 unsafe public granny_matrix_4x4(System.Single[,] value)
522 {
523 this.realValue = value;
524 }
525 private unsafe System.Single[,] realValue;
526 unsafe public static implicit operator System.Single[,](granny_matrix_4x4 value)
527 {
528 return value.realValue;
529 }
530
531 unsafe public static implicit operator granny_matrix_4x4(System.Single[,] value)
532 {
533 return new granny_matrix_4x4(value);
534 }
535 unsafe public override string ToString()
536 {
537 string val = "";
538 foreach (System.Single f in realValue)
539 {
540 val = val + "[" + f.ToString() + "]";
541 }
542 return val;
543 }
544 };//System.Single;//[4][4]; // declare type -> unsafe fixed
545 #endregion
546
547 #region public struct granny_matrix_3x4
548 public struct granny_matrix_3x4
549 {
550 unsafe public granny_matrix_3x4(System.Single[,] value)
551 {
552 this.realValue = value;
553 }
554 private unsafe System.Single[,] realValue;
555 unsafe public static implicit operator System.Single[,](granny_matrix_3x4 value)
556 {
557 return value.realValue;
558 }
559
560 unsafe public static implicit operator granny_matrix_3x4(System.Single[,] value)
561 {
562 return new granny_matrix_3x4(value);
563 }
564 unsafe public override string ToString()
565 {
566 string val = "";
567 foreach (System.Single f in realValue)
568 {
569 val = val + "[" + f.ToString() + "]";
570 }
571 return val;
572 }
573 }; //System.Single;//[3][4]; // declare type -> unsafe fixed
574 #endregion
575
576 #endregion
577 }

  ViewVC Help
Powered by ViewVC 1.1.22