castar 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,250 @@
1
+ /*
2
+
3
+ A* Algorithm Implementation using STL is
4
+ Copyright (C)2001-2005 Justin Heyes-Jones
5
+
6
+ Permission is given by the author to freely redistribute and
7
+ include this code in any program as long as this credit is
8
+ given where due.
9
+
10
+ COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
11
+ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
12
+ INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE
13
+ IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
14
+ OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND
15
+ PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED
16
+ CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL
17
+ DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY
18
+ NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF
19
+ WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE
20
+ OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER
21
+ THIS DISCLAIMER.
22
+
23
+ Use at your own risk!
24
+
25
+
26
+
27
+ FixedSizeAllocator class
28
+ Copyright 2001 Justin Heyes-Jones
29
+
30
+ This class is a constant time O(1) memory manager for objects of
31
+ a specified type. The type is specified using a template class.
32
+
33
+ Memory is allocated from a fixed size buffer which you can specify in the
34
+ class constructor or use the default.
35
+
36
+ Using GetFirst and GetNext it is possible to iterate through the elements
37
+ one by one, and this would be the most common use for the class.
38
+
39
+ I would suggest using this class when you want O(1) add and delete
40
+ and you don't do much searching, which would be O(n). Structures such as binary
41
+ trees can be used instead to get O(logn) access time.
42
+
43
+ */
44
+
45
+ #ifndef FSA_H
46
+ #define FSA_H
47
+
48
+ #include <string.h>
49
+ #include <stdio.h>
50
+
51
+ template <class USER_TYPE> class FixedSizeAllocator
52
+ {
53
+
54
+ public:
55
+ // Constants
56
+ enum
57
+ {
58
+ FSA_DEFAULT_SIZE = 100
59
+ };
60
+
61
+ // This class enables us to transparently manage the extra data
62
+ // needed to enable the user class to form part of the double-linked
63
+ // list class
64
+ struct FSA_ELEMENT
65
+ {
66
+ USER_TYPE UserType;
67
+
68
+ FSA_ELEMENT *pPrev;
69
+ FSA_ELEMENT *pNext;
70
+ };
71
+
72
+ public: // methods
73
+ FixedSizeAllocator( unsigned int MaxElements = FSA_DEFAULT_SIZE ) :
74
+ m_MaxElements( MaxElements ),
75
+ m_pFirstUsed( NULL )
76
+ {
77
+ // Allocate enough memory for the maximum number of elements
78
+
79
+ m_pMemory = (FSA_ELEMENT *) (new char[ m_MaxElements * sizeof(FSA_ELEMENT) ]);
80
+
81
+ // Set the free list first pointer
82
+ m_pFirstFree = m_pMemory;
83
+
84
+ // Clear the memory
85
+ memset( m_pMemory, 0, sizeof( FSA_ELEMENT ) * m_MaxElements );
86
+
87
+ // Point at first element
88
+ FSA_ELEMENT *pElement = m_pFirstFree;
89
+
90
+ // Set the double linked free list
91
+ for( unsigned int i=0; i<m_MaxElements; i++ )
92
+ {
93
+ pElement->pPrev = pElement-1;
94
+ pElement->pNext = pElement+1;
95
+
96
+ pElement++;
97
+ }
98
+
99
+ // first element should have a null prev
100
+ m_pFirstFree->pPrev = NULL;
101
+ // last element should have a null next
102
+ (pElement-1)->pNext = NULL;
103
+
104
+ }
105
+
106
+
107
+ ~FixedSizeAllocator()
108
+ {
109
+ // Free up the memory
110
+ delete [] (char *) m_pMemory;
111
+ }
112
+
113
+ // Allocate a new USER_TYPE and return a pointer to it
114
+ USER_TYPE *alloc()
115
+ {
116
+
117
+ FSA_ELEMENT *pNewNode = NULL;
118
+
119
+ if( !m_pFirstFree )
120
+ {
121
+ return NULL;
122
+ }
123
+ else
124
+ {
125
+ pNewNode = m_pFirstFree;
126
+ m_pFirstFree = pNewNode->pNext;
127
+
128
+ // if the new node points to another free node then
129
+ // change that nodes prev free pointer...
130
+ if( pNewNode->pNext )
131
+ {
132
+ pNewNode->pNext->pPrev = NULL;
133
+ }
134
+
135
+ // node is now on the used list
136
+
137
+ pNewNode->pPrev = NULL; // the allocated node is always first in the list
138
+
139
+ if( m_pFirstUsed == NULL )
140
+ {
141
+ pNewNode->pNext = NULL; // no other nodes
142
+ }
143
+ else
144
+ {
145
+ m_pFirstUsed->pPrev = pNewNode; // insert this at the head of the used list
146
+ pNewNode->pNext = m_pFirstUsed;
147
+ }
148
+
149
+ m_pFirstUsed = pNewNode;
150
+ }
151
+
152
+ return reinterpret_cast<USER_TYPE*>(pNewNode);
153
+ }
154
+
155
+ // Free the given user type
156
+ // For efficiency I don't check whether the user_data is a valid
157
+ // pointer that was allocated. I may add some debug only checking
158
+ // (To add the debug check you'd need to make sure the pointer is in
159
+ // the m_pMemory area and is pointing at the start of a node)
160
+ void free( USER_TYPE *user_data )
161
+ {
162
+ FSA_ELEMENT *pNode = reinterpret_cast<FSA_ELEMENT*>(user_data);
163
+
164
+ // manage used list, remove this node from it
165
+ if( pNode->pPrev )
166
+ {
167
+ pNode->pPrev->pNext = pNode->pNext;
168
+ }
169
+ else
170
+ {
171
+ // this handles the case that we delete the first node in the used list
172
+ m_pFirstUsed = pNode->pNext;
173
+ }
174
+
175
+ if( pNode->pNext )
176
+ {
177
+ pNode->pNext->pPrev = pNode->pPrev;
178
+ }
179
+
180
+ // add to free list
181
+ if( m_pFirstFree == NULL )
182
+ {
183
+ // free list was empty
184
+ m_pFirstFree = pNode;
185
+ pNode->pPrev = NULL;
186
+ pNode->pNext = NULL;
187
+ }
188
+ else
189
+ {
190
+ // Add this node at the start of the free list
191
+ m_pFirstFree->pPrev = pNode;
192
+ pNode->pNext = m_pFirstFree;
193
+ m_pFirstFree = pNode;
194
+ }
195
+
196
+ }
197
+
198
+ // For debugging this displays both lists (using the prev/next list pointers)
199
+ void Debug()
200
+ {
201
+ printf( "free list " );
202
+
203
+ FSA_ELEMENT *p = m_pFirstFree;
204
+ while( p )
205
+ {
206
+ printf( "%x!%x ", p->pPrev, p->pNext );
207
+ p = p->pNext;
208
+ }
209
+ printf( "\n" );
210
+
211
+ printf( "used list " );
212
+
213
+ p = m_pFirstUsed;
214
+ while( p )
215
+ {
216
+ printf( "%x!%x ", p->pPrev, p->pNext );
217
+ p = p->pNext;
218
+ }
219
+ printf( "\n" );
220
+ }
221
+
222
+ // Iterators
223
+
224
+ USER_TYPE *GetFirst()
225
+ {
226
+ return reinterpret_cast<USER_TYPE *>(m_pFirstUsed);
227
+ }
228
+
229
+ USER_TYPE *GetNext( USER_TYPE *node )
230
+ {
231
+ return reinterpret_cast<USER_TYPE *>
232
+ (
233
+ (reinterpret_cast<FSA_ELEMENT *>(node))->pNext
234
+ );
235
+ }
236
+
237
+ public: // data
238
+
239
+ private: // methods
240
+
241
+ private: // data
242
+
243
+ FSA_ELEMENT *m_pFirstFree;
244
+ FSA_ELEMENT *m_pFirstUsed;
245
+ unsigned int m_MaxElements;
246
+ FSA_ELEMENT *m_pMemory;
247
+
248
+ };
249
+
250
+ #endif // defined FSA_H
@@ -0,0 +1,3641 @@
1
+ /* ----------------------------------------------------------------------------
2
+ * This file was automatically generated by SWIG (http://www.swig.org).
3
+ * Version 1.3.31
4
+ *
5
+ * This file is not intended to be easily readable and contains a number of
6
+ * coding conventions designed to improve portability and efficiency. Do not make
7
+ * changes to this file unless you know what you are doing--modify the SWIG
8
+ * interface file instead.
9
+ * ----------------------------------------------------------------------------- */
10
+
11
+ #define SWIGRUBY
12
+
13
+ #ifdef __cplusplus
14
+ template<class T> class SwigValueWrapper {
15
+ T *tt;
16
+ public:
17
+ SwigValueWrapper() : tt(0) { }
18
+ SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
19
+ SwigValueWrapper(const T& t) : tt(new T(t)) { }
20
+ ~SwigValueWrapper() { delete tt; }
21
+ SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
22
+ operator T&() const { return *tt; }
23
+ T *operator&() { return tt; }
24
+ private:
25
+ SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
26
+ };
27
+ #endif
28
+
29
+ /* -----------------------------------------------------------------------------
30
+ * This section contains generic SWIG labels for method/variable
31
+ * declarations/attributes, and other compiler dependent labels.
32
+ * ----------------------------------------------------------------------------- */
33
+
34
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
35
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
36
+ # if defined(__SUNPRO_CC)
37
+ # if (__SUNPRO_CC <= 0x560)
38
+ # define SWIGTEMPLATEDISAMBIGUATOR template
39
+ # else
40
+ # define SWIGTEMPLATEDISAMBIGUATOR
41
+ # endif
42
+ # else
43
+ # define SWIGTEMPLATEDISAMBIGUATOR
44
+ # endif
45
+ #endif
46
+
47
+ /* inline attribute */
48
+ #ifndef SWIGINLINE
49
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
50
+ # define SWIGINLINE inline
51
+ # else
52
+ # define SWIGINLINE
53
+ # endif
54
+ #endif
55
+
56
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
57
+ #ifndef SWIGUNUSED
58
+ # if defined(__GNUC__)
59
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
60
+ # define SWIGUNUSED __attribute__ ((__unused__))
61
+ # else
62
+ # define SWIGUNUSED
63
+ # endif
64
+ # elif defined(__ICC)
65
+ # define SWIGUNUSED __attribute__ ((__unused__))
66
+ # else
67
+ # define SWIGUNUSED
68
+ # endif
69
+ #endif
70
+
71
+ #ifndef SWIGUNUSEDPARM
72
+ # ifdef __cplusplus
73
+ # define SWIGUNUSEDPARM(p)
74
+ # else
75
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
76
+ # endif
77
+ #endif
78
+
79
+ /* internal SWIG method */
80
+ #ifndef SWIGINTERN
81
+ # define SWIGINTERN static SWIGUNUSED
82
+ #endif
83
+
84
+ /* internal inline SWIG method */
85
+ #ifndef SWIGINTERNINLINE
86
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
87
+ #endif
88
+
89
+ /* exporting methods */
90
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
91
+ # ifndef GCC_HASCLASSVISIBILITY
92
+ # define GCC_HASCLASSVISIBILITY
93
+ # endif
94
+ #endif
95
+
96
+ #ifndef SWIGEXPORT
97
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
98
+ # if defined(STATIC_LINKED)
99
+ # define SWIGEXPORT
100
+ # else
101
+ # define SWIGEXPORT __declspec(dllexport)
102
+ # endif
103
+ # else
104
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
105
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
106
+ # else
107
+ # define SWIGEXPORT
108
+ # endif
109
+ # endif
110
+ #endif
111
+
112
+ /* calling conventions for Windows */
113
+ #ifndef SWIGSTDCALL
114
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
115
+ # define SWIGSTDCALL __stdcall
116
+ # else
117
+ # define SWIGSTDCALL
118
+ # endif
119
+ #endif
120
+
121
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
122
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
123
+ # define _CRT_SECURE_NO_DEPRECATE
124
+ #endif
125
+
126
+ /* -----------------------------------------------------------------------------
127
+ * This section contains generic SWIG labels for method/variable
128
+ * declarations/attributes, and other compiler dependent labels.
129
+ * ----------------------------------------------------------------------------- */
130
+
131
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
132
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
133
+ # if defined(__SUNPRO_CC)
134
+ # if (__SUNPRO_CC <= 0x560)
135
+ # define SWIGTEMPLATEDISAMBIGUATOR template
136
+ # else
137
+ # define SWIGTEMPLATEDISAMBIGUATOR
138
+ # endif
139
+ # else
140
+ # define SWIGTEMPLATEDISAMBIGUATOR
141
+ # endif
142
+ #endif
143
+
144
+ /* inline attribute */
145
+ #ifndef SWIGINLINE
146
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
147
+ # define SWIGINLINE inline
148
+ # else
149
+ # define SWIGINLINE
150
+ # endif
151
+ #endif
152
+
153
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
154
+ #ifndef SWIGUNUSED
155
+ # if defined(__GNUC__)
156
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
157
+ # define SWIGUNUSED __attribute__ ((__unused__))
158
+ # else
159
+ # define SWIGUNUSED
160
+ # endif
161
+ # elif defined(__ICC)
162
+ # define SWIGUNUSED __attribute__ ((__unused__))
163
+ # else
164
+ # define SWIGUNUSED
165
+ # endif
166
+ #endif
167
+
168
+ #ifndef SWIGUNUSEDPARM
169
+ # ifdef __cplusplus
170
+ # define SWIGUNUSEDPARM(p)
171
+ # else
172
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
173
+ # endif
174
+ #endif
175
+
176
+ /* internal SWIG method */
177
+ #ifndef SWIGINTERN
178
+ # define SWIGINTERN static SWIGUNUSED
179
+ #endif
180
+
181
+ /* internal inline SWIG method */
182
+ #ifndef SWIGINTERNINLINE
183
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
184
+ #endif
185
+
186
+ /* exporting methods */
187
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
188
+ # ifndef GCC_HASCLASSVISIBILITY
189
+ # define GCC_HASCLASSVISIBILITY
190
+ # endif
191
+ #endif
192
+
193
+ #ifndef SWIGEXPORT
194
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
195
+ # if defined(STATIC_LINKED)
196
+ # define SWIGEXPORT
197
+ # else
198
+ # define SWIGEXPORT __declspec(dllexport)
199
+ # endif
200
+ # else
201
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
202
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
203
+ # else
204
+ # define SWIGEXPORT
205
+ # endif
206
+ # endif
207
+ #endif
208
+
209
+ /* calling conventions for Windows */
210
+ #ifndef SWIGSTDCALL
211
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
212
+ # define SWIGSTDCALL __stdcall
213
+ # else
214
+ # define SWIGSTDCALL
215
+ # endif
216
+ #endif
217
+
218
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
219
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
220
+ # define _CRT_SECURE_NO_DEPRECATE
221
+ #endif
222
+
223
+ /* -----------------------------------------------------------------------------
224
+ * swigrun.swg
225
+ *
226
+ * This file contains generic CAPI SWIG runtime support for pointer
227
+ * type checking.
228
+ * ----------------------------------------------------------------------------- */
229
+
230
+ /* This should only be incremented when either the layout of swig_type_info changes,
231
+ or for whatever reason, the runtime changes incompatibly */
232
+ #define SWIG_RUNTIME_VERSION "3"
233
+
234
+ /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
235
+ #ifdef SWIG_TYPE_TABLE
236
+ # define SWIG_QUOTE_STRING(x) #x
237
+ # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
238
+ # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
239
+ #else
240
+ # define SWIG_TYPE_TABLE_NAME
241
+ #endif
242
+
243
+ /*
244
+ You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
245
+ creating a static or dynamic library from the swig runtime code.
246
+ In 99.9% of the cases, swig just needs to declare them as 'static'.
247
+
248
+ But only do this if is strictly necessary, ie, if you have problems
249
+ with your compiler or so.
250
+ */
251
+
252
+ #ifndef SWIGRUNTIME
253
+ # define SWIGRUNTIME SWIGINTERN
254
+ #endif
255
+
256
+ #ifndef SWIGRUNTIMEINLINE
257
+ # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
258
+ #endif
259
+
260
+ /* Generic buffer size */
261
+ #ifndef SWIG_BUFFER_SIZE
262
+ # define SWIG_BUFFER_SIZE 1024
263
+ #endif
264
+
265
+ /* Flags for pointer conversions */
266
+ #define SWIG_POINTER_DISOWN 0x1
267
+
268
+ /* Flags for new pointer objects */
269
+ #define SWIG_POINTER_OWN 0x1
270
+
271
+
272
+ /*
273
+ Flags/methods for returning states.
274
+
275
+ The swig conversion methods, as ConvertPtr, return and integer
276
+ that tells if the conversion was successful or not. And if not,
277
+ an error code can be returned (see swigerrors.swg for the codes).
278
+
279
+ Use the following macros/flags to set or process the returning
280
+ states.
281
+
282
+ In old swig versions, you usually write code as:
283
+
284
+ if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
285
+ // success code
286
+ } else {
287
+ //fail code
288
+ }
289
+
290
+ Now you can be more explicit as:
291
+
292
+ int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
293
+ if (SWIG_IsOK(res)) {
294
+ // success code
295
+ } else {
296
+ // fail code
297
+ }
298
+
299
+ that seems to be the same, but now you can also do
300
+
301
+ Type *ptr;
302
+ int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
303
+ if (SWIG_IsOK(res)) {
304
+ // success code
305
+ if (SWIG_IsNewObj(res) {
306
+ ...
307
+ delete *ptr;
308
+ } else {
309
+ ...
310
+ }
311
+ } else {
312
+ // fail code
313
+ }
314
+
315
+ I.e., now SWIG_ConvertPtr can return new objects and you can
316
+ identify the case and take care of the deallocation. Of course that
317
+ requires also to SWIG_ConvertPtr to return new result values, as
318
+
319
+ int SWIG_ConvertPtr(obj, ptr,...) {
320
+ if (<obj is ok>) {
321
+ if (<need new object>) {
322
+ *ptr = <ptr to new allocated object>;
323
+ return SWIG_NEWOBJ;
324
+ } else {
325
+ *ptr = <ptr to old object>;
326
+ return SWIG_OLDOBJ;
327
+ }
328
+ } else {
329
+ return SWIG_BADOBJ;
330
+ }
331
+ }
332
+
333
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
334
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
335
+ swig errors code.
336
+
337
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
338
+ allows to return the 'cast rank', for example, if you have this
339
+
340
+ int food(double)
341
+ int fooi(int);
342
+
343
+ and you call
344
+
345
+ food(1) // cast rank '1' (1 -> 1.0)
346
+ fooi(1) // cast rank '0'
347
+
348
+ just use the SWIG_AddCast()/SWIG_CheckState()
349
+
350
+
351
+ */
352
+ #define SWIG_OK (0)
353
+ #define SWIG_ERROR (-1)
354
+ #define SWIG_IsOK(r) (r >= 0)
355
+ #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
356
+
357
+ /* The CastRankLimit says how many bits are used for the cast rank */
358
+ #define SWIG_CASTRANKLIMIT (1 << 8)
359
+ /* The NewMask denotes the object was created (using new/malloc) */
360
+ #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
361
+ /* The TmpMask is for in/out typemaps that use temporal objects */
362
+ #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
363
+ /* Simple returning values */
364
+ #define SWIG_BADOBJ (SWIG_ERROR)
365
+ #define SWIG_OLDOBJ (SWIG_OK)
366
+ #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
367
+ #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
368
+ /* Check, add and del mask methods */
369
+ #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
370
+ #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
371
+ #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
372
+ #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
373
+ #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
374
+ #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
375
+
376
+
377
+ /* Cast-Rank Mode */
378
+ #if defined(SWIG_CASTRANK_MODE)
379
+ # ifndef SWIG_TypeRank
380
+ # define SWIG_TypeRank unsigned long
381
+ # endif
382
+ # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
383
+ # define SWIG_MAXCASTRANK (2)
384
+ # endif
385
+ # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
386
+ # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
387
+ SWIGINTERNINLINE int SWIG_AddCast(int r) {
388
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
389
+ }
390
+ SWIGINTERNINLINE int SWIG_CheckState(int r) {
391
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
392
+ }
393
+ #else /* no cast-rank mode */
394
+ # define SWIG_AddCast
395
+ # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
396
+ #endif
397
+
398
+
399
+
400
+
401
+ #include <string.h>
402
+
403
+ #ifdef __cplusplus
404
+ extern "C" {
405
+ #endif
406
+
407
+ typedef void *(*swig_converter_func)(void *);
408
+ typedef struct swig_type_info *(*swig_dycast_func)(void **);
409
+
410
+ /* Structure to store inforomation on one type */
411
+ typedef struct swig_type_info {
412
+ const char *name; /* mangled name of this type */
413
+ const char *str; /* human readable name of this type */
414
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
415
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
416
+ void *clientdata; /* language specific type data */
417
+ int owndata; /* flag if the structure owns the clientdata */
418
+ } swig_type_info;
419
+
420
+ /* Structure to store a type and conversion function used for casting */
421
+ typedef struct swig_cast_info {
422
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
423
+ swig_converter_func converter; /* function to cast the void pointers */
424
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
425
+ struct swig_cast_info *prev; /* pointer to the previous cast */
426
+ } swig_cast_info;
427
+
428
+ /* Structure used to store module information
429
+ * Each module generates one structure like this, and the runtime collects
430
+ * all of these structures and stores them in a circularly linked list.*/
431
+ typedef struct swig_module_info {
432
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
433
+ size_t size; /* Number of types in this module */
434
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
435
+ swig_type_info **type_initial; /* Array of initially generated type structures */
436
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
437
+ void *clientdata; /* Language specific module data */
438
+ } swig_module_info;
439
+
440
+ /*
441
+ Compare two type names skipping the space characters, therefore
442
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
443
+
444
+ Return 0 when the two name types are equivalent, as in
445
+ strncmp, but skipping ' '.
446
+ */
447
+ SWIGRUNTIME int
448
+ SWIG_TypeNameComp(const char *f1, const char *l1,
449
+ const char *f2, const char *l2) {
450
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
451
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
452
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
453
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
454
+ }
455
+ return (l1 - f1) - (l2 - f2);
456
+ }
457
+
458
+ /*
459
+ Check type equivalence in a name list like <name1>|<name2>|...
460
+ Return 0 if not equal, 1 if equal
461
+ */
462
+ SWIGRUNTIME int
463
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
464
+ int equiv = 0;
465
+ const char* te = tb + strlen(tb);
466
+ const char* ne = nb;
467
+ while (!equiv && *ne) {
468
+ for (nb = ne; *ne; ++ne) {
469
+ if (*ne == '|') break;
470
+ }
471
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
472
+ if (*ne) ++ne;
473
+ }
474
+ return equiv;
475
+ }
476
+
477
+ /*
478
+ Check type equivalence in a name list like <name1>|<name2>|...
479
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
480
+ */
481
+ SWIGRUNTIME int
482
+ SWIG_TypeCompare(const char *nb, const char *tb) {
483
+ int equiv = 0;
484
+ const char* te = tb + strlen(tb);
485
+ const char* ne = nb;
486
+ while (!equiv && *ne) {
487
+ for (nb = ne; *ne; ++ne) {
488
+ if (*ne == '|') break;
489
+ }
490
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
491
+ if (*ne) ++ne;
492
+ }
493
+ return equiv;
494
+ }
495
+
496
+
497
+ /* think of this as a c++ template<> or a scheme macro */
498
+ #define SWIG_TypeCheck_Template(comparison, ty) \
499
+ if (ty) { \
500
+ swig_cast_info *iter = ty->cast; \
501
+ while (iter) { \
502
+ if (comparison) { \
503
+ if (iter == ty->cast) return iter; \
504
+ /* Move iter to the top of the linked list */ \
505
+ iter->prev->next = iter->next; \
506
+ if (iter->next) \
507
+ iter->next->prev = iter->prev; \
508
+ iter->next = ty->cast; \
509
+ iter->prev = 0; \
510
+ if (ty->cast) ty->cast->prev = iter; \
511
+ ty->cast = iter; \
512
+ return iter; \
513
+ } \
514
+ iter = iter->next; \
515
+ } \
516
+ } \
517
+ return 0
518
+
519
+ /*
520
+ Check the typename
521
+ */
522
+ SWIGRUNTIME swig_cast_info *
523
+ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
524
+ SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
525
+ }
526
+
527
+ /* Same as previous function, except strcmp is replaced with a pointer comparison */
528
+ SWIGRUNTIME swig_cast_info *
529
+ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
530
+ SWIG_TypeCheck_Template(iter->type == from, into);
531
+ }
532
+
533
+ /*
534
+ Cast a pointer up an inheritance hierarchy
535
+ */
536
+ SWIGRUNTIMEINLINE void *
537
+ SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
538
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
539
+ }
540
+
541
+ /*
542
+ Dynamic pointer casting. Down an inheritance hierarchy
543
+ */
544
+ SWIGRUNTIME swig_type_info *
545
+ SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
546
+ swig_type_info *lastty = ty;
547
+ if (!ty || !ty->dcast) return ty;
548
+ while (ty && (ty->dcast)) {
549
+ ty = (*ty->dcast)(ptr);
550
+ if (ty) lastty = ty;
551
+ }
552
+ return lastty;
553
+ }
554
+
555
+ /*
556
+ Return the name associated with this type
557
+ */
558
+ SWIGRUNTIMEINLINE const char *
559
+ SWIG_TypeName(const swig_type_info *ty) {
560
+ return ty->name;
561
+ }
562
+
563
+ /*
564
+ Return the pretty name associated with this type,
565
+ that is an unmangled type name in a form presentable to the user.
566
+ */
567
+ SWIGRUNTIME const char *
568
+ SWIG_TypePrettyName(const swig_type_info *type) {
569
+ /* The "str" field contains the equivalent pretty names of the
570
+ type, separated by vertical-bar characters. We choose
571
+ to print the last name, as it is often (?) the most
572
+ specific. */
573
+ if (!type) return NULL;
574
+ if (type->str != NULL) {
575
+ const char *last_name = type->str;
576
+ const char *s;
577
+ for (s = type->str; *s; s++)
578
+ if (*s == '|') last_name = s+1;
579
+ return last_name;
580
+ }
581
+ else
582
+ return type->name;
583
+ }
584
+
585
+ /*
586
+ Set the clientdata field for a type
587
+ */
588
+ SWIGRUNTIME void
589
+ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
590
+ swig_cast_info *cast = ti->cast;
591
+ /* if (ti->clientdata == clientdata) return; */
592
+ ti->clientdata = clientdata;
593
+
594
+ while (cast) {
595
+ if (!cast->converter) {
596
+ swig_type_info *tc = cast->type;
597
+ if (!tc->clientdata) {
598
+ SWIG_TypeClientData(tc, clientdata);
599
+ }
600
+ }
601
+ cast = cast->next;
602
+ }
603
+ }
604
+ SWIGRUNTIME void
605
+ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
606
+ SWIG_TypeClientData(ti, clientdata);
607
+ ti->owndata = 1;
608
+ }
609
+
610
+ /*
611
+ Search for a swig_type_info structure only by mangled name
612
+ Search is a O(log #types)
613
+
614
+ We start searching at module start, and finish searching when start == end.
615
+ Note: if start == end at the beginning of the function, we go all the way around
616
+ the circular list.
617
+ */
618
+ SWIGRUNTIME swig_type_info *
619
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
620
+ swig_module_info *end,
621
+ const char *name) {
622
+ swig_module_info *iter = start;
623
+ do {
624
+ if (iter->size) {
625
+ register size_t l = 0;
626
+ register size_t r = iter->size - 1;
627
+ do {
628
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
629
+ register size_t i = (l + r) >> 1;
630
+ const char *iname = iter->types[i]->name;
631
+ if (iname) {
632
+ register int compare = strcmp(name, iname);
633
+ if (compare == 0) {
634
+ return iter->types[i];
635
+ } else if (compare < 0) {
636
+ if (i) {
637
+ r = i - 1;
638
+ } else {
639
+ break;
640
+ }
641
+ } else if (compare > 0) {
642
+ l = i + 1;
643
+ }
644
+ } else {
645
+ break; /* should never happen */
646
+ }
647
+ } while (l <= r);
648
+ }
649
+ iter = iter->next;
650
+ } while (iter != end);
651
+ return 0;
652
+ }
653
+
654
+ /*
655
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
656
+ It first searches the mangled names of the types, which is a O(log #types)
657
+ If a type is not found it then searches the human readable names, which is O(#types).
658
+
659
+ We start searching at module start, and finish searching when start == end.
660
+ Note: if start == end at the beginning of the function, we go all the way around
661
+ the circular list.
662
+ */
663
+ SWIGRUNTIME swig_type_info *
664
+ SWIG_TypeQueryModule(swig_module_info *start,
665
+ swig_module_info *end,
666
+ const char *name) {
667
+ /* STEP 1: Search the name field using binary search */
668
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
669
+ if (ret) {
670
+ return ret;
671
+ } else {
672
+ /* STEP 2: If the type hasn't been found, do a complete search
673
+ of the str field (the human readable name) */
674
+ swig_module_info *iter = start;
675
+ do {
676
+ register size_t i = 0;
677
+ for (; i < iter->size; ++i) {
678
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
679
+ return iter->types[i];
680
+ }
681
+ iter = iter->next;
682
+ } while (iter != end);
683
+ }
684
+
685
+ /* neither found a match */
686
+ return 0;
687
+ }
688
+
689
+ /*
690
+ Pack binary data into a string
691
+ */
692
+ SWIGRUNTIME char *
693
+ SWIG_PackData(char *c, void *ptr, size_t sz) {
694
+ static const char hex[17] = "0123456789abcdef";
695
+ register const unsigned char *u = (unsigned char *) ptr;
696
+ register const unsigned char *eu = u + sz;
697
+ for (; u != eu; ++u) {
698
+ register unsigned char uu = *u;
699
+ *(c++) = hex[(uu & 0xf0) >> 4];
700
+ *(c++) = hex[uu & 0xf];
701
+ }
702
+ return c;
703
+ }
704
+
705
+ /*
706
+ Unpack binary data from a string
707
+ */
708
+ SWIGRUNTIME const char *
709
+ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
710
+ register unsigned char *u = (unsigned char *) ptr;
711
+ register const unsigned char *eu = u + sz;
712
+ for (; u != eu; ++u) {
713
+ register char d = *(c++);
714
+ register unsigned char uu;
715
+ if ((d >= '0') && (d <= '9'))
716
+ uu = ((d - '0') << 4);
717
+ else if ((d >= 'a') && (d <= 'f'))
718
+ uu = ((d - ('a'-10)) << 4);
719
+ else
720
+ return (char *) 0;
721
+ d = *(c++);
722
+ if ((d >= '0') && (d <= '9'))
723
+ uu |= (d - '0');
724
+ else if ((d >= 'a') && (d <= 'f'))
725
+ uu |= (d - ('a'-10));
726
+ else
727
+ return (char *) 0;
728
+ *u = uu;
729
+ }
730
+ return c;
731
+ }
732
+
733
+ /*
734
+ Pack 'void *' into a string buffer.
735
+ */
736
+ SWIGRUNTIME char *
737
+ SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
738
+ char *r = buff;
739
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
740
+ *(r++) = '_';
741
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
742
+ if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
743
+ strcpy(r,name);
744
+ return buff;
745
+ }
746
+
747
+ SWIGRUNTIME const char *
748
+ SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
749
+ if (*c != '_') {
750
+ if (strcmp(c,"NULL") == 0) {
751
+ *ptr = (void *) 0;
752
+ return name;
753
+ } else {
754
+ return 0;
755
+ }
756
+ }
757
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
758
+ }
759
+
760
+ SWIGRUNTIME char *
761
+ SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
762
+ char *r = buff;
763
+ size_t lname = (name ? strlen(name) : 0);
764
+ if ((2*sz + 2 + lname) > bsz) return 0;
765
+ *(r++) = '_';
766
+ r = SWIG_PackData(r,ptr,sz);
767
+ if (lname) {
768
+ strncpy(r,name,lname+1);
769
+ } else {
770
+ *r = 0;
771
+ }
772
+ return buff;
773
+ }
774
+
775
+ SWIGRUNTIME const char *
776
+ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
777
+ if (*c != '_') {
778
+ if (strcmp(c,"NULL") == 0) {
779
+ memset(ptr,0,sz);
780
+ return name;
781
+ } else {
782
+ return 0;
783
+ }
784
+ }
785
+ return SWIG_UnpackData(++c,ptr,sz);
786
+ }
787
+
788
+ #ifdef __cplusplus
789
+ }
790
+ #endif
791
+
792
+ /* Errors in SWIG */
793
+ #define SWIG_UnknownError -1
794
+ #define SWIG_IOError -2
795
+ #define SWIG_RuntimeError -3
796
+ #define SWIG_IndexError -4
797
+ #define SWIG_TypeError -5
798
+ #define SWIG_DivisionByZero -6
799
+ #define SWIG_OverflowError -7
800
+ #define SWIG_SyntaxError -8
801
+ #define SWIG_ValueError -9
802
+ #define SWIG_SystemError -10
803
+ #define SWIG_AttributeError -11
804
+ #define SWIG_MemoryError -12
805
+ #define SWIG_NullReferenceError -13
806
+
807
+
808
+
809
+ #include <ruby.h>
810
+
811
+ /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
812
+ #ifndef NUM2LL
813
+ #define NUM2LL(x) NUM2LONG((x))
814
+ #endif
815
+ #ifndef LL2NUM
816
+ #define LL2NUM(x) INT2NUM((long) (x))
817
+ #endif
818
+ #ifndef ULL2NUM
819
+ #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
820
+ #endif
821
+
822
+ /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
823
+ #ifndef NUM2ULL
824
+ #ifdef HAVE_LONG_LONG
825
+ #define NUM2ULL(x) rb_num2ull((x))
826
+ #else
827
+ #define NUM2ULL(x) NUM2ULONG(x)
828
+ #endif
829
+ #endif
830
+
831
+ /* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
832
+ /* Define these for older versions so we can just write code the new way */
833
+ #ifndef RSTRING_LEN
834
+ # define RSTRING_LEN(x) RSTRING(x)->len
835
+ #endif
836
+ #ifndef RSTRING_PTR
837
+ # define RSTRING_PTR(x) RSTRING(x)->ptr
838
+ #endif
839
+ #ifndef RARRAY_LEN
840
+ # define RARRAY_LEN(x) RARRAY(x)->len
841
+ #endif
842
+ #ifndef RARRAY_PTR
843
+ # define RARRAY_PTR(x) RARRAY(x)->ptr
844
+ #endif
845
+
846
+ /*
847
+ * Need to be very careful about how these macros are defined, especially
848
+ * when compiling C++ code or C code with an ANSI C compiler.
849
+ *
850
+ * VALUEFUNC(f) is a macro used to typecast a C function that implements
851
+ * a Ruby method so that it can be passed as an argument to API functions
852
+ * like rb_define_method() and rb_define_singleton_method().
853
+ *
854
+ * VOIDFUNC(f) is a macro used to typecast a C function that implements
855
+ * either the "mark" or "free" stuff for a Ruby Data object, so that it
856
+ * can be passed as an argument to API functions like Data_Wrap_Struct()
857
+ * and Data_Make_Struct().
858
+ */
859
+
860
+ #ifdef __cplusplus
861
+ # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
862
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
863
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
864
+ # define VOIDFUNC(f) ((void (*)()) f)
865
+ # else
866
+ # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
867
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
868
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
869
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
870
+ # else /* These definitions should work for Ruby 1.7+ */
871
+ # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
872
+ # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
873
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
874
+ # endif
875
+ # endif
876
+ #else
877
+ # define VALUEFUNC(f) (f)
878
+ # define VOIDFUNC(f) (f)
879
+ #endif
880
+
881
+ /* Don't use for expressions have side effect */
882
+ #ifndef RB_STRING_VALUE
883
+ #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
884
+ #endif
885
+ #ifndef StringValue
886
+ #define StringValue(s) RB_STRING_VALUE(s)
887
+ #endif
888
+ #ifndef StringValuePtr
889
+ #define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s))
890
+ #endif
891
+ #ifndef StringValueLen
892
+ #define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
893
+ #endif
894
+ #ifndef SafeStringValue
895
+ #define SafeStringValue(v) do {\
896
+ StringValue(v);\
897
+ rb_check_safe_str(v);\
898
+ } while (0)
899
+ #endif
900
+
901
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
902
+ #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
903
+ #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
904
+ #endif
905
+
906
+
907
+ /* -----------------------------------------------------------------------------
908
+ * error manipulation
909
+ * ----------------------------------------------------------------------------- */
910
+
911
+
912
+ /* Define some additional error types */
913
+ #define SWIG_ObjectPreviouslyDeletedError -100
914
+
915
+
916
+ /* Define custom exceptions for errors that do not map to existing Ruby
917
+ exceptions. Note this only works for C++ since a global cannot be
918
+ initialized by a funtion in C. For C, fallback to rb_eRuntimeError.*/
919
+
920
+ SWIGINTERN VALUE
921
+ getNullReferenceError(void) {
922
+ static int init = 0;
923
+ static VALUE rb_eNullReferenceError ;
924
+ if (!init) {
925
+ init = 1;
926
+ rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
927
+ }
928
+ return rb_eNullReferenceError;
929
+ }
930
+
931
+ SWIGINTERN VALUE
932
+ getObjectPreviouslyDeletedError(void) {
933
+ static int init = 0;
934
+ static VALUE rb_eObjectPreviouslyDeleted ;
935
+ if (!init) {
936
+ init = 1;
937
+ rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
938
+ }
939
+ return rb_eObjectPreviouslyDeleted;
940
+ }
941
+
942
+
943
+ SWIGINTERN VALUE
944
+ SWIG_Ruby_ErrorType(int SWIG_code) {
945
+ VALUE type;
946
+ switch (SWIG_code) {
947
+ case SWIG_MemoryError:
948
+ type = rb_eNoMemError;
949
+ break;
950
+ case SWIG_IOError:
951
+ type = rb_eIOError;
952
+ break;
953
+ case SWIG_RuntimeError:
954
+ type = rb_eRuntimeError;
955
+ break;
956
+ case SWIG_IndexError:
957
+ type = rb_eIndexError;
958
+ break;
959
+ case SWIG_TypeError:
960
+ type = rb_eTypeError;
961
+ break;
962
+ case SWIG_DivisionByZero:
963
+ type = rb_eZeroDivError;
964
+ break;
965
+ case SWIG_OverflowError:
966
+ type = rb_eRangeError;
967
+ break;
968
+ case SWIG_SyntaxError:
969
+ type = rb_eSyntaxError;
970
+ break;
971
+ case SWIG_ValueError:
972
+ type = rb_eArgError;
973
+ break;
974
+ case SWIG_SystemError:
975
+ type = rb_eFatal;
976
+ break;
977
+ case SWIG_AttributeError:
978
+ type = rb_eRuntimeError;
979
+ break;
980
+ case SWIG_NullReferenceError:
981
+ type = getNullReferenceError();
982
+ break;
983
+ case SWIG_ObjectPreviouslyDeletedError:
984
+ type = getObjectPreviouslyDeletedError();
985
+ break;
986
+ case SWIG_UnknownError:
987
+ type = rb_eRuntimeError;
988
+ break;
989
+ default:
990
+ type = rb_eRuntimeError;
991
+ }
992
+ return type;
993
+ }
994
+
995
+
996
+
997
+
998
+ /* -----------------------------------------------------------------------------
999
+ * See the LICENSE file for information on copyright, usage and redistribution
1000
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
1001
+ *
1002
+ * rubytracking.swg
1003
+ *
1004
+ * This file contains support for tracking mappings from
1005
+ * Ruby objects to C++ objects. This functionality is needed
1006
+ * to implement mark functions for Ruby's mark and sweep
1007
+ * garbage collector.
1008
+ * ----------------------------------------------------------------------------- */
1009
+
1010
+ #ifdef __cplusplus
1011
+ extern "C" {
1012
+ #endif
1013
+
1014
+
1015
+ /* Global Ruby hash table to store Trackings from C/C++
1016
+ structs to Ruby Objects. */
1017
+ static VALUE swig_ruby_trackings;
1018
+
1019
+ /* Global variable that stores a reference to the ruby
1020
+ hash table delete function. */
1021
+ static ID swig_ruby_hash_delete = 0;
1022
+
1023
+ /* Setup a Ruby hash table to store Trackings */
1024
+ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1025
+ /* Create a ruby hash table to store Trackings from C++
1026
+ objects to Ruby objects. Also make sure to tell
1027
+ the garabage collector about the hash table. */
1028
+ swig_ruby_trackings = rb_hash_new();
1029
+ rb_gc_register_address(&swig_ruby_trackings);
1030
+
1031
+ /* Now store a reference to the hash table delete function
1032
+ so that we only have to look it up once.*/
1033
+ swig_ruby_hash_delete = rb_intern("delete");
1034
+ }
1035
+
1036
+ /* Get a Ruby number to reference a pointer */
1037
+ SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1038
+ /* We cast the pointer to an unsigned long
1039
+ and then store a reference to it using
1040
+ a Ruby number object. */
1041
+
1042
+ /* Convert the pointer to a Ruby number */
1043
+ unsigned long value = (unsigned long) ptr;
1044
+ return LONG2NUM(value);
1045
+ }
1046
+
1047
+ /* Get a Ruby number to reference an object */
1048
+ SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1049
+ /* We cast the object to an unsigned long
1050
+ and then store a reference to it using
1051
+ a Ruby number object. */
1052
+
1053
+ /* Convert the Object to a Ruby number */
1054
+ unsigned long value = (unsigned long) object;
1055
+ return LONG2NUM(value);
1056
+ }
1057
+
1058
+ /* Get a Ruby object from a previously stored reference */
1059
+ SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1060
+ /* The provided Ruby number object is a reference
1061
+ to the Ruby object we want.*/
1062
+
1063
+ /* First convert the Ruby number to a C number */
1064
+ unsigned long value = NUM2LONG(reference);
1065
+ return (VALUE) value;
1066
+ }
1067
+
1068
+ /* Add a Tracking from a C/C++ struct to a Ruby object */
1069
+ SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
1070
+ /* In a Ruby hash table we store the pointer and
1071
+ the associated Ruby object. The trick here is
1072
+ that we cannot store the Ruby object directly - if
1073
+ we do then it cannot be garbage collected. So
1074
+ instead we typecast it as a unsigned long and
1075
+ convert it to a Ruby number object.*/
1076
+
1077
+ /* Get a reference to the pointer as a Ruby number */
1078
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1079
+
1080
+ /* Get a reference to the Ruby object as a Ruby number */
1081
+ VALUE value = SWIG_RubyObjectToReference(object);
1082
+
1083
+ /* Store the mapping to the global hash table. */
1084
+ rb_hash_aset(swig_ruby_trackings, key, value);
1085
+ }
1086
+
1087
+ /* Get the Ruby object that owns the specified C/C++ struct */
1088
+ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1089
+ /* Get a reference to the pointer as a Ruby number */
1090
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1091
+
1092
+ /* Now lookup the value stored in the global hash table */
1093
+ VALUE value = rb_hash_aref(swig_ruby_trackings, key);
1094
+
1095
+ if (value == Qnil) {
1096
+ /* No object exists - return nil. */
1097
+ return Qnil;
1098
+ }
1099
+ else {
1100
+ /* Convert this value to Ruby object */
1101
+ return SWIG_RubyReferenceToObject(value);
1102
+ }
1103
+ }
1104
+
1105
+ /* Remove a Tracking from a C/C++ struct to a Ruby object. It
1106
+ is very important to remove objects once they are destroyed
1107
+ since the same memory address may be reused later to create
1108
+ a new object. */
1109
+ SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
1110
+ /* Get a reference to the pointer as a Ruby number */
1111
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1112
+
1113
+ /* Delete the object from the hash table by calling Ruby's
1114
+ do this we need to call the Hash.delete method.*/
1115
+ rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
1116
+ }
1117
+
1118
+ /* This is a helper method that unlinks a Ruby object from its
1119
+ underlying C++ object. This is needed if the lifetime of the
1120
+ Ruby object is longer than the C++ object */
1121
+ SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
1122
+ VALUE object = SWIG_RubyInstanceFor(ptr);
1123
+
1124
+ if (object != Qnil) {
1125
+ DATA_PTR(object) = 0;
1126
+ }
1127
+ }
1128
+
1129
+
1130
+ #ifdef __cplusplus
1131
+ }
1132
+ #endif
1133
+
1134
+ /* -----------------------------------------------------------------------------
1135
+ * Ruby API portion that goes into the runtime
1136
+ * ----------------------------------------------------------------------------- */
1137
+
1138
+ #ifdef __cplusplus
1139
+ extern "C" {
1140
+ #endif
1141
+
1142
+ SWIGINTERN VALUE
1143
+ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1144
+ if (NIL_P(target)) {
1145
+ target = o;
1146
+ } else {
1147
+ if (TYPE(target) != T_ARRAY) {
1148
+ VALUE o2 = target;
1149
+ target = rb_ary_new();
1150
+ rb_ary_push(target, o2);
1151
+ }
1152
+ rb_ary_push(target, o);
1153
+ }
1154
+ return target;
1155
+ }
1156
+
1157
+ #ifdef __cplusplus
1158
+ }
1159
+ #endif
1160
+
1161
+
1162
+ /* -----------------------------------------------------------------------------
1163
+ * See the LICENSE file for information on copyright, usage and redistribution
1164
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
1165
+ *
1166
+ * rubyrun.swg
1167
+ *
1168
+ * This file contains the runtime support for Ruby modules
1169
+ * and includes code for managing global variables and pointer
1170
+ * type checking.
1171
+ * ----------------------------------------------------------------------------- */
1172
+
1173
+ /* For backward compatibility only */
1174
+ #define SWIG_POINTER_EXCEPTION 0
1175
+
1176
+ /* for raw pointers */
1177
+ #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1178
+ #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1179
+ #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
1180
+ #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
1181
+ #define swig_owntype ruby_owntype
1182
+
1183
+ /* for raw packed data */
1184
+ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
1185
+ #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1186
+
1187
+ /* for class or struct pointers */
1188
+ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1189
+ #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1190
+
1191
+ /* for C or C++ function pointers */
1192
+ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
1193
+ #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
1194
+
1195
+ /* for C++ member pointers, ie, member methods */
1196
+ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
1197
+ #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1198
+
1199
+
1200
+ /* Runtime API */
1201
+
1202
+ #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule()
1203
+ #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
1204
+
1205
+
1206
+ /* Error manipulation */
1207
+
1208
+ #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
1209
+ #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), msg)
1210
+ #define SWIG_fail goto fail
1211
+
1212
+
1213
+ /* Ruby-specific SWIG API */
1214
+
1215
+ #define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
1216
+ #define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
1217
+ #define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
1218
+ #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
1219
+ #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
1220
+
1221
+
1222
+ /* -----------------------------------------------------------------------------
1223
+ * pointers/data manipulation
1224
+ * ----------------------------------------------------------------------------- */
1225
+
1226
+ #ifdef __cplusplus
1227
+ extern "C" {
1228
+ #if 0
1229
+ } /* cc-mode */
1230
+ #endif
1231
+ #endif
1232
+
1233
+ typedef struct {
1234
+ VALUE klass;
1235
+ VALUE mImpl;
1236
+ void (*mark)(void *);
1237
+ void (*destroy)(void *);
1238
+ int trackObjects;
1239
+ } swig_class;
1240
+
1241
+
1242
+ static VALUE _mSWIG = Qnil;
1243
+ static VALUE _cSWIG_Pointer = Qnil;
1244
+ static VALUE swig_runtime_data_type_pointer = Qnil;
1245
+
1246
+ SWIGRUNTIME VALUE
1247
+ getExceptionClass(void) {
1248
+ static int init = 0;
1249
+ static VALUE rubyExceptionClass ;
1250
+ if (!init) {
1251
+ init = 1;
1252
+ rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
1253
+ }
1254
+ return rubyExceptionClass;
1255
+ }
1256
+
1257
+ /* This code checks to see if the Ruby object being raised as part
1258
+ of an exception inherits from the Ruby class Exception. If so,
1259
+ the object is simply returned. If not, then a new Ruby exception
1260
+ object is created and that will be returned to Ruby.*/
1261
+ SWIGRUNTIME VALUE
1262
+ SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
1263
+ VALUE exceptionClass = getExceptionClass();
1264
+ if (rb_obj_is_kind_of(obj, exceptionClass)) {
1265
+ return obj;
1266
+ } else {
1267
+ return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
1268
+ }
1269
+ }
1270
+
1271
+ /* Initialize Ruby runtime support */
1272
+ SWIGRUNTIME void
1273
+ SWIG_Ruby_InitRuntime(void)
1274
+ {
1275
+ if (_mSWIG == Qnil) {
1276
+ _mSWIG = rb_define_module("SWIG");
1277
+ }
1278
+ }
1279
+
1280
+ /* Define Ruby class for C type */
1281
+ SWIGRUNTIME void
1282
+ SWIG_Ruby_define_class(swig_type_info *type)
1283
+ {
1284
+ VALUE klass;
1285
+ char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1286
+ sprintf(klass_name, "TYPE%s", type->name);
1287
+ if (NIL_P(_cSWIG_Pointer)) {
1288
+ _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
1289
+ rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
1290
+ }
1291
+ klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1292
+ free((void *) klass_name);
1293
+ }
1294
+
1295
+ /* Create a new pointer object */
1296
+ SWIGRUNTIME VALUE
1297
+ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1298
+ {
1299
+ int own = flags & SWIG_POINTER_OWN;
1300
+
1301
+ char *klass_name;
1302
+ swig_class *sklass;
1303
+ VALUE klass;
1304
+ VALUE obj;
1305
+
1306
+ if (!ptr)
1307
+ return Qnil;
1308
+
1309
+ if (type->clientdata) {
1310
+ sklass = (swig_class *) type->clientdata;
1311
+
1312
+ /* Are we tracking this class and have we already returned this Ruby object? */
1313
+ if (sklass->trackObjects) {
1314
+ obj = SWIG_RubyInstanceFor(ptr);
1315
+
1316
+ /* Check the object's type and make sure it has the correct type.
1317
+ It might not in cases where methods do things like
1318
+ downcast methods. */
1319
+ if (obj != Qnil) {
1320
+ VALUE value = rb_iv_get(obj, "__swigtype__");
1321
+ char* type_name = RSTRING_PTR(value);
1322
+
1323
+ if (strcmp(type->name, type_name) == 0) {
1324
+ return obj;
1325
+ }
1326
+ }
1327
+ }
1328
+
1329
+ /* Create a new Ruby object */
1330
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), (own ? VOIDFUNC(sklass->destroy) : 0), ptr);
1331
+
1332
+ /* If tracking is on for this class then track this object. */
1333
+ if (sklass->trackObjects) {
1334
+ SWIG_RubyAddTracking(ptr, obj);
1335
+ }
1336
+ } else {
1337
+ klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1338
+ sprintf(klass_name, "TYPE%s", type->name);
1339
+ klass = rb_const_get(_mSWIG, rb_intern(klass_name));
1340
+ free((void *) klass_name);
1341
+ obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1342
+ }
1343
+ rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
1344
+
1345
+ return obj;
1346
+ }
1347
+
1348
+ /* Create a new class instance (always owned) */
1349
+ SWIGRUNTIME VALUE
1350
+ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1351
+ {
1352
+ VALUE obj;
1353
+ swig_class *sklass = (swig_class *) type->clientdata;
1354
+ obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
1355
+ rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
1356
+ return obj;
1357
+ }
1358
+
1359
+ /* Get type mangle from class name */
1360
+ SWIGRUNTIMEINLINE char *
1361
+ SWIG_Ruby_MangleStr(VALUE obj)
1362
+ {
1363
+ VALUE stype = rb_iv_get(obj, "__swigtype__");
1364
+ return StringValuePtr(stype);
1365
+ }
1366
+
1367
+ /* Acquire a pointer value */
1368
+ typedef void (*ruby_owntype)(void*);
1369
+
1370
+ SWIGRUNTIME ruby_owntype
1371
+ SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
1372
+ if (obj) {
1373
+ ruby_owntype oldown = RDATA(obj)->dfree;
1374
+ RDATA(obj)->dfree = own;
1375
+ return oldown;
1376
+ } else {
1377
+ return 0;
1378
+ }
1379
+ }
1380
+
1381
+ /* Convert a pointer value */
1382
+ SWIGRUNTIME int
1383
+ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
1384
+ {
1385
+ char *c;
1386
+ swig_cast_info *tc;
1387
+ void *vptr = 0;
1388
+
1389
+ /* Grab the pointer */
1390
+ if (NIL_P(obj)) {
1391
+ *ptr = 0;
1392
+ return SWIG_OK;
1393
+ } else {
1394
+ if (TYPE(obj) != T_DATA) {
1395
+ return SWIG_ERROR;
1396
+ }
1397
+ Data_Get_Struct(obj, void, vptr);
1398
+ }
1399
+
1400
+ if (own) *own = RDATA(obj)->dfree;
1401
+
1402
+ /* Check to see if the input object is giving up ownership
1403
+ of the underlying C struct or C++ object. If so then we
1404
+ need to reset the destructor since the Ruby object no
1405
+ longer owns the underlying C++ object.*/
1406
+ if (flags & SWIG_POINTER_DISOWN) {
1407
+ /* Is tracking on for this class? */
1408
+ int track = 0;
1409
+ if (ty && ty->clientdata) {
1410
+ swig_class *sklass = (swig_class *) ty->clientdata;
1411
+ track = sklass->trackObjects;
1412
+ }
1413
+
1414
+ if (track) {
1415
+ /* We are tracking objects for this class. Thus we change the destructor
1416
+ * to SWIG_RubyRemoveTracking. This allows us to
1417
+ * remove the mapping from the C++ to Ruby object
1418
+ * when the Ruby object is garbage collected. If we don't
1419
+ * do this, then it is possible we will return a reference
1420
+ * to a Ruby object that no longer exists thereby crashing Ruby. */
1421
+ RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
1422
+ } else {
1423
+ RDATA(obj)->dfree = 0;
1424
+ }
1425
+ }
1426
+
1427
+ /* Do type-checking if type info was provided */
1428
+ if (ty) {
1429
+ if (ty->clientdata) {
1430
+ if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
1431
+ if (vptr == 0) {
1432
+ /* The object has already been deleted */
1433
+ return SWIG_ObjectPreviouslyDeletedError;
1434
+ }
1435
+ *ptr = vptr;
1436
+ return SWIG_OK;
1437
+ }
1438
+ }
1439
+ if ((c = SWIG_MangleStr(obj)) == NULL) {
1440
+ return SWIG_ERROR;
1441
+ }
1442
+ tc = SWIG_TypeCheck(c, ty);
1443
+ if (!tc) {
1444
+ return SWIG_ERROR;
1445
+ }
1446
+ *ptr = SWIG_TypeCast(tc, vptr);
1447
+ } else {
1448
+ *ptr = vptr;
1449
+ }
1450
+
1451
+ return SWIG_OK;
1452
+ }
1453
+
1454
+ /* Check convert */
1455
+ SWIGRUNTIMEINLINE int
1456
+ SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
1457
+ {
1458
+ char *c = SWIG_MangleStr(obj);
1459
+ if (!c) return 0;
1460
+ return SWIG_TypeCheck(c,ty) != 0;
1461
+ }
1462
+
1463
+ SWIGRUNTIME VALUE
1464
+ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
1465
+ char result[1024];
1466
+ char *r = result;
1467
+ if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
1468
+ *(r++) = '_';
1469
+ r = SWIG_PackData(r, ptr, sz);
1470
+ strcpy(r, type->name);
1471
+ return rb_str_new2(result);
1472
+ }
1473
+
1474
+ /* Convert a packed value value */
1475
+ SWIGRUNTIME int
1476
+ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
1477
+ swig_cast_info *tc;
1478
+ const char *c;
1479
+
1480
+ if (TYPE(obj) != T_STRING) goto type_error;
1481
+ c = StringValuePtr(obj);
1482
+ /* Pointer values must start with leading underscore */
1483
+ if (*c != '_') goto type_error;
1484
+ c++;
1485
+ c = SWIG_UnpackData(c, ptr, sz);
1486
+ if (ty) {
1487
+ tc = SWIG_TypeCheck(c, ty);
1488
+ if (!tc) goto type_error;
1489
+ }
1490
+ return SWIG_OK;
1491
+
1492
+ type_error:
1493
+ return SWIG_ERROR;
1494
+ }
1495
+
1496
+ SWIGRUNTIME swig_module_info *
1497
+ SWIG_Ruby_GetModule(void)
1498
+ {
1499
+ VALUE pointer;
1500
+ swig_module_info *ret = 0;
1501
+ VALUE verbose = rb_gv_get("VERBOSE");
1502
+
1503
+ /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
1504
+ rb_gv_set("VERBOSE", Qfalse);
1505
+
1506
+ /* first check if pointer already created */
1507
+ pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
1508
+ if (pointer != Qnil) {
1509
+ Data_Get_Struct(pointer, swig_module_info, ret);
1510
+ }
1511
+
1512
+ /* reinstate warnings */
1513
+ rb_gv_set("VERBOSE", verbose);
1514
+ return ret;
1515
+ }
1516
+
1517
+ SWIGRUNTIME void
1518
+ SWIG_Ruby_SetModule(swig_module_info *pointer)
1519
+ {
1520
+ /* register a new class */
1521
+ VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
1522
+ /* create and store the structure pointer to a global variable */
1523
+ swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
1524
+ rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
1525
+ }
1526
+
1527
+ #ifdef __cplusplus
1528
+ #if 0
1529
+ { /* cc-mode */
1530
+ #endif
1531
+ }
1532
+ #endif
1533
+
1534
+
1535
+
1536
+ #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1537
+
1538
+ #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1539
+
1540
+
1541
+
1542
+ /* -------- TYPES TABLE (BEGIN) -------- */
1543
+
1544
+ #define SWIGTYPE_p_AStarSearchTMapSearchNode_t swig_types[0]
1545
+ #define SWIGTYPE_p_HeyesDriver swig_types[1]
1546
+ #define SWIGTYPE_p_Map swig_types[2]
1547
+ #define SWIGTYPE_p_MapSearchNode swig_types[3]
1548
+ #define SWIGTYPE_p_char swig_types[4]
1549
+ #define SWIGTYPE_p_clock_t swig_types[5]
1550
+ #define SWIGTYPE_p_int swig_types[6]
1551
+ static swig_type_info *swig_types[8];
1552
+ static swig_module_info swig_module = {swig_types, 7, 0, 0, 0, 0};
1553
+ #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1554
+ #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1555
+
1556
+ /* -------- TYPES TABLE (END) -------- */
1557
+
1558
+ #define SWIG_init Init_heyes
1559
+ #define SWIG_name "Heyes"
1560
+
1561
+ static VALUE mHeyes;
1562
+
1563
+ #define SWIGVERSION 0x010331
1564
+ #define SWIG_VERSION SWIGVERSION
1565
+
1566
+
1567
+ #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
1568
+ #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
1569
+
1570
+
1571
+ #include <stdexcept>
1572
+
1573
+
1574
+ #include "../ext/stlastar.h"
1575
+ #include "../ext/findpath.h"
1576
+
1577
+
1578
+ #include <limits.h>
1579
+ #ifndef LLONG_MIN
1580
+ # define LLONG_MIN LONG_LONG_MIN
1581
+ #endif
1582
+ #ifndef LLONG_MAX
1583
+ # define LLONG_MAX LONG_LONG_MAX
1584
+ #endif
1585
+ #ifndef ULLONG_MAX
1586
+ # define ULLONG_MAX ULONG_LONG_MAX
1587
+ #endif
1588
+
1589
+
1590
+ #define SWIG_From_long LONG2NUM
1591
+
1592
+
1593
+ SWIGINTERNINLINE VALUE
1594
+ SWIG_From_int (int value)
1595
+ {
1596
+ return SWIG_From_long (value);
1597
+ }
1598
+
1599
+
1600
+ SWIGINTERN VALUE
1601
+ SWIG_ruby_failed(void)
1602
+ {
1603
+ return Qnil;
1604
+ }
1605
+
1606
+
1607
+ /*@SWIG:%ruby_aux_method@*/
1608
+ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
1609
+ {
1610
+ VALUE obj = args[0];
1611
+ VALUE type = TYPE(obj);
1612
+ long *res = (long *)(args[1]);
1613
+ *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
1614
+ return obj;
1615
+ }
1616
+ /*@SWIG@*/
1617
+
1618
+ SWIGINTERN int
1619
+ SWIG_AsVal_long (VALUE obj, long* val)
1620
+ {
1621
+ VALUE type = TYPE(obj);
1622
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
1623
+ long v;
1624
+ VALUE a[2];
1625
+ a[0] = obj;
1626
+ a[1] = (VALUE)(&v);
1627
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
1628
+ if (val) *val = v;
1629
+ return SWIG_OK;
1630
+ }
1631
+ }
1632
+ return SWIG_TypeError;
1633
+ }
1634
+
1635
+
1636
+ SWIGINTERN int
1637
+ SWIG_AsVal_int (VALUE obj, int *val)
1638
+ {
1639
+ long v;
1640
+ int res = SWIG_AsVal_long (obj, &v);
1641
+ if (SWIG_IsOK(res)) {
1642
+ if ((v < INT_MIN || v > INT_MAX)) {
1643
+ return SWIG_OverflowError;
1644
+ } else {
1645
+ if (val) *val = static_cast< int >(v);
1646
+ }
1647
+ }
1648
+ return res;
1649
+ }
1650
+
1651
+
1652
+ /*@SWIG:%ruby_aux_method@*/
1653
+ SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
1654
+ {
1655
+ VALUE obj = args[0];
1656
+ VALUE type = TYPE(obj);
1657
+ unsigned long *res = (unsigned long *)(args[1]);
1658
+ *res = type == T_FIXNUM ? NUM2ULONG(obj) : rb_big2ulong(obj);
1659
+ return obj;
1660
+ }
1661
+ /*@SWIG@*/
1662
+
1663
+ SWIGINTERN int
1664
+ SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val)
1665
+ {
1666
+ VALUE type = TYPE(obj);
1667
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
1668
+ unsigned long v;
1669
+ VALUE a[2];
1670
+ a[0] = obj;
1671
+ a[1] = (VALUE)(&v);
1672
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
1673
+ if (val) *val = v;
1674
+ return SWIG_OK;
1675
+ }
1676
+ }
1677
+ return SWIG_TypeError;
1678
+ }
1679
+
1680
+
1681
+ SWIGINTERN int
1682
+ SWIG_AsVal_unsigned_SS_int (VALUE obj, unsigned int *val)
1683
+ {
1684
+ unsigned long v;
1685
+ int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
1686
+ if (SWIG_IsOK(res)) {
1687
+ if ((v > UINT_MAX)) {
1688
+ return SWIG_OverflowError;
1689
+ } else {
1690
+ if (val) *val = static_cast< unsigned int >(v);
1691
+ }
1692
+ }
1693
+ return res;
1694
+ }
1695
+
1696
+
1697
+ SWIGINTERNINLINE VALUE
1698
+ SWIG_From_unsigned_SS_long (unsigned long value)
1699
+ {
1700
+ return ULONG2NUM(value);
1701
+ }
1702
+
1703
+
1704
+ SWIGINTERNINLINE VALUE
1705
+ SWIG_From_unsigned_SS_int (unsigned int value)
1706
+ {
1707
+ return SWIG_From_unsigned_SS_long (value);
1708
+ }
1709
+
1710
+
1711
+ #define SWIG_From_double rb_float_new
1712
+
1713
+
1714
+ SWIGINTERNINLINE VALUE
1715
+ SWIG_From_float (float value)
1716
+ {
1717
+ return SWIG_From_double (value);
1718
+ }
1719
+
1720
+
1721
+ SWIGINTERNINLINE VALUE
1722
+ SWIG_From_bool (bool value)
1723
+ {
1724
+ return value ? Qtrue : Qfalse;
1725
+ }
1726
+
1727
+
1728
+ /*@SWIG:%ruby_aux_method@*/
1729
+ SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE *args)
1730
+ {
1731
+ VALUE obj = args[0];
1732
+ VALUE type = TYPE(obj);
1733
+ double *res = (double *)(args[1]);
1734
+ *res = (type == T_FLOAT ? NUM2DBL(obj) : (type == T_FIXNUM ? (double) FIX2INT(obj) : rb_big2dbl(obj)));
1735
+ return obj;
1736
+ }
1737
+ /*@SWIG@*/
1738
+
1739
+ SWIGINTERN int
1740
+ SWIG_AsVal_double (VALUE obj, double *val)
1741
+ {
1742
+ VALUE type = TYPE(obj);
1743
+ if ((type == T_FLOAT) || (type == T_FIXNUM) || (type == T_BIGNUM)) {
1744
+ double v;
1745
+ VALUE a[2];
1746
+ a[0] = obj;
1747
+ a[1] = (VALUE)(&v);
1748
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2DBL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
1749
+ if (val) *val = v;
1750
+ return SWIG_OK;
1751
+ }
1752
+ }
1753
+ return SWIG_TypeError;
1754
+ }
1755
+
1756
+ SWIGINTERN VALUE
1757
+ DEBUG_get(VALUE self) {
1758
+ VALUE _val;
1759
+
1760
+ _val = SWIG_From_int(static_cast< int >(DEBUG));
1761
+ return _val;
1762
+ }
1763
+
1764
+
1765
+ SWIGINTERN VALUE
1766
+ DEBUG_set(VALUE self, VALUE _val) {
1767
+ {
1768
+ int val;
1769
+ int res = SWIG_AsVal_int(_val, &val);
1770
+ if (!SWIG_IsOK(res)) {
1771
+ SWIG_exception_fail(SWIG_ArgError(res), "in variable '""DEBUG""' of type '""int""'");
1772
+ }
1773
+ DEBUG = static_cast< int >(val);
1774
+ }
1775
+ return _val;
1776
+ fail:
1777
+ return Qnil;
1778
+ }
1779
+
1780
+
1781
+ swig_class cMap;
1782
+
1783
+ SWIGINTERN VALUE
1784
+ _wrap_Map_width_set(int argc, VALUE *argv, VALUE self) {
1785
+ Map *arg1 = (Map *) 0 ;
1786
+ int arg2 ;
1787
+ void *argp1 = 0 ;
1788
+ int res1 = 0 ;
1789
+ int val2 ;
1790
+ int ecode2 = 0 ;
1791
+
1792
+ if ((argc < 1) || (argc > 1)) {
1793
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
1794
+ }
1795
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Map, 0 | 0 );
1796
+ if (!SWIG_IsOK(res1)) {
1797
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "width" "', argument " "1"" of type '" "Map *""'");
1798
+ }
1799
+ arg1 = reinterpret_cast< Map * >(argp1);
1800
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
1801
+ if (!SWIG_IsOK(ecode2)) {
1802
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "width" "', argument " "2"" of type '" "int""'");
1803
+ }
1804
+ arg2 = static_cast< int >(val2);
1805
+ if (arg1) (arg1)->width = arg2;
1806
+
1807
+ return Qnil;
1808
+ fail:
1809
+ return Qnil;
1810
+ }
1811
+
1812
+
1813
+ SWIGINTERN VALUE
1814
+ _wrap_Map_width_get(int argc, VALUE *argv, VALUE self) {
1815
+ Map *arg1 = (Map *) 0 ;
1816
+ int result;
1817
+ void *argp1 = 0 ;
1818
+ int res1 = 0 ;
1819
+ VALUE vresult = Qnil;
1820
+
1821
+ if ((argc < 0) || (argc > 0)) {
1822
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
1823
+ }
1824
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Map, 0 | 0 );
1825
+ if (!SWIG_IsOK(res1)) {
1826
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "width" "', argument " "1"" of type '" "Map *""'");
1827
+ }
1828
+ arg1 = reinterpret_cast< Map * >(argp1);
1829
+ result = (int) ((arg1)->width);
1830
+ vresult = SWIG_From_int(static_cast< int >(result));
1831
+ return vresult;
1832
+ fail:
1833
+ return Qnil;
1834
+ }
1835
+
1836
+
1837
+ SWIGINTERN VALUE
1838
+ _wrap_Map_height_set(int argc, VALUE *argv, VALUE self) {
1839
+ Map *arg1 = (Map *) 0 ;
1840
+ int arg2 ;
1841
+ void *argp1 = 0 ;
1842
+ int res1 = 0 ;
1843
+ int val2 ;
1844
+ int ecode2 = 0 ;
1845
+
1846
+ if ((argc < 1) || (argc > 1)) {
1847
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
1848
+ }
1849
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Map, 0 | 0 );
1850
+ if (!SWIG_IsOK(res1)) {
1851
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "height" "', argument " "1"" of type '" "Map *""'");
1852
+ }
1853
+ arg1 = reinterpret_cast< Map * >(argp1);
1854
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
1855
+ if (!SWIG_IsOK(ecode2)) {
1856
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "height" "', argument " "2"" of type '" "int""'");
1857
+ }
1858
+ arg2 = static_cast< int >(val2);
1859
+ if (arg1) (arg1)->height = arg2;
1860
+
1861
+ return Qnil;
1862
+ fail:
1863
+ return Qnil;
1864
+ }
1865
+
1866
+
1867
+ SWIGINTERN VALUE
1868
+ _wrap_Map_height_get(int argc, VALUE *argv, VALUE self) {
1869
+ Map *arg1 = (Map *) 0 ;
1870
+ int result;
1871
+ void *argp1 = 0 ;
1872
+ int res1 = 0 ;
1873
+ VALUE vresult = Qnil;
1874
+
1875
+ if ((argc < 0) || (argc > 0)) {
1876
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
1877
+ }
1878
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Map, 0 | 0 );
1879
+ if (!SWIG_IsOK(res1)) {
1880
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "height" "', argument " "1"" of type '" "Map *""'");
1881
+ }
1882
+ arg1 = reinterpret_cast< Map * >(argp1);
1883
+ result = (int) ((arg1)->height);
1884
+ vresult = SWIG_From_int(static_cast< int >(result));
1885
+ return vresult;
1886
+ fail:
1887
+ return Qnil;
1888
+ }
1889
+
1890
+
1891
+ SWIGINTERN VALUE
1892
+ _wrap_Map_map_set(int argc, VALUE *argv, VALUE self) {
1893
+ Map *arg1 = (Map *) 0 ;
1894
+ int *arg2 = (int *) 0 ;
1895
+ void *argp1 = 0 ;
1896
+ int res1 = 0 ;
1897
+ void *argp2 = 0 ;
1898
+ int res2 = 0 ;
1899
+
1900
+ if ((argc < 1) || (argc > 1)) {
1901
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
1902
+ }
1903
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Map, 0 | 0 );
1904
+ if (!SWIG_IsOK(res1)) {
1905
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "map" "', argument " "1"" of type '" "Map *""'");
1906
+ }
1907
+ arg1 = reinterpret_cast< Map * >(argp1);
1908
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_int, SWIG_POINTER_DISOWN | 0 );
1909
+ if (!SWIG_IsOK(res2)) {
1910
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "map" "', argument " "2"" of type '" "int *""'");
1911
+ }
1912
+ arg2 = reinterpret_cast< int * >(argp2);
1913
+ if (arg1) (arg1)->map = arg2;
1914
+
1915
+ return Qnil;
1916
+ fail:
1917
+ return Qnil;
1918
+ }
1919
+
1920
+
1921
+ SWIGINTERN VALUE
1922
+ _wrap_Map_map_get(int argc, VALUE *argv, VALUE self) {
1923
+ Map *arg1 = (Map *) 0 ;
1924
+ int *result = 0 ;
1925
+ void *argp1 = 0 ;
1926
+ int res1 = 0 ;
1927
+ VALUE vresult = Qnil;
1928
+
1929
+ if ((argc < 0) || (argc > 0)) {
1930
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
1931
+ }
1932
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Map, 0 | 0 );
1933
+ if (!SWIG_IsOK(res1)) {
1934
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "map" "', argument " "1"" of type '" "Map *""'");
1935
+ }
1936
+ arg1 = reinterpret_cast< Map * >(argp1);
1937
+ result = (int *) ((arg1)->map);
1938
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 );
1939
+ return vresult;
1940
+ fail:
1941
+ return Qnil;
1942
+ }
1943
+
1944
+
1945
+ SWIGINTERN VALUE
1946
+ _wrap_new_Map__SWIG_0(int argc, VALUE *argv, VALUE self) {
1947
+ int arg1 ;
1948
+ int arg2 ;
1949
+ Map *result = 0 ;
1950
+ int val1 ;
1951
+ int ecode1 = 0 ;
1952
+ int val2 ;
1953
+ int ecode2 = 0 ;
1954
+
1955
+ if ((argc < 2) || (argc > 2)) {
1956
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
1957
+ }
1958
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
1959
+ if (!SWIG_IsOK(ecode1)) {
1960
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Map" "', argument " "1"" of type '" "int""'");
1961
+ }
1962
+ arg1 = static_cast< int >(val1);
1963
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
1964
+ if (!SWIG_IsOK(ecode2)) {
1965
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Map" "', argument " "2"" of type '" "int""'");
1966
+ }
1967
+ arg2 = static_cast< int >(val2);
1968
+ result = (Map *)new Map(arg1,arg2);DATA_PTR(self) = result;
1969
+
1970
+ return self;
1971
+ fail:
1972
+ return Qnil;
1973
+ }
1974
+
1975
+
1976
+ SWIGINTERN VALUE
1977
+ _wrap_new_Map__SWIG_1(int argc, VALUE *argv, VALUE self) {
1978
+ int arg1 ;
1979
+ Map *result = 0 ;
1980
+ int val1 ;
1981
+ int ecode1 = 0 ;
1982
+
1983
+ if ((argc < 1) || (argc > 1)) {
1984
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
1985
+ }
1986
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
1987
+ if (!SWIG_IsOK(ecode1)) {
1988
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Map" "', argument " "1"" of type '" "int""'");
1989
+ }
1990
+ arg1 = static_cast< int >(val1);
1991
+ result = (Map *)new Map(arg1);DATA_PTR(self) = result;
1992
+
1993
+ return self;
1994
+ fail:
1995
+ return Qnil;
1996
+ }
1997
+
1998
+
1999
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2000
+ SWIGINTERN VALUE
2001
+ _wrap_Map_allocate(VALUE self) {
2002
+ #else
2003
+ SWIGINTERN VALUE
2004
+ _wrap_Map_allocate(int argc, VALUE *argv, VALUE self) {
2005
+ #endif
2006
+
2007
+
2008
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Map);
2009
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2010
+ rb_obj_call_init(vresult, argc, argv);
2011
+ #endif
2012
+ return vresult;
2013
+ }
2014
+
2015
+
2016
+ SWIGINTERN VALUE
2017
+ _wrap_new_Map__SWIG_2(int argc, VALUE *argv, VALUE self) {
2018
+ Map *result = 0 ;
2019
+
2020
+ if ((argc < 0) || (argc > 0)) {
2021
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2022
+ }
2023
+ result = (Map *)new Map();DATA_PTR(self) = result;
2024
+
2025
+ return self;
2026
+ fail:
2027
+ return Qnil;
2028
+ }
2029
+
2030
+
2031
+ SWIGINTERN VALUE _wrap_new_Map(int nargs, VALUE *args, VALUE self) {
2032
+ int argc;
2033
+ VALUE argv[2];
2034
+ int ii;
2035
+
2036
+ argc = nargs;
2037
+ if (argc > 2) SWIG_fail;
2038
+ for (ii = 0; (ii < argc); ii++) {
2039
+ argv[ii] = args[ii];
2040
+ }
2041
+ if (argc == 0) {
2042
+ return _wrap_new_Map__SWIG_2(nargs, args, self);
2043
+ }
2044
+ if (argc == 1) {
2045
+ int _v;
2046
+ {
2047
+ int res = SWIG_AsVal_int(argv[0], NULL);
2048
+ _v = SWIG_CheckState(res);
2049
+ }
2050
+ if (_v) {
2051
+ return _wrap_new_Map__SWIG_1(nargs, args, self);
2052
+ }
2053
+ }
2054
+ if (argc == 2) {
2055
+ int _v;
2056
+ {
2057
+ int res = SWIG_AsVal_int(argv[0], NULL);
2058
+ _v = SWIG_CheckState(res);
2059
+ }
2060
+ if (_v) {
2061
+ {
2062
+ int res = SWIG_AsVal_int(argv[1], NULL);
2063
+ _v = SWIG_CheckState(res);
2064
+ }
2065
+ if (_v) {
2066
+ return _wrap_new_Map__SWIG_0(nargs, args, self);
2067
+ }
2068
+ }
2069
+ }
2070
+
2071
+ fail:
2072
+ rb_raise(rb_eArgError, "No matching function for overloaded 'new_Map'");
2073
+ return Qnil;
2074
+ }
2075
+
2076
+
2077
+ SWIGINTERN void
2078
+ free_Map(Map *arg1) {
2079
+ delete arg1;
2080
+ }
2081
+
2082
+ SWIGINTERN VALUE
2083
+ _wrap_Map_getCost(int argc, VALUE *argv, VALUE self) {
2084
+ Map *arg1 = (Map *) 0 ;
2085
+ int arg2 ;
2086
+ int arg3 ;
2087
+ int result;
2088
+ void *argp1 = 0 ;
2089
+ int res1 = 0 ;
2090
+ int val2 ;
2091
+ int ecode2 = 0 ;
2092
+ int val3 ;
2093
+ int ecode3 = 0 ;
2094
+ VALUE vresult = Qnil;
2095
+
2096
+ if ((argc < 2) || (argc > 2)) {
2097
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2098
+ }
2099
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Map, 0 | 0 );
2100
+ if (!SWIG_IsOK(res1)) {
2101
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getCost" "', argument " "1"" of type '" "Map *""'");
2102
+ }
2103
+ arg1 = reinterpret_cast< Map * >(argp1);
2104
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2105
+ if (!SWIG_IsOK(ecode2)) {
2106
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "getCost" "', argument " "2"" of type '" "int""'");
2107
+ }
2108
+ arg2 = static_cast< int >(val2);
2109
+ ecode3 = SWIG_AsVal_int(argv[1], &val3);
2110
+ if (!SWIG_IsOK(ecode3)) {
2111
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "getCost" "', argument " "3"" of type '" "int""'");
2112
+ }
2113
+ arg3 = static_cast< int >(val3);
2114
+ result = (int)(arg1)->getCost(arg2,arg3);
2115
+ vresult = SWIG_From_int(static_cast< int >(result));
2116
+ return vresult;
2117
+ fail:
2118
+ return Qnil;
2119
+ }
2120
+
2121
+
2122
+ SWIGINTERN VALUE
2123
+ _wrap_Map_setCost(int argc, VALUE *argv, VALUE self) {
2124
+ Map *arg1 = (Map *) 0 ;
2125
+ int arg2 ;
2126
+ int arg3 ;
2127
+ int arg4 ;
2128
+ void *argp1 = 0 ;
2129
+ int res1 = 0 ;
2130
+ int val2 ;
2131
+ int ecode2 = 0 ;
2132
+ int val3 ;
2133
+ int ecode3 = 0 ;
2134
+ int val4 ;
2135
+ int ecode4 = 0 ;
2136
+
2137
+ if ((argc < 3) || (argc > 3)) {
2138
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
2139
+ }
2140
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Map, 0 | 0 );
2141
+ if (!SWIG_IsOK(res1)) {
2142
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setCost" "', argument " "1"" of type '" "Map *""'");
2143
+ }
2144
+ arg1 = reinterpret_cast< Map * >(argp1);
2145
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2146
+ if (!SWIG_IsOK(ecode2)) {
2147
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "setCost" "', argument " "2"" of type '" "int""'");
2148
+ }
2149
+ arg2 = static_cast< int >(val2);
2150
+ ecode3 = SWIG_AsVal_int(argv[1], &val3);
2151
+ if (!SWIG_IsOK(ecode3)) {
2152
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "setCost" "', argument " "3"" of type '" "int""'");
2153
+ }
2154
+ arg3 = static_cast< int >(val3);
2155
+ ecode4 = SWIG_AsVal_int(argv[2], &val4);
2156
+ if (!SWIG_IsOK(ecode4)) {
2157
+ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "setCost" "', argument " "4"" of type '" "int""'");
2158
+ }
2159
+ arg4 = static_cast< int >(val4);
2160
+ (arg1)->setCost(arg2,arg3,arg4);
2161
+ return Qnil;
2162
+ fail:
2163
+ return Qnil;
2164
+ }
2165
+
2166
+
2167
+ SWIGINTERN VALUE
2168
+ MAP_get(VALUE self) {
2169
+ VALUE _val;
2170
+
2171
+ _val = SWIG_NewPointerObj(SWIG_as_voidptr(MAP), SWIGTYPE_p_Map, 0 );
2172
+ return _val;
2173
+ }
2174
+
2175
+
2176
+ SWIGINTERN VALUE
2177
+ MAP_set(VALUE self, VALUE _val) {
2178
+ {
2179
+ void *argp = 0;
2180
+ int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_Map, 0 );
2181
+ if (!SWIG_IsOK(res)) {
2182
+ SWIG_exception_fail(SWIG_ArgError(res), "in variable '""MAP""' of type '""Map *""'");
2183
+ }
2184
+ MAP = reinterpret_cast< Map * >(argp);
2185
+ }
2186
+ return _val;
2187
+ fail:
2188
+ return Qnil;
2189
+ }
2190
+
2191
+
2192
+ SWIGINTERN VALUE
2193
+ NUMBER_OF_NEIGHBORS_get(VALUE self) {
2194
+ VALUE _val;
2195
+
2196
+ _val = SWIG_From_int(static_cast< int >(NUMBER_OF_NEIGHBORS));
2197
+ return _val;
2198
+ }
2199
+
2200
+
2201
+ SWIGINTERN VALUE
2202
+ NUMBER_OF_NEIGHBORS_set(VALUE self, VALUE _val) {
2203
+ {
2204
+ int val;
2205
+ int res = SWIG_AsVal_int(_val, &val);
2206
+ if (!SWIG_IsOK(res)) {
2207
+ SWIG_exception_fail(SWIG_ArgError(res), "in variable '""NUMBER_OF_NEIGHBORS""' of type '""int""'");
2208
+ }
2209
+ NUMBER_OF_NEIGHBORS = static_cast< int >(val);
2210
+ }
2211
+ return _val;
2212
+ fail:
2213
+ return Qnil;
2214
+ }
2215
+
2216
+
2217
+ swig_class cMapSearchNode;
2218
+
2219
+ SWIGINTERN VALUE
2220
+ _wrap_MapSearchNode_x_set(int argc, VALUE *argv, VALUE self) {
2221
+ MapSearchNode *arg1 = (MapSearchNode *) 0 ;
2222
+ unsigned int arg2 ;
2223
+ void *argp1 = 0 ;
2224
+ int res1 = 0 ;
2225
+ unsigned int val2 ;
2226
+ int ecode2 = 0 ;
2227
+
2228
+ if ((argc < 1) || (argc > 1)) {
2229
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2230
+ }
2231
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_MapSearchNode, 0 | 0 );
2232
+ if (!SWIG_IsOK(res1)) {
2233
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x" "', argument " "1"" of type '" "MapSearchNode *""'");
2234
+ }
2235
+ arg1 = reinterpret_cast< MapSearchNode * >(argp1);
2236
+ ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
2237
+ if (!SWIG_IsOK(ecode2)) {
2238
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x" "', argument " "2"" of type '" "unsigned int""'");
2239
+ }
2240
+ arg2 = static_cast< unsigned int >(val2);
2241
+ if (arg1) (arg1)->x = arg2;
2242
+
2243
+ return Qnil;
2244
+ fail:
2245
+ return Qnil;
2246
+ }
2247
+
2248
+
2249
+ SWIGINTERN VALUE
2250
+ _wrap_MapSearchNode_x_get(int argc, VALUE *argv, VALUE self) {
2251
+ MapSearchNode *arg1 = (MapSearchNode *) 0 ;
2252
+ unsigned int result;
2253
+ void *argp1 = 0 ;
2254
+ int res1 = 0 ;
2255
+ VALUE vresult = Qnil;
2256
+
2257
+ if ((argc < 0) || (argc > 0)) {
2258
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2259
+ }
2260
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_MapSearchNode, 0 | 0 );
2261
+ if (!SWIG_IsOK(res1)) {
2262
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x" "', argument " "1"" of type '" "MapSearchNode *""'");
2263
+ }
2264
+ arg1 = reinterpret_cast< MapSearchNode * >(argp1);
2265
+ result = (unsigned int) ((arg1)->x);
2266
+ vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
2267
+ return vresult;
2268
+ fail:
2269
+ return Qnil;
2270
+ }
2271
+
2272
+
2273
+ SWIGINTERN VALUE
2274
+ _wrap_MapSearchNode_y_set(int argc, VALUE *argv, VALUE self) {
2275
+ MapSearchNode *arg1 = (MapSearchNode *) 0 ;
2276
+ unsigned int arg2 ;
2277
+ void *argp1 = 0 ;
2278
+ int res1 = 0 ;
2279
+ unsigned int val2 ;
2280
+ int ecode2 = 0 ;
2281
+
2282
+ if ((argc < 1) || (argc > 1)) {
2283
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2284
+ }
2285
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_MapSearchNode, 0 | 0 );
2286
+ if (!SWIG_IsOK(res1)) {
2287
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "y" "', argument " "1"" of type '" "MapSearchNode *""'");
2288
+ }
2289
+ arg1 = reinterpret_cast< MapSearchNode * >(argp1);
2290
+ ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
2291
+ if (!SWIG_IsOK(ecode2)) {
2292
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "y" "', argument " "2"" of type '" "unsigned int""'");
2293
+ }
2294
+ arg2 = static_cast< unsigned int >(val2);
2295
+ if (arg1) (arg1)->y = arg2;
2296
+
2297
+ return Qnil;
2298
+ fail:
2299
+ return Qnil;
2300
+ }
2301
+
2302
+
2303
+ SWIGINTERN VALUE
2304
+ _wrap_MapSearchNode_y_get(int argc, VALUE *argv, VALUE self) {
2305
+ MapSearchNode *arg1 = (MapSearchNode *) 0 ;
2306
+ unsigned int result;
2307
+ void *argp1 = 0 ;
2308
+ int res1 = 0 ;
2309
+ VALUE vresult = Qnil;
2310
+
2311
+ if ((argc < 0) || (argc > 0)) {
2312
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2313
+ }
2314
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_MapSearchNode, 0 | 0 );
2315
+ if (!SWIG_IsOK(res1)) {
2316
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "y" "', argument " "1"" of type '" "MapSearchNode *""'");
2317
+ }
2318
+ arg1 = reinterpret_cast< MapSearchNode * >(argp1);
2319
+ result = (unsigned int) ((arg1)->y);
2320
+ vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
2321
+ return vresult;
2322
+ fail:
2323
+ return Qnil;
2324
+ }
2325
+
2326
+
2327
+ SWIGINTERN VALUE
2328
+ _wrap_new_MapSearchNode__SWIG_0(int argc, VALUE *argv, VALUE self) {
2329
+ MapSearchNode *result = 0 ;
2330
+
2331
+ if ((argc < 0) || (argc > 0)) {
2332
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2333
+ }
2334
+ result = (MapSearchNode *)new MapSearchNode();DATA_PTR(self) = result;
2335
+
2336
+ return self;
2337
+ fail:
2338
+ return Qnil;
2339
+ }
2340
+
2341
+
2342
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2343
+ SWIGINTERN VALUE
2344
+ _wrap_MapSearchNode_allocate(VALUE self) {
2345
+ #else
2346
+ SWIGINTERN VALUE
2347
+ _wrap_MapSearchNode_allocate(int argc, VALUE *argv, VALUE self) {
2348
+ #endif
2349
+
2350
+
2351
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_MapSearchNode);
2352
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2353
+ rb_obj_call_init(vresult, argc, argv);
2354
+ #endif
2355
+ return vresult;
2356
+ }
2357
+
2358
+
2359
+ SWIGINTERN VALUE
2360
+ _wrap_new_MapSearchNode__SWIG_1(int argc, VALUE *argv, VALUE self) {
2361
+ unsigned int arg1 ;
2362
+ unsigned int arg2 ;
2363
+ MapSearchNode *result = 0 ;
2364
+ unsigned int val1 ;
2365
+ int ecode1 = 0 ;
2366
+ unsigned int val2 ;
2367
+ int ecode2 = 0 ;
2368
+
2369
+ if ((argc < 2) || (argc > 2)) {
2370
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2371
+ }
2372
+ ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
2373
+ if (!SWIG_IsOK(ecode1)) {
2374
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MapSearchNode" "', argument " "1"" of type '" "unsigned int""'");
2375
+ }
2376
+ arg1 = static_cast< unsigned int >(val1);
2377
+ ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2);
2378
+ if (!SWIG_IsOK(ecode2)) {
2379
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MapSearchNode" "', argument " "2"" of type '" "unsigned int""'");
2380
+ }
2381
+ arg2 = static_cast< unsigned int >(val2);
2382
+ result = (MapSearchNode *)new MapSearchNode(arg1,arg2);DATA_PTR(self) = result;
2383
+
2384
+ return self;
2385
+ fail:
2386
+ return Qnil;
2387
+ }
2388
+
2389
+
2390
+ SWIGINTERN VALUE _wrap_new_MapSearchNode(int nargs, VALUE *args, VALUE self) {
2391
+ int argc;
2392
+ VALUE argv[2];
2393
+ int ii;
2394
+
2395
+ argc = nargs;
2396
+ if (argc > 2) SWIG_fail;
2397
+ for (ii = 0; (ii < argc); ii++) {
2398
+ argv[ii] = args[ii];
2399
+ }
2400
+ if (argc == 0) {
2401
+ return _wrap_new_MapSearchNode__SWIG_0(nargs, args, self);
2402
+ }
2403
+ if (argc == 2) {
2404
+ int _v;
2405
+ {
2406
+ int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
2407
+ _v = SWIG_CheckState(res);
2408
+ }
2409
+ if (_v) {
2410
+ {
2411
+ int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
2412
+ _v = SWIG_CheckState(res);
2413
+ }
2414
+ if (_v) {
2415
+ return _wrap_new_MapSearchNode__SWIG_1(nargs, args, self);
2416
+ }
2417
+ }
2418
+ }
2419
+
2420
+ fail:
2421
+ rb_raise(rb_eArgError, "No matching function for overloaded 'new_MapSearchNode'");
2422
+ return Qnil;
2423
+ }
2424
+
2425
+
2426
+ SWIGINTERN VALUE
2427
+ _wrap_MapSearchNode_GoalDistanceEstimate(int argc, VALUE *argv, VALUE self) {
2428
+ MapSearchNode *arg1 = (MapSearchNode *) 0 ;
2429
+ MapSearchNode *arg2 = 0 ;
2430
+ float result;
2431
+ void *argp1 = 0 ;
2432
+ int res1 = 0 ;
2433
+ void *argp2 = 0 ;
2434
+ int res2 = 0 ;
2435
+ VALUE vresult = Qnil;
2436
+
2437
+ if ((argc < 1) || (argc > 1)) {
2438
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2439
+ }
2440
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_MapSearchNode, 0 | 0 );
2441
+ if (!SWIG_IsOK(res1)) {
2442
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GoalDistanceEstimate" "', argument " "1"" of type '" "MapSearchNode *""'");
2443
+ }
2444
+ arg1 = reinterpret_cast< MapSearchNode * >(argp1);
2445
+ res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_MapSearchNode, 0 );
2446
+ if (!SWIG_IsOK(res2)) {
2447
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GoalDistanceEstimate" "', argument " "2"" of type '" "MapSearchNode &""'");
2448
+ }
2449
+ if (!argp2) {
2450
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "GoalDistanceEstimate" "', argument " "2"" of type '" "MapSearchNode &""'");
2451
+ }
2452
+ arg2 = reinterpret_cast< MapSearchNode * >(argp2);
2453
+ result = (float)(arg1)->GoalDistanceEstimate(*arg2);
2454
+ vresult = SWIG_From_float(static_cast< float >(result));
2455
+ return vresult;
2456
+ fail:
2457
+ return Qnil;
2458
+ }
2459
+
2460
+
2461
+ SWIGINTERN VALUE
2462
+ _wrap_MapSearchNode_IsGoal(int argc, VALUE *argv, VALUE self) {
2463
+ MapSearchNode *arg1 = (MapSearchNode *) 0 ;
2464
+ MapSearchNode *arg2 = 0 ;
2465
+ bool result;
2466
+ void *argp1 = 0 ;
2467
+ int res1 = 0 ;
2468
+ void *argp2 = 0 ;
2469
+ int res2 = 0 ;
2470
+ VALUE vresult = Qnil;
2471
+
2472
+ if ((argc < 1) || (argc > 1)) {
2473
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2474
+ }
2475
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_MapSearchNode, 0 | 0 );
2476
+ if (!SWIG_IsOK(res1)) {
2477
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IsGoal" "', argument " "1"" of type '" "MapSearchNode *""'");
2478
+ }
2479
+ arg1 = reinterpret_cast< MapSearchNode * >(argp1);
2480
+ res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_MapSearchNode, 0 );
2481
+ if (!SWIG_IsOK(res2)) {
2482
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IsGoal" "', argument " "2"" of type '" "MapSearchNode &""'");
2483
+ }
2484
+ if (!argp2) {
2485
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IsGoal" "', argument " "2"" of type '" "MapSearchNode &""'");
2486
+ }
2487
+ arg2 = reinterpret_cast< MapSearchNode * >(argp2);
2488
+ result = (bool)(arg1)->IsGoal(*arg2);
2489
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2490
+ return vresult;
2491
+ fail:
2492
+ return Qnil;
2493
+ }
2494
+
2495
+
2496
+ SWIGINTERN VALUE
2497
+ _wrap_MapSearchNode_GetSuccessors(int argc, VALUE *argv, VALUE self) {
2498
+ MapSearchNode *arg1 = (MapSearchNode *) 0 ;
2499
+ AStarSearch<MapSearchNode > *arg2 = (AStarSearch<MapSearchNode > *) 0 ;
2500
+ MapSearchNode *arg3 = (MapSearchNode *) 0 ;
2501
+ bool result;
2502
+ void *argp1 = 0 ;
2503
+ int res1 = 0 ;
2504
+ void *argp2 = 0 ;
2505
+ int res2 = 0 ;
2506
+ void *argp3 = 0 ;
2507
+ int res3 = 0 ;
2508
+ VALUE vresult = Qnil;
2509
+
2510
+ if ((argc < 2) || (argc > 2)) {
2511
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2512
+ }
2513
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_MapSearchNode, 0 | 0 );
2514
+ if (!SWIG_IsOK(res1)) {
2515
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetSuccessors" "', argument " "1"" of type '" "MapSearchNode *""'");
2516
+ }
2517
+ arg1 = reinterpret_cast< MapSearchNode * >(argp1);
2518
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_AStarSearchTMapSearchNode_t, 0 | 0 );
2519
+ if (!SWIG_IsOK(res2)) {
2520
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GetSuccessors" "', argument " "2"" of type '" "AStarSearch<MapSearchNode > *""'");
2521
+ }
2522
+ arg2 = reinterpret_cast< AStarSearch<MapSearchNode > * >(argp2);
2523
+ res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_MapSearchNode, 0 | 0 );
2524
+ if (!SWIG_IsOK(res3)) {
2525
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "GetSuccessors" "', argument " "3"" of type '" "MapSearchNode *""'");
2526
+ }
2527
+ arg3 = reinterpret_cast< MapSearchNode * >(argp3);
2528
+ result = (bool)(arg1)->GetSuccessors(arg2,arg3);
2529
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2530
+ return vresult;
2531
+ fail:
2532
+ return Qnil;
2533
+ }
2534
+
2535
+
2536
+ SWIGINTERN VALUE
2537
+ _wrap_MapSearchNode_GetCost(int argc, VALUE *argv, VALUE self) {
2538
+ MapSearchNode *arg1 = (MapSearchNode *) 0 ;
2539
+ MapSearchNode *arg2 = 0 ;
2540
+ float result;
2541
+ void *argp1 = 0 ;
2542
+ int res1 = 0 ;
2543
+ void *argp2 = 0 ;
2544
+ int res2 = 0 ;
2545
+ VALUE vresult = Qnil;
2546
+
2547
+ if ((argc < 1) || (argc > 1)) {
2548
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2549
+ }
2550
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_MapSearchNode, 0 | 0 );
2551
+ if (!SWIG_IsOK(res1)) {
2552
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetCost" "', argument " "1"" of type '" "MapSearchNode *""'");
2553
+ }
2554
+ arg1 = reinterpret_cast< MapSearchNode * >(argp1);
2555
+ res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_MapSearchNode, 0 );
2556
+ if (!SWIG_IsOK(res2)) {
2557
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GetCost" "', argument " "2"" of type '" "MapSearchNode &""'");
2558
+ }
2559
+ if (!argp2) {
2560
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "GetCost" "', argument " "2"" of type '" "MapSearchNode &""'");
2561
+ }
2562
+ arg2 = reinterpret_cast< MapSearchNode * >(argp2);
2563
+ result = (float)(arg1)->GetCost(*arg2);
2564
+ vresult = SWIG_From_float(static_cast< float >(result));
2565
+ return vresult;
2566
+ fail:
2567
+ return Qnil;
2568
+ }
2569
+
2570
+
2571
+ SWIGINTERN VALUE
2572
+ _wrap_MapSearchNode_IsSameState(int argc, VALUE *argv, VALUE self) {
2573
+ MapSearchNode *arg1 = (MapSearchNode *) 0 ;
2574
+ MapSearchNode *arg2 = 0 ;
2575
+ bool result;
2576
+ void *argp1 = 0 ;
2577
+ int res1 = 0 ;
2578
+ void *argp2 = 0 ;
2579
+ int res2 = 0 ;
2580
+ VALUE vresult = Qnil;
2581
+
2582
+ if ((argc < 1) || (argc > 1)) {
2583
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2584
+ }
2585
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_MapSearchNode, 0 | 0 );
2586
+ if (!SWIG_IsOK(res1)) {
2587
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IsSameState" "', argument " "1"" of type '" "MapSearchNode *""'");
2588
+ }
2589
+ arg1 = reinterpret_cast< MapSearchNode * >(argp1);
2590
+ res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_MapSearchNode, 0 );
2591
+ if (!SWIG_IsOK(res2)) {
2592
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IsSameState" "', argument " "2"" of type '" "MapSearchNode &""'");
2593
+ }
2594
+ if (!argp2) {
2595
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IsSameState" "', argument " "2"" of type '" "MapSearchNode &""'");
2596
+ }
2597
+ arg2 = reinterpret_cast< MapSearchNode * >(argp2);
2598
+ result = (bool)(arg1)->IsSameState(*arg2);
2599
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2600
+ return vresult;
2601
+ fail:
2602
+ return Qnil;
2603
+ }
2604
+
2605
+
2606
+ SWIGINTERN VALUE
2607
+ _wrap_MapSearchNode_PrintNodeInfo(int argc, VALUE *argv, VALUE self) {
2608
+ MapSearchNode *arg1 = (MapSearchNode *) 0 ;
2609
+ void *argp1 = 0 ;
2610
+ int res1 = 0 ;
2611
+
2612
+ if ((argc < 0) || (argc > 0)) {
2613
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2614
+ }
2615
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_MapSearchNode, 0 | 0 );
2616
+ if (!SWIG_IsOK(res1)) {
2617
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PrintNodeInfo" "', argument " "1"" of type '" "MapSearchNode *""'");
2618
+ }
2619
+ arg1 = reinterpret_cast< MapSearchNode * >(argp1);
2620
+ (arg1)->PrintNodeInfo();
2621
+ return Qnil;
2622
+ fail:
2623
+ return Qnil;
2624
+ }
2625
+
2626
+
2627
+ SWIGINTERN void
2628
+ free_MapSearchNode(MapSearchNode *arg1) {
2629
+ delete arg1;
2630
+ }
2631
+
2632
+ swig_class cHeyesDriver;
2633
+
2634
+ SWIGINTERN VALUE
2635
+ _wrap_HeyesDriver_nodeStart_set(int argc, VALUE *argv, VALUE self) {
2636
+ HeyesDriver *arg1 = (HeyesDriver *) 0 ;
2637
+ MapSearchNode *arg2 = (MapSearchNode *) 0 ;
2638
+ void *argp1 = 0 ;
2639
+ int res1 = 0 ;
2640
+ void *argp2 = 0 ;
2641
+ int res2 = 0 ;
2642
+
2643
+ if ((argc < 1) || (argc > 1)) {
2644
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2645
+ }
2646
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_HeyesDriver, 0 | 0 );
2647
+ if (!SWIG_IsOK(res1)) {
2648
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nodeStart" "', argument " "1"" of type '" "HeyesDriver *""'");
2649
+ }
2650
+ arg1 = reinterpret_cast< HeyesDriver * >(argp1);
2651
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_MapSearchNode, 0 | 0 );
2652
+ if (!SWIG_IsOK(res2)) {
2653
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "nodeStart" "', argument " "2"" of type '" "MapSearchNode *""'");
2654
+ }
2655
+ arg2 = reinterpret_cast< MapSearchNode * >(argp2);
2656
+ if (arg1) (arg1)->nodeStart = *arg2;
2657
+
2658
+ return Qnil;
2659
+ fail:
2660
+ return Qnil;
2661
+ }
2662
+
2663
+
2664
+ SWIGINTERN VALUE
2665
+ _wrap_HeyesDriver_nodeStart_get(int argc, VALUE *argv, VALUE self) {
2666
+ HeyesDriver *arg1 = (HeyesDriver *) 0 ;
2667
+ MapSearchNode *result = 0 ;
2668
+ void *argp1 = 0 ;
2669
+ int res1 = 0 ;
2670
+ VALUE vresult = Qnil;
2671
+
2672
+ if ((argc < 0) || (argc > 0)) {
2673
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2674
+ }
2675
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_HeyesDriver, 0 | 0 );
2676
+ if (!SWIG_IsOK(res1)) {
2677
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nodeStart" "', argument " "1"" of type '" "HeyesDriver *""'");
2678
+ }
2679
+ arg1 = reinterpret_cast< HeyesDriver * >(argp1);
2680
+ result = (MapSearchNode *)& ((arg1)->nodeStart);
2681
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MapSearchNode, 0 | 0 );
2682
+ return vresult;
2683
+ fail:
2684
+ return Qnil;
2685
+ }
2686
+
2687
+
2688
+ SWIGINTERN VALUE
2689
+ _wrap_HeyesDriver_nodeEnd_set(int argc, VALUE *argv, VALUE self) {
2690
+ HeyesDriver *arg1 = (HeyesDriver *) 0 ;
2691
+ MapSearchNode *arg2 = (MapSearchNode *) 0 ;
2692
+ void *argp1 = 0 ;
2693
+ int res1 = 0 ;
2694
+ void *argp2 = 0 ;
2695
+ int res2 = 0 ;
2696
+
2697
+ if ((argc < 1) || (argc > 1)) {
2698
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2699
+ }
2700
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_HeyesDriver, 0 | 0 );
2701
+ if (!SWIG_IsOK(res1)) {
2702
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nodeEnd" "', argument " "1"" of type '" "HeyesDriver *""'");
2703
+ }
2704
+ arg1 = reinterpret_cast< HeyesDriver * >(argp1);
2705
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_MapSearchNode, 0 | 0 );
2706
+ if (!SWIG_IsOK(res2)) {
2707
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "nodeEnd" "', argument " "2"" of type '" "MapSearchNode *""'");
2708
+ }
2709
+ arg2 = reinterpret_cast< MapSearchNode * >(argp2);
2710
+ if (arg1) (arg1)->nodeEnd = *arg2;
2711
+
2712
+ return Qnil;
2713
+ fail:
2714
+ return Qnil;
2715
+ }
2716
+
2717
+
2718
+ SWIGINTERN VALUE
2719
+ _wrap_HeyesDriver_nodeEnd_get(int argc, VALUE *argv, VALUE self) {
2720
+ HeyesDriver *arg1 = (HeyesDriver *) 0 ;
2721
+ MapSearchNode *result = 0 ;
2722
+ void *argp1 = 0 ;
2723
+ int res1 = 0 ;
2724
+ VALUE vresult = Qnil;
2725
+
2726
+ if ((argc < 0) || (argc > 0)) {
2727
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2728
+ }
2729
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_HeyesDriver, 0 | 0 );
2730
+ if (!SWIG_IsOK(res1)) {
2731
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "nodeEnd" "', argument " "1"" of type '" "HeyesDriver *""'");
2732
+ }
2733
+ arg1 = reinterpret_cast< HeyesDriver * >(argp1);
2734
+ result = (MapSearchNode *)& ((arg1)->nodeEnd);
2735
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MapSearchNode, 0 | 0 );
2736
+ return vresult;
2737
+ fail:
2738
+ return Qnil;
2739
+ }
2740
+
2741
+
2742
+ SWIGINTERN VALUE
2743
+ _wrap_HeyesDriver_timeElapsed_set(int argc, VALUE *argv, VALUE self) {
2744
+ HeyesDriver *arg1 = (HeyesDriver *) 0 ;
2745
+ double arg2 ;
2746
+ void *argp1 = 0 ;
2747
+ int res1 = 0 ;
2748
+ double val2 ;
2749
+ int ecode2 = 0 ;
2750
+
2751
+ if ((argc < 1) || (argc > 1)) {
2752
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2753
+ }
2754
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_HeyesDriver, 0 | 0 );
2755
+ if (!SWIG_IsOK(res1)) {
2756
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "timeElapsed" "', argument " "1"" of type '" "HeyesDriver *""'");
2757
+ }
2758
+ arg1 = reinterpret_cast< HeyesDriver * >(argp1);
2759
+ ecode2 = SWIG_AsVal_double(argv[0], &val2);
2760
+ if (!SWIG_IsOK(ecode2)) {
2761
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "timeElapsed" "', argument " "2"" of type '" "double""'");
2762
+ }
2763
+ arg2 = static_cast< double >(val2);
2764
+ if (arg1) (arg1)->timeElapsed = arg2;
2765
+
2766
+ return Qnil;
2767
+ fail:
2768
+ return Qnil;
2769
+ }
2770
+
2771
+
2772
+ SWIGINTERN VALUE
2773
+ _wrap_HeyesDriver_timeElapsed_get(int argc, VALUE *argv, VALUE self) {
2774
+ HeyesDriver *arg1 = (HeyesDriver *) 0 ;
2775
+ double result;
2776
+ void *argp1 = 0 ;
2777
+ int res1 = 0 ;
2778
+ VALUE vresult = Qnil;
2779
+
2780
+ if ((argc < 0) || (argc > 0)) {
2781
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2782
+ }
2783
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_HeyesDriver, 0 | 0 );
2784
+ if (!SWIG_IsOK(res1)) {
2785
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "timeElapsed" "', argument " "1"" of type '" "HeyesDriver *""'");
2786
+ }
2787
+ arg1 = reinterpret_cast< HeyesDriver * >(argp1);
2788
+ result = (double) ((arg1)->timeElapsed);
2789
+ vresult = SWIG_From_double(static_cast< double >(result));
2790
+ return vresult;
2791
+ fail:
2792
+ return Qnil;
2793
+ }
2794
+
2795
+
2796
+ SWIGINTERN VALUE
2797
+ _wrap_new_HeyesDriver__SWIG_0(int argc, VALUE *argv, VALUE self) {
2798
+ Map *arg1 = (Map *) 0 ;
2799
+ int arg2 ;
2800
+ HeyesDriver *result = 0 ;
2801
+ void *argp1 = 0 ;
2802
+ int res1 = 0 ;
2803
+ int val2 ;
2804
+ int ecode2 = 0 ;
2805
+
2806
+ if ((argc < 2) || (argc > 2)) {
2807
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2808
+ }
2809
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Map, 0 | 0 );
2810
+ if (!SWIG_IsOK(res1)) {
2811
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeyesDriver" "', argument " "1"" of type '" "Map *""'");
2812
+ }
2813
+ arg1 = reinterpret_cast< Map * >(argp1);
2814
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
2815
+ if (!SWIG_IsOK(ecode2)) {
2816
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HeyesDriver" "', argument " "2"" of type '" "int""'");
2817
+ }
2818
+ arg2 = static_cast< int >(val2);
2819
+ result = (HeyesDriver *)new HeyesDriver(arg1,arg2);DATA_PTR(self) = result;
2820
+
2821
+ return self;
2822
+ fail:
2823
+ return Qnil;
2824
+ }
2825
+
2826
+
2827
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2828
+ SWIGINTERN VALUE
2829
+ _wrap_HeyesDriver_allocate(VALUE self) {
2830
+ #else
2831
+ SWIGINTERN VALUE
2832
+ _wrap_HeyesDriver_allocate(int argc, VALUE *argv, VALUE self) {
2833
+ #endif
2834
+
2835
+
2836
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_HeyesDriver);
2837
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2838
+ rb_obj_call_init(vresult, argc, argv);
2839
+ #endif
2840
+ return vresult;
2841
+ }
2842
+
2843
+
2844
+ SWIGINTERN VALUE
2845
+ _wrap_new_HeyesDriver__SWIG_1(int argc, VALUE *argv, VALUE self) {
2846
+ Map *arg1 = (Map *) 0 ;
2847
+ HeyesDriver *result = 0 ;
2848
+ void *argp1 = 0 ;
2849
+ int res1 = 0 ;
2850
+
2851
+ if ((argc < 1) || (argc > 1)) {
2852
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2853
+ }
2854
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Map, 0 | 0 );
2855
+ if (!SWIG_IsOK(res1)) {
2856
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeyesDriver" "', argument " "1"" of type '" "Map *""'");
2857
+ }
2858
+ arg1 = reinterpret_cast< Map * >(argp1);
2859
+ result = (HeyesDriver *)new HeyesDriver(arg1);DATA_PTR(self) = result;
2860
+
2861
+ return self;
2862
+ fail:
2863
+ return Qnil;
2864
+ }
2865
+
2866
+
2867
+ SWIGINTERN VALUE _wrap_new_HeyesDriver(int nargs, VALUE *args, VALUE self) {
2868
+ int argc;
2869
+ VALUE argv[2];
2870
+ int ii;
2871
+
2872
+ argc = nargs;
2873
+ if (argc > 2) SWIG_fail;
2874
+ for (ii = 0; (ii < argc); ii++) {
2875
+ argv[ii] = args[ii];
2876
+ }
2877
+ if (argc == 1) {
2878
+ int _v;
2879
+ void *vptr = 0;
2880
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Map, 0);
2881
+ _v = SWIG_CheckState(res);
2882
+ if (_v) {
2883
+ return _wrap_new_HeyesDriver__SWIG_1(nargs, args, self);
2884
+ }
2885
+ }
2886
+ if (argc == 2) {
2887
+ int _v;
2888
+ void *vptr = 0;
2889
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Map, 0);
2890
+ _v = SWIG_CheckState(res);
2891
+ if (_v) {
2892
+ {
2893
+ int res = SWIG_AsVal_int(argv[1], NULL);
2894
+ _v = SWIG_CheckState(res);
2895
+ }
2896
+ if (_v) {
2897
+ return _wrap_new_HeyesDriver__SWIG_0(nargs, args, self);
2898
+ }
2899
+ }
2900
+ }
2901
+
2902
+ fail:
2903
+ rb_raise(rb_eArgError, "No matching function for overloaded 'new_HeyesDriver'");
2904
+ return Qnil;
2905
+ }
2906
+
2907
+
2908
+ SWIGINTERN VALUE
2909
+ _wrap_HeyesDriver_run__SWIG_0(int argc, VALUE *argv, VALUE self) {
2910
+ HeyesDriver *arg1 = (HeyesDriver *) 0 ;
2911
+ int arg2 ;
2912
+ int arg3 ;
2913
+ int arg4 ;
2914
+ int arg5 ;
2915
+ int arg6 ;
2916
+ int result;
2917
+ void *argp1 = 0 ;
2918
+ int res1 = 0 ;
2919
+ int val2 ;
2920
+ int ecode2 = 0 ;
2921
+ int val3 ;
2922
+ int ecode3 = 0 ;
2923
+ int val4 ;
2924
+ int ecode4 = 0 ;
2925
+ int val5 ;
2926
+ int ecode5 = 0 ;
2927
+ int val6 ;
2928
+ int ecode6 = 0 ;
2929
+ VALUE vresult = Qnil;
2930
+
2931
+ if ((argc < 5) || (argc > 5)) {
2932
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
2933
+ }
2934
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_HeyesDriver, 0 | 0 );
2935
+ if (!SWIG_IsOK(res1)) {
2936
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "run" "', argument " "1"" of type '" "HeyesDriver *""'");
2937
+ }
2938
+ arg1 = reinterpret_cast< HeyesDriver * >(argp1);
2939
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2940
+ if (!SWIG_IsOK(ecode2)) {
2941
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "run" "', argument " "2"" of type '" "int""'");
2942
+ }
2943
+ arg2 = static_cast< int >(val2);
2944
+ ecode3 = SWIG_AsVal_int(argv[1], &val3);
2945
+ if (!SWIG_IsOK(ecode3)) {
2946
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "run" "', argument " "3"" of type '" "int""'");
2947
+ }
2948
+ arg3 = static_cast< int >(val3);
2949
+ ecode4 = SWIG_AsVal_int(argv[2], &val4);
2950
+ if (!SWIG_IsOK(ecode4)) {
2951
+ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "run" "', argument " "4"" of type '" "int""'");
2952
+ }
2953
+ arg4 = static_cast< int >(val4);
2954
+ ecode5 = SWIG_AsVal_int(argv[3], &val5);
2955
+ if (!SWIG_IsOK(ecode5)) {
2956
+ SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "run" "', argument " "5"" of type '" "int""'");
2957
+ }
2958
+ arg5 = static_cast< int >(val5);
2959
+ ecode6 = SWIG_AsVal_int(argv[4], &val6);
2960
+ if (!SWIG_IsOK(ecode6)) {
2961
+ SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "run" "', argument " "6"" of type '" "int""'");
2962
+ }
2963
+ arg6 = static_cast< int >(val6);
2964
+ result = (int)(arg1)->run(arg2,arg3,arg4,arg5,arg6);
2965
+ vresult = SWIG_From_int(static_cast< int >(result));
2966
+ return vresult;
2967
+ fail:
2968
+ return Qnil;
2969
+ }
2970
+
2971
+
2972
+ SWIGINTERN VALUE
2973
+ _wrap_HeyesDriver_run__SWIG_1(int argc, VALUE *argv, VALUE self) {
2974
+ HeyesDriver *arg1 = (HeyesDriver *) 0 ;
2975
+ int arg2 ;
2976
+ int arg3 ;
2977
+ int arg4 ;
2978
+ int arg5 ;
2979
+ int result;
2980
+ void *argp1 = 0 ;
2981
+ int res1 = 0 ;
2982
+ int val2 ;
2983
+ int ecode2 = 0 ;
2984
+ int val3 ;
2985
+ int ecode3 = 0 ;
2986
+ int val4 ;
2987
+ int ecode4 = 0 ;
2988
+ int val5 ;
2989
+ int ecode5 = 0 ;
2990
+ VALUE vresult = Qnil;
2991
+
2992
+ if ((argc < 4) || (argc > 4)) {
2993
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
2994
+ }
2995
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_HeyesDriver, 0 | 0 );
2996
+ if (!SWIG_IsOK(res1)) {
2997
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "run" "', argument " "1"" of type '" "HeyesDriver *""'");
2998
+ }
2999
+ arg1 = reinterpret_cast< HeyesDriver * >(argp1);
3000
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
3001
+ if (!SWIG_IsOK(ecode2)) {
3002
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "run" "', argument " "2"" of type '" "int""'");
3003
+ }
3004
+ arg2 = static_cast< int >(val2);
3005
+ ecode3 = SWIG_AsVal_int(argv[1], &val3);
3006
+ if (!SWIG_IsOK(ecode3)) {
3007
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "run" "', argument " "3"" of type '" "int""'");
3008
+ }
3009
+ arg3 = static_cast< int >(val3);
3010
+ ecode4 = SWIG_AsVal_int(argv[2], &val4);
3011
+ if (!SWIG_IsOK(ecode4)) {
3012
+ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "run" "', argument " "4"" of type '" "int""'");
3013
+ }
3014
+ arg4 = static_cast< int >(val4);
3015
+ ecode5 = SWIG_AsVal_int(argv[3], &val5);
3016
+ if (!SWIG_IsOK(ecode5)) {
3017
+ SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "run" "', argument " "5"" of type '" "int""'");
3018
+ }
3019
+ arg5 = static_cast< int >(val5);
3020
+ result = (int)(arg1)->run(arg2,arg3,arg4,arg5);
3021
+ vresult = SWIG_From_int(static_cast< int >(result));
3022
+ return vresult;
3023
+ fail:
3024
+ return Qnil;
3025
+ }
3026
+
3027
+
3028
+ SWIGINTERN VALUE _wrap_HeyesDriver_run(int nargs, VALUE *args, VALUE self) {
3029
+ int argc;
3030
+ VALUE argv[7];
3031
+ int ii;
3032
+
3033
+ argc = nargs + 1;
3034
+ argv[0] = self;
3035
+ if (argc > 7) SWIG_fail;
3036
+ for (ii = 1; (ii < argc); ii++) {
3037
+ argv[ii] = args[ii-1];
3038
+ }
3039
+ if (argc == 5) {
3040
+ int _v;
3041
+ void *vptr = 0;
3042
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_HeyesDriver, 0);
3043
+ _v = SWIG_CheckState(res);
3044
+ if (_v) {
3045
+ {
3046
+ int res = SWIG_AsVal_int(argv[1], NULL);
3047
+ _v = SWIG_CheckState(res);
3048
+ }
3049
+ if (_v) {
3050
+ {
3051
+ int res = SWIG_AsVal_int(argv[2], NULL);
3052
+ _v = SWIG_CheckState(res);
3053
+ }
3054
+ if (_v) {
3055
+ {
3056
+ int res = SWIG_AsVal_int(argv[3], NULL);
3057
+ _v = SWIG_CheckState(res);
3058
+ }
3059
+ if (_v) {
3060
+ {
3061
+ int res = SWIG_AsVal_int(argv[4], NULL);
3062
+ _v = SWIG_CheckState(res);
3063
+ }
3064
+ if (_v) {
3065
+ return _wrap_HeyesDriver_run__SWIG_1(nargs, args, self);
3066
+ }
3067
+ }
3068
+ }
3069
+ }
3070
+ }
3071
+ }
3072
+ if (argc == 6) {
3073
+ int _v;
3074
+ void *vptr = 0;
3075
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_HeyesDriver, 0);
3076
+ _v = SWIG_CheckState(res);
3077
+ if (_v) {
3078
+ {
3079
+ int res = SWIG_AsVal_int(argv[1], NULL);
3080
+ _v = SWIG_CheckState(res);
3081
+ }
3082
+ if (_v) {
3083
+ {
3084
+ int res = SWIG_AsVal_int(argv[2], NULL);
3085
+ _v = SWIG_CheckState(res);
3086
+ }
3087
+ if (_v) {
3088
+ {
3089
+ int res = SWIG_AsVal_int(argv[3], NULL);
3090
+ _v = SWIG_CheckState(res);
3091
+ }
3092
+ if (_v) {
3093
+ {
3094
+ int res = SWIG_AsVal_int(argv[4], NULL);
3095
+ _v = SWIG_CheckState(res);
3096
+ }
3097
+ if (_v) {
3098
+ {
3099
+ int res = SWIG_AsVal_int(argv[5], NULL);
3100
+ _v = SWIG_CheckState(res);
3101
+ }
3102
+ if (_v) {
3103
+ return _wrap_HeyesDriver_run__SWIG_0(nargs, args, self);
3104
+ }
3105
+ }
3106
+ }
3107
+ }
3108
+ }
3109
+ }
3110
+ }
3111
+
3112
+ fail:
3113
+ rb_raise(rb_eArgError, "No matching function for overloaded 'HeyesDriver_run'");
3114
+ return Qnil;
3115
+ }
3116
+
3117
+
3118
+ SWIGINTERN VALUE
3119
+ _wrap_HeyesDriver_getMap(int argc, VALUE *argv, VALUE self) {
3120
+ HeyesDriver *arg1 = (HeyesDriver *) 0 ;
3121
+ Map *result = 0 ;
3122
+ void *argp1 = 0 ;
3123
+ int res1 = 0 ;
3124
+ VALUE vresult = Qnil;
3125
+
3126
+ if ((argc < 0) || (argc > 0)) {
3127
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3128
+ }
3129
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_HeyesDriver, 0 | 0 );
3130
+ if (!SWIG_IsOK(res1)) {
3131
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getMap" "', argument " "1"" of type '" "HeyesDriver *""'");
3132
+ }
3133
+ arg1 = reinterpret_cast< HeyesDriver * >(argp1);
3134
+ result = (Map *)(arg1)->getMap();
3135
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Map, 0 | 0 );
3136
+ return vresult;
3137
+ fail:
3138
+ return Qnil;
3139
+ }
3140
+
3141
+
3142
+ SWIGINTERN VALUE
3143
+ _wrap_HeyesDriver_getPathLength(int argc, VALUE *argv, VALUE self) {
3144
+ HeyesDriver *arg1 = (HeyesDriver *) 0 ;
3145
+ int result;
3146
+ void *argp1 = 0 ;
3147
+ int res1 = 0 ;
3148
+ VALUE vresult = Qnil;
3149
+
3150
+ if ((argc < 0) || (argc > 0)) {
3151
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3152
+ }
3153
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_HeyesDriver, 0 | 0 );
3154
+ if (!SWIG_IsOK(res1)) {
3155
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getPathLength" "', argument " "1"" of type '" "HeyesDriver *""'");
3156
+ }
3157
+ arg1 = reinterpret_cast< HeyesDriver * >(argp1);
3158
+ result = (int)(arg1)->getPathLength();
3159
+ vresult = SWIG_From_int(static_cast< int >(result));
3160
+ return vresult;
3161
+ fail:
3162
+ return Qnil;
3163
+ }
3164
+
3165
+
3166
+ SWIGINTERN VALUE
3167
+ _wrap_HeyesDriver_getPathYAtIndex(int argc, VALUE *argv, VALUE self) {
3168
+ HeyesDriver *arg1 = (HeyesDriver *) 0 ;
3169
+ int arg2 ;
3170
+ int result;
3171
+ void *argp1 = 0 ;
3172
+ int res1 = 0 ;
3173
+ int val2 ;
3174
+ int ecode2 = 0 ;
3175
+ VALUE vresult = Qnil;
3176
+
3177
+ if ((argc < 1) || (argc > 1)) {
3178
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3179
+ }
3180
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_HeyesDriver, 0 | 0 );
3181
+ if (!SWIG_IsOK(res1)) {
3182
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getPathYAtIndex" "', argument " "1"" of type '" "HeyesDriver *""'");
3183
+ }
3184
+ arg1 = reinterpret_cast< HeyesDriver * >(argp1);
3185
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
3186
+ if (!SWIG_IsOK(ecode2)) {
3187
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "getPathYAtIndex" "', argument " "2"" of type '" "int""'");
3188
+ }
3189
+ arg2 = static_cast< int >(val2);
3190
+ result = (int)(arg1)->getPathYAtIndex(arg2);
3191
+ vresult = SWIG_From_int(static_cast< int >(result));
3192
+ return vresult;
3193
+ fail:
3194
+ return Qnil;
3195
+ }
3196
+
3197
+
3198
+ SWIGINTERN VALUE
3199
+ _wrap_HeyesDriver_getPathXAtIndex(int argc, VALUE *argv, VALUE self) {
3200
+ HeyesDriver *arg1 = (HeyesDriver *) 0 ;
3201
+ int arg2 ;
3202
+ int result;
3203
+ void *argp1 = 0 ;
3204
+ int res1 = 0 ;
3205
+ int val2 ;
3206
+ int ecode2 = 0 ;
3207
+ VALUE vresult = Qnil;
3208
+
3209
+ if ((argc < 1) || (argc > 1)) {
3210
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3211
+ }
3212
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_HeyesDriver, 0 | 0 );
3213
+ if (!SWIG_IsOK(res1)) {
3214
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getPathXAtIndex" "', argument " "1"" of type '" "HeyesDriver *""'");
3215
+ }
3216
+ arg1 = reinterpret_cast< HeyesDriver * >(argp1);
3217
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
3218
+ if (!SWIG_IsOK(ecode2)) {
3219
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "getPathXAtIndex" "', argument " "2"" of type '" "int""'");
3220
+ }
3221
+ arg2 = static_cast< int >(val2);
3222
+ result = (int)(arg1)->getPathXAtIndex(arg2);
3223
+ vresult = SWIG_From_int(static_cast< int >(result));
3224
+ return vresult;
3225
+ fail:
3226
+ return Qnil;
3227
+ }
3228
+
3229
+
3230
+ SWIGINTERN VALUE
3231
+ _wrap_HeyesDriver_diffclock(int argc, VALUE *argv, VALUE self) {
3232
+ HeyesDriver *arg1 = (HeyesDriver *) 0 ;
3233
+ clock_t arg2 ;
3234
+ clock_t arg3 ;
3235
+ double result;
3236
+ void *argp1 = 0 ;
3237
+ int res1 = 0 ;
3238
+ void *argp2 ;
3239
+ int res2 = 0 ;
3240
+ void *argp3 ;
3241
+ int res3 = 0 ;
3242
+ VALUE vresult = Qnil;
3243
+
3244
+ if ((argc < 2) || (argc > 2)) {
3245
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3246
+ }
3247
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_HeyesDriver, 0 | 0 );
3248
+ if (!SWIG_IsOK(res1)) {
3249
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "diffclock" "', argument " "1"" of type '" "HeyesDriver *""'");
3250
+ }
3251
+ arg1 = reinterpret_cast< HeyesDriver * >(argp1);
3252
+ {
3253
+ res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_clock_t, 0 );
3254
+ if (!SWIG_IsOK(res2)) {
3255
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "diffclock" "', argument " "2"" of type '" "clock_t""'");
3256
+ }
3257
+ if (!argp2) {
3258
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "diffclock" "', argument " "2"" of type '" "clock_t""'");
3259
+ } else {
3260
+ arg2 = *(reinterpret_cast< clock_t * >(argp2));
3261
+ }
3262
+ }
3263
+ {
3264
+ res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_clock_t, 0 );
3265
+ if (!SWIG_IsOK(res3)) {
3266
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "diffclock" "', argument " "3"" of type '" "clock_t""'");
3267
+ }
3268
+ if (!argp3) {
3269
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "diffclock" "', argument " "3"" of type '" "clock_t""'");
3270
+ } else {
3271
+ arg3 = *(reinterpret_cast< clock_t * >(argp3));
3272
+ }
3273
+ }
3274
+ result = (double)(arg1)->diffclock(arg2,arg3);
3275
+ vresult = SWIG_From_double(static_cast< double >(result));
3276
+ return vresult;
3277
+ fail:
3278
+ return Qnil;
3279
+ }
3280
+
3281
+
3282
+ SWIGINTERN void
3283
+ free_HeyesDriver(HeyesDriver *arg1) {
3284
+ delete arg1;
3285
+ }
3286
+
3287
+
3288
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
3289
+
3290
+ static swig_type_info _swigt__p_AStarSearchTMapSearchNode_t = {"_p_AStarSearchTMapSearchNode_t", "AStarSearch<MapSearchNode > *", 0, 0, (void*)0, 0};
3291
+ static swig_type_info _swigt__p_HeyesDriver = {"_p_HeyesDriver", "HeyesDriver *", 0, 0, (void*)0, 0};
3292
+ static swig_type_info _swigt__p_Map = {"_p_Map", "Map *", 0, 0, (void*)0, 0};
3293
+ static swig_type_info _swigt__p_MapSearchNode = {"_p_MapSearchNode", "MapSearchNode *", 0, 0, (void*)0, 0};
3294
+ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
3295
+ static swig_type_info _swigt__p_clock_t = {"_p_clock_t", "clock_t *", 0, 0, (void*)0, 0};
3296
+ static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0};
3297
+
3298
+ static swig_type_info *swig_type_initial[] = {
3299
+ &_swigt__p_AStarSearchTMapSearchNode_t,
3300
+ &_swigt__p_HeyesDriver,
3301
+ &_swigt__p_Map,
3302
+ &_swigt__p_MapSearchNode,
3303
+ &_swigt__p_char,
3304
+ &_swigt__p_clock_t,
3305
+ &_swigt__p_int,
3306
+ };
3307
+
3308
+ static swig_cast_info _swigc__p_AStarSearchTMapSearchNode_t[] = { {&_swigt__p_AStarSearchTMapSearchNode_t, 0, 0, 0},{0, 0, 0, 0}};
3309
+ static swig_cast_info _swigc__p_HeyesDriver[] = { {&_swigt__p_HeyesDriver, 0, 0, 0},{0, 0, 0, 0}};
3310
+ static swig_cast_info _swigc__p_Map[] = { {&_swigt__p_Map, 0, 0, 0},{0, 0, 0, 0}};
3311
+ static swig_cast_info _swigc__p_MapSearchNode[] = { {&_swigt__p_MapSearchNode, 0, 0, 0},{0, 0, 0, 0}};
3312
+ static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
3313
+ static swig_cast_info _swigc__p_clock_t[] = { {&_swigt__p_clock_t, 0, 0, 0},{0, 0, 0, 0}};
3314
+ static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
3315
+
3316
+ static swig_cast_info *swig_cast_initial[] = {
3317
+ _swigc__p_AStarSearchTMapSearchNode_t,
3318
+ _swigc__p_HeyesDriver,
3319
+ _swigc__p_Map,
3320
+ _swigc__p_MapSearchNode,
3321
+ _swigc__p_char,
3322
+ _swigc__p_clock_t,
3323
+ _swigc__p_int,
3324
+ };
3325
+
3326
+
3327
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
3328
+
3329
+ /* -----------------------------------------------------------------------------
3330
+ * Type initialization:
3331
+ * This problem is tough by the requirement that no dynamic
3332
+ * memory is used. Also, since swig_type_info structures store pointers to
3333
+ * swig_cast_info structures and swig_cast_info structures store pointers back
3334
+ * to swig_type_info structures, we need some lookup code at initialization.
3335
+ * The idea is that swig generates all the structures that are needed.
3336
+ * The runtime then collects these partially filled structures.
3337
+ * The SWIG_InitializeModule function takes these initial arrays out of
3338
+ * swig_module, and does all the lookup, filling in the swig_module.types
3339
+ * array with the correct data and linking the correct swig_cast_info
3340
+ * structures together.
3341
+ *
3342
+ * The generated swig_type_info structures are assigned staticly to an initial
3343
+ * array. We just loop through that array, and handle each type individually.
3344
+ * First we lookup if this type has been already loaded, and if so, use the
3345
+ * loaded structure instead of the generated one. Then we have to fill in the
3346
+ * cast linked list. The cast data is initially stored in something like a
3347
+ * two-dimensional array. Each row corresponds to a type (there are the same
3348
+ * number of rows as there are in the swig_type_initial array). Each entry in
3349
+ * a column is one of the swig_cast_info structures for that type.
3350
+ * The cast_initial array is actually an array of arrays, because each row has
3351
+ * a variable number of columns. So to actually build the cast linked list,
3352
+ * we find the array of casts associated with the type, and loop through it
3353
+ * adding the casts to the list. The one last trick we need to do is making
3354
+ * sure the type pointer in the swig_cast_info struct is correct.
3355
+ *
3356
+ * First off, we lookup the cast->type name to see if it is already loaded.
3357
+ * There are three cases to handle:
3358
+ * 1) If the cast->type has already been loaded AND the type we are adding
3359
+ * casting info to has not been loaded (it is in this module), THEN we
3360
+ * replace the cast->type pointer with the type pointer that has already
3361
+ * been loaded.
3362
+ * 2) If BOTH types (the one we are adding casting info to, and the
3363
+ * cast->type) are loaded, THEN the cast info has already been loaded by
3364
+ * the previous module so we just ignore it.
3365
+ * 3) Finally, if cast->type has not already been loaded, then we add that
3366
+ * swig_cast_info to the linked list (because the cast->type) pointer will
3367
+ * be correct.
3368
+ * ----------------------------------------------------------------------------- */
3369
+
3370
+ #ifdef __cplusplus
3371
+ extern "C" {
3372
+ #if 0
3373
+ } /* c-mode */
3374
+ #endif
3375
+ #endif
3376
+
3377
+ #if 0
3378
+ #define SWIGRUNTIME_DEBUG
3379
+ #endif
3380
+
3381
+
3382
+ SWIGRUNTIME void
3383
+ SWIG_InitializeModule(void *clientdata) {
3384
+ size_t i;
3385
+ swig_module_info *module_head, *iter;
3386
+ int found;
3387
+
3388
+ clientdata = clientdata;
3389
+
3390
+ /* check to see if the circular list has been setup, if not, set it up */
3391
+ if (swig_module.next==0) {
3392
+ /* Initialize the swig_module */
3393
+ swig_module.type_initial = swig_type_initial;
3394
+ swig_module.cast_initial = swig_cast_initial;
3395
+ swig_module.next = &swig_module;
3396
+ }
3397
+
3398
+ /* Try and load any already created modules */
3399
+ module_head = SWIG_GetModule(clientdata);
3400
+ if (!module_head) {
3401
+ /* This is the first module loaded for this interpreter */
3402
+ /* so set the swig module into the interpreter */
3403
+ SWIG_SetModule(clientdata, &swig_module);
3404
+ module_head = &swig_module;
3405
+ } else {
3406
+ /* the interpreter has loaded a SWIG module, but has it loaded this one? */
3407
+ found=0;
3408
+ iter=module_head;
3409
+ do {
3410
+ if (iter==&swig_module) {
3411
+ found=1;
3412
+ break;
3413
+ }
3414
+ iter=iter->next;
3415
+ } while (iter!= module_head);
3416
+
3417
+ /* if the is found in the list, then all is done and we may leave */
3418
+ if (found) return;
3419
+ /* otherwise we must add out module into the list */
3420
+ swig_module.next = module_head->next;
3421
+ module_head->next = &swig_module;
3422
+ }
3423
+
3424
+ /* Now work on filling in swig_module.types */
3425
+ #ifdef SWIGRUNTIME_DEBUG
3426
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
3427
+ #endif
3428
+ for (i = 0; i < swig_module.size; ++i) {
3429
+ swig_type_info *type = 0;
3430
+ swig_type_info *ret;
3431
+ swig_cast_info *cast;
3432
+
3433
+ #ifdef SWIGRUNTIME_DEBUG
3434
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
3435
+ #endif
3436
+
3437
+ /* if there is another module already loaded */
3438
+ if (swig_module.next != &swig_module) {
3439
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
3440
+ }
3441
+ if (type) {
3442
+ /* Overwrite clientdata field */
3443
+ #ifdef SWIGRUNTIME_DEBUG
3444
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
3445
+ #endif
3446
+ if (swig_module.type_initial[i]->clientdata) {
3447
+ type->clientdata = swig_module.type_initial[i]->clientdata;
3448
+ #ifdef SWIGRUNTIME_DEBUG
3449
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
3450
+ #endif
3451
+ }
3452
+ } else {
3453
+ type = swig_module.type_initial[i];
3454
+ }
3455
+
3456
+ /* Insert casting types */
3457
+ cast = swig_module.cast_initial[i];
3458
+ while (cast->type) {
3459
+
3460
+ /* Don't need to add information already in the list */
3461
+ ret = 0;
3462
+ #ifdef SWIGRUNTIME_DEBUG
3463
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
3464
+ #endif
3465
+ if (swig_module.next != &swig_module) {
3466
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
3467
+ #ifdef SWIGRUNTIME_DEBUG
3468
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
3469
+ #endif
3470
+ }
3471
+ if (ret) {
3472
+ if (type == swig_module.type_initial[i]) {
3473
+ #ifdef SWIGRUNTIME_DEBUG
3474
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
3475
+ #endif
3476
+ cast->type = ret;
3477
+ ret = 0;
3478
+ } else {
3479
+ /* Check for casting already in the list */
3480
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
3481
+ #ifdef SWIGRUNTIME_DEBUG
3482
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
3483
+ #endif
3484
+ if (!ocast) ret = 0;
3485
+ }
3486
+ }
3487
+
3488
+ if (!ret) {
3489
+ #ifdef SWIGRUNTIME_DEBUG
3490
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
3491
+ #endif
3492
+ if (type->cast) {
3493
+ type->cast->prev = cast;
3494
+ cast->next = type->cast;
3495
+ }
3496
+ type->cast = cast;
3497
+ }
3498
+ cast++;
3499
+ }
3500
+ /* Set entry in modules->types array equal to the type */
3501
+ swig_module.types[i] = type;
3502
+ }
3503
+ swig_module.types[i] = 0;
3504
+
3505
+ #ifdef SWIGRUNTIME_DEBUG
3506
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
3507
+ for (i = 0; i < swig_module.size; ++i) {
3508
+ int j = 0;
3509
+ swig_cast_info *cast = swig_module.cast_initial[i];
3510
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
3511
+ while (cast->type) {
3512
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
3513
+ cast++;
3514
+ ++j;
3515
+ }
3516
+ printf("---- Total casts: %d\n",j);
3517
+ }
3518
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
3519
+ #endif
3520
+ }
3521
+
3522
+ /* This function will propagate the clientdata field of type to
3523
+ * any new swig_type_info structures that have been added into the list
3524
+ * of equivalent types. It is like calling
3525
+ * SWIG_TypeClientData(type, clientdata) a second time.
3526
+ */
3527
+ SWIGRUNTIME void
3528
+ SWIG_PropagateClientData(void) {
3529
+ size_t i;
3530
+ swig_cast_info *equiv;
3531
+ static int init_run = 0;
3532
+
3533
+ if (init_run) return;
3534
+ init_run = 1;
3535
+
3536
+ for (i = 0; i < swig_module.size; i++) {
3537
+ if (swig_module.types[i]->clientdata) {
3538
+ equiv = swig_module.types[i]->cast;
3539
+ while (equiv) {
3540
+ if (!equiv->converter) {
3541
+ if (equiv->type && !equiv->type->clientdata)
3542
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
3543
+ }
3544
+ equiv = equiv->next;
3545
+ }
3546
+ }
3547
+ }
3548
+ }
3549
+
3550
+ #ifdef __cplusplus
3551
+ #if 0
3552
+ { /* c-mode */
3553
+ #endif
3554
+ }
3555
+ #endif
3556
+
3557
+
3558
+ #ifdef __cplusplus
3559
+ extern "C"
3560
+ #endif
3561
+ SWIGEXPORT void Init_heyes(void) {
3562
+ size_t i;
3563
+
3564
+ SWIG_InitRuntime();
3565
+ mHeyes = rb_define_module("Heyes");
3566
+
3567
+ SWIG_InitializeModule(0);
3568
+ for (i = 0; i < swig_module.size; i++) {
3569
+ SWIG_define_class(swig_module.types[i]);
3570
+ }
3571
+
3572
+ SWIG_RubyInitializeTrackings();
3573
+ rb_define_const(mHeyes, "USE_FSA_MEMORY", SWIG_From_int(static_cast< int >(1)));
3574
+ rb_define_const(mHeyes, "DEBUG_LISTS", SWIG_From_int(static_cast< int >(0)));
3575
+ rb_define_const(mHeyes, "DEBUG_LIST_LENGTHS_ONLY", SWIG_From_int(static_cast< int >(0)));
3576
+ rb_define_singleton_method(mHeyes, "DEBUG", VALUEFUNC(DEBUG_get), 0);
3577
+ rb_define_singleton_method(mHeyes, "DEBUG=", VALUEFUNC(DEBUG_set), 1);
3578
+
3579
+ cMap.klass = rb_define_class_under(mHeyes, "Map", rb_cObject);
3580
+ SWIG_TypeClientData(SWIGTYPE_p_Map, (void *) &cMap);
3581
+ rb_define_alloc_func(cMap.klass, _wrap_Map_allocate);
3582
+ rb_define_method(cMap.klass, "initialize", VALUEFUNC(_wrap_new_Map), -1);
3583
+ rb_define_const(cMap.klass, "MAP_OUT_OF_BOUNDS", SWIG_From_int(static_cast< int >(Map::MAP_OUT_OF_BOUNDS)));
3584
+ rb_define_const(cMap.klass, "MAP_NO_WALK", SWIG_From_int(static_cast< int >(Map::MAP_NO_WALK)));
3585
+ rb_define_method(cMap.klass, "width=", VALUEFUNC(_wrap_Map_width_set), -1);
3586
+ rb_define_method(cMap.klass, "width", VALUEFUNC(_wrap_Map_width_get), -1);
3587
+ rb_define_method(cMap.klass, "height=", VALUEFUNC(_wrap_Map_height_set), -1);
3588
+ rb_define_method(cMap.klass, "height", VALUEFUNC(_wrap_Map_height_get), -1);
3589
+ rb_define_method(cMap.klass, "map=", VALUEFUNC(_wrap_Map_map_set), -1);
3590
+ rb_define_method(cMap.klass, "map", VALUEFUNC(_wrap_Map_map_get), -1);
3591
+ rb_define_method(cMap.klass, "getCost", VALUEFUNC(_wrap_Map_getCost), -1);
3592
+ rb_define_method(cMap.klass, "setCost", VALUEFUNC(_wrap_Map_setCost), -1);
3593
+ cMap.mark = 0;
3594
+ cMap.destroy = (void (*)(void *)) free_Map;
3595
+ cMap.trackObjects = 0;
3596
+ rb_define_singleton_method(mHeyes, "MAP", VALUEFUNC(MAP_get), 0);
3597
+ rb_define_singleton_method(mHeyes, "MAP=", VALUEFUNC(MAP_set), 1);
3598
+ rb_define_singleton_method(mHeyes, "NUMBER_OF_NEIGHBORS", VALUEFUNC(NUMBER_OF_NEIGHBORS_get), 0);
3599
+ rb_define_singleton_method(mHeyes, "NUMBER_OF_NEIGHBORS=", VALUEFUNC(NUMBER_OF_NEIGHBORS_set), 1);
3600
+
3601
+ cMapSearchNode.klass = rb_define_class_under(mHeyes, "MapSearchNode", rb_cObject);
3602
+ SWIG_TypeClientData(SWIGTYPE_p_MapSearchNode, (void *) &cMapSearchNode);
3603
+ rb_define_alloc_func(cMapSearchNode.klass, _wrap_MapSearchNode_allocate);
3604
+ rb_define_method(cMapSearchNode.klass, "initialize", VALUEFUNC(_wrap_new_MapSearchNode), -1);
3605
+ rb_define_method(cMapSearchNode.klass, "x=", VALUEFUNC(_wrap_MapSearchNode_x_set), -1);
3606
+ rb_define_method(cMapSearchNode.klass, "x", VALUEFUNC(_wrap_MapSearchNode_x_get), -1);
3607
+ rb_define_method(cMapSearchNode.klass, "y=", VALUEFUNC(_wrap_MapSearchNode_y_set), -1);
3608
+ rb_define_method(cMapSearchNode.klass, "y", VALUEFUNC(_wrap_MapSearchNode_y_get), -1);
3609
+ rb_define_method(cMapSearchNode.klass, "GoalDistanceEstimate", VALUEFUNC(_wrap_MapSearchNode_GoalDistanceEstimate), -1);
3610
+ rb_define_method(cMapSearchNode.klass, "IsGoal", VALUEFUNC(_wrap_MapSearchNode_IsGoal), -1);
3611
+ rb_define_method(cMapSearchNode.klass, "GetSuccessors", VALUEFUNC(_wrap_MapSearchNode_GetSuccessors), -1);
3612
+ rb_define_method(cMapSearchNode.klass, "GetCost", VALUEFUNC(_wrap_MapSearchNode_GetCost), -1);
3613
+ rb_define_method(cMapSearchNode.klass, "IsSameState", VALUEFUNC(_wrap_MapSearchNode_IsSameState), -1);
3614
+ rb_define_method(cMapSearchNode.klass, "PrintNodeInfo", VALUEFUNC(_wrap_MapSearchNode_PrintNodeInfo), -1);
3615
+ cMapSearchNode.mark = 0;
3616
+ cMapSearchNode.destroy = (void (*)(void *)) free_MapSearchNode;
3617
+ cMapSearchNode.trackObjects = 0;
3618
+
3619
+ cHeyesDriver.klass = rb_define_class_under(mHeyes, "HeyesDriver", rb_cObject);
3620
+ SWIG_TypeClientData(SWIGTYPE_p_HeyesDriver, (void *) &cHeyesDriver);
3621
+ rb_define_alloc_func(cHeyesDriver.klass, _wrap_HeyesDriver_allocate);
3622
+ rb_define_method(cHeyesDriver.klass, "initialize", VALUEFUNC(_wrap_new_HeyesDriver), -1);
3623
+ rb_define_const(cHeyesDriver.klass, "FOUR_NEIGHBORS", SWIG_From_int(static_cast< int >(HeyesDriver::FOUR_NEIGHBORS)));
3624
+ rb_define_const(cHeyesDriver.klass, "EIGHT_NEIGHBORS", SWIG_From_int(static_cast< int >(HeyesDriver::EIGHT_NEIGHBORS)));
3625
+ rb_define_method(cHeyesDriver.klass, "nodeStart=", VALUEFUNC(_wrap_HeyesDriver_nodeStart_set), -1);
3626
+ rb_define_method(cHeyesDriver.klass, "nodeStart", VALUEFUNC(_wrap_HeyesDriver_nodeStart_get), -1);
3627
+ rb_define_method(cHeyesDriver.klass, "nodeEnd=", VALUEFUNC(_wrap_HeyesDriver_nodeEnd_set), -1);
3628
+ rb_define_method(cHeyesDriver.klass, "nodeEnd", VALUEFUNC(_wrap_HeyesDriver_nodeEnd_get), -1);
3629
+ rb_define_method(cHeyesDriver.klass, "timeElapsed=", VALUEFUNC(_wrap_HeyesDriver_timeElapsed_set), -1);
3630
+ rb_define_method(cHeyesDriver.klass, "timeElapsed", VALUEFUNC(_wrap_HeyesDriver_timeElapsed_get), -1);
3631
+ rb_define_method(cHeyesDriver.klass, "run", VALUEFUNC(_wrap_HeyesDriver_run), -1);
3632
+ rb_define_method(cHeyesDriver.klass, "getMap", VALUEFUNC(_wrap_HeyesDriver_getMap), -1);
3633
+ rb_define_method(cHeyesDriver.klass, "getPathLength", VALUEFUNC(_wrap_HeyesDriver_getPathLength), -1);
3634
+ rb_define_method(cHeyesDriver.klass, "getPathYAtIndex", VALUEFUNC(_wrap_HeyesDriver_getPathYAtIndex), -1);
3635
+ rb_define_method(cHeyesDriver.klass, "getPathXAtIndex", VALUEFUNC(_wrap_HeyesDriver_getPathXAtIndex), -1);
3636
+ rb_define_method(cHeyesDriver.klass, "diffclock", VALUEFUNC(_wrap_HeyesDriver_diffclock), -1);
3637
+ cHeyesDriver.mark = 0;
3638
+ cHeyesDriver.destroy = (void (*)(void *)) free_HeyesDriver;
3639
+ cHeyesDriver.trackObjects = 0;
3640
+ }
3641
+