oboe 2.7.0.3-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +8 -0
  3. data/.travis.yml +51 -0
  4. data/Appraisals +10 -0
  5. data/CHANGELOG.md +223 -0
  6. data/Gemfile +49 -0
  7. data/LICENSE +199 -0
  8. data/README.md +380 -0
  9. data/Rakefile +106 -0
  10. data/ext/oboe_metal/extconf.rb +61 -0
  11. data/ext/oboe_metal/noop/noop.c +7 -0
  12. data/ext/oboe_metal/src/bson/bson.h +221 -0
  13. data/ext/oboe_metal/src/bson/platform_hacks.h +91 -0
  14. data/ext/oboe_metal/src/oboe.h +275 -0
  15. data/ext/oboe_metal/src/oboe.hpp +352 -0
  16. data/ext/oboe_metal/src/oboe_wrap.cxx +3886 -0
  17. data/ext/oboe_metal/tests/test.rb +11 -0
  18. data/gemfiles/mongo.gemfile +33 -0
  19. data/gemfiles/moped.gemfile +33 -0
  20. data/get_version.rb +5 -0
  21. data/init.rb +4 -0
  22. data/lib/base.rb +99 -0
  23. data/lib/joboe_metal.rb +185 -0
  24. data/lib/method_profiling.rb +70 -0
  25. data/lib/oboe.rb +50 -0
  26. data/lib/oboe/api.rb +14 -0
  27. data/lib/oboe/api/layerinit.rb +99 -0
  28. data/lib/oboe/api/logging.rb +129 -0
  29. data/lib/oboe/api/memcache.rb +29 -0
  30. data/lib/oboe/api/profiling.rb +50 -0
  31. data/lib/oboe/api/tracing.rb +134 -0
  32. data/lib/oboe/api/util.rb +117 -0
  33. data/lib/oboe/config.rb +140 -0
  34. data/lib/oboe/frameworks/grape.rb +74 -0
  35. data/lib/oboe/frameworks/padrino.rb +66 -0
  36. data/lib/oboe/frameworks/padrino/templates.rb +59 -0
  37. data/lib/oboe/frameworks/rails.rb +139 -0
  38. data/lib/oboe/frameworks/rails/helpers/rum/rum_ajax_header.js.erb +5 -0
  39. data/lib/oboe/frameworks/rails/helpers/rum/rum_footer.js.erb +1 -0
  40. data/lib/oboe/frameworks/rails/helpers/rum/rum_header.js.erb +3 -0
  41. data/lib/oboe/frameworks/rails/inst/action_controller.rb +123 -0
  42. data/lib/oboe/frameworks/rails/inst/action_view.rb +56 -0
  43. data/lib/oboe/frameworks/rails/inst/action_view_2x.rb +54 -0
  44. data/lib/oboe/frameworks/rails/inst/action_view_30.rb +48 -0
  45. data/lib/oboe/frameworks/rails/inst/active_record.rb +24 -0
  46. data/lib/oboe/frameworks/rails/inst/connection_adapters/mysql.rb +43 -0
  47. data/lib/oboe/frameworks/rails/inst/connection_adapters/mysql2.rb +28 -0
  48. data/lib/oboe/frameworks/rails/inst/connection_adapters/oracle.rb +18 -0
  49. data/lib/oboe/frameworks/rails/inst/connection_adapters/postgresql.rb +30 -0
  50. data/lib/oboe/frameworks/rails/inst/connection_adapters/utils.rb +118 -0
  51. data/lib/oboe/frameworks/sinatra.rb +96 -0
  52. data/lib/oboe/frameworks/sinatra/templates.rb +56 -0
  53. data/lib/oboe/inst/cassandra.rb +281 -0
  54. data/lib/oboe/inst/dalli.rb +75 -0
  55. data/lib/oboe/inst/http.rb +72 -0
  56. data/lib/oboe/inst/memcache.rb +105 -0
  57. data/lib/oboe/inst/memcached.rb +96 -0
  58. data/lib/oboe/inst/mongo.rb +240 -0
  59. data/lib/oboe/inst/moped.rb +474 -0
  60. data/lib/oboe/inst/rack.rb +81 -0
  61. data/lib/oboe/inst/redis.rb +273 -0
  62. data/lib/oboe/inst/resque.rb +193 -0
  63. data/lib/oboe/instrumentation.rb +18 -0
  64. data/lib/oboe/loading.rb +98 -0
  65. data/lib/oboe/logger.rb +41 -0
  66. data/lib/oboe/ruby.rb +11 -0
  67. data/lib/oboe/util.rb +129 -0
  68. data/lib/oboe/version.rb +13 -0
  69. data/lib/oboe/xtrace.rb +52 -0
  70. data/lib/oboe_metal.rb +140 -0
  71. data/lib/rails/generators/oboe/install_generator.rb +76 -0
  72. data/lib/rails/generators/oboe/templates/oboe_initializer.rb +94 -0
  73. data/oboe.gemspec +29 -0
  74. data/release.sh +65 -0
  75. data/test/frameworks/apps/grape_simple.rb +10 -0
  76. data/test/frameworks/apps/padrino_simple.rb +41 -0
  77. data/test/frameworks/apps/sinatra_simple.rb +20 -0
  78. data/test/frameworks/grape_test.rb +27 -0
  79. data/test/frameworks/padrino_test.rb +25 -0
  80. data/test/frameworks/sinatra_test.rb +25 -0
  81. data/test/instrumentation/cassandra_test.rb +381 -0
  82. data/test/instrumentation/dalli_test.rb +164 -0
  83. data/test/instrumentation/http_test.rb +97 -0
  84. data/test/instrumentation/memcache_test.rb +251 -0
  85. data/test/instrumentation/memcached_test.rb +226 -0
  86. data/test/instrumentation/mongo_test.rb +462 -0
  87. data/test/instrumentation/moped_test.rb +473 -0
  88. data/test/instrumentation/rack_test.rb +73 -0
  89. data/test/instrumentation/redis_hashes_test.rb +265 -0
  90. data/test/instrumentation/redis_keys_test.rb +318 -0
  91. data/test/instrumentation/redis_lists_test.rb +310 -0
  92. data/test/instrumentation/redis_misc_test.rb +160 -0
  93. data/test/instrumentation/redis_sets_test.rb +293 -0
  94. data/test/instrumentation/redis_sortedsets_test.rb +325 -0
  95. data/test/instrumentation/redis_strings_test.rb +333 -0
  96. data/test/instrumentation/resque_test.rb +62 -0
  97. data/test/minitest_helper.rb +148 -0
  98. data/test/profiling/method_test.rb +198 -0
  99. data/test/support/config_test.rb +39 -0
  100. data/test/support/liboboe_settings_test.rb +46 -0
  101. data/test/support/xtrace_test.rb +35 -0
  102. metadata +200 -0
@@ -0,0 +1,352 @@
1
+ #ifndef OBOE_HPP
2
+ #define OBOE_HPP
3
+
4
+ #include <string>
5
+ #include <oboe.h>
6
+
7
+
8
+ class Event;
9
+
10
+ class Metadata : private oboe_metadata_t {
11
+ friend class UdpReporter;
12
+ friend class FileReporter;
13
+ friend class Context;
14
+
15
+ public:
16
+ Metadata(oboe_metadata_t *md) {
17
+ oboe_metadata_copy(this, md);
18
+ }
19
+
20
+ ~Metadata() {
21
+ oboe_metadata_destroy(this);
22
+ }
23
+
24
+ static Metadata* fromString(std::string s) {
25
+ oboe_metadata_t md;
26
+ oboe_metadata_fromstr(&md, s.data(), s.size());
27
+ return new Metadata(&md); // copies md
28
+ }
29
+
30
+ // these new objects are managed by SWIG %newobject
31
+ Event *createEvent();
32
+
33
+ static Metadata *makeRandom() {
34
+ oboe_metadata_t md;
35
+ oboe_metadata_init(&md);
36
+ oboe_metadata_random(&md);
37
+ return new Metadata(&md); // copies md
38
+ }
39
+
40
+ Metadata *copy() {
41
+ return new Metadata(this);
42
+ }
43
+
44
+ bool isValid() {
45
+ return oboe_metadata_is_valid(this);
46
+ }
47
+
48
+ #ifdef SWIGJAVA
49
+ std::string toStr() {
50
+ #else
51
+ std::string toString() {
52
+ #endif
53
+ char buf[OBOE_MAX_METADATA_PACK_LEN];
54
+
55
+ int rc = oboe_metadata_tostr(this, buf, sizeof(buf) - 1);
56
+ if (rc == 0) {
57
+ return std::string(buf);
58
+ } else {
59
+ return std::string(); // throw exception?
60
+ }
61
+ }
62
+
63
+ };
64
+
65
+ class Context {
66
+ public:
67
+ /**
68
+ * Set the tracing mode.
69
+ *
70
+ * @param newMode One of
71
+ * - OBOE_TRACE_NEVER(0) to disable tracing,
72
+ * - OBOE_TRACE_ALWAYS(1) to start a new trace if needed, or
73
+ * - OBOE_TRACE_THROUGH(2) to only add to an existing trace.
74
+ */
75
+ static void setTracingMode(int newMode) {
76
+ oboe_settings_cfg_tracing_mode_set(newMode);
77
+ }
78
+
79
+ /**
80
+ * Set the default sample rate.
81
+ *
82
+ * This rate is used until overridden by the TraceView servers. If not set then the
83
+ * value 300,000 will be used (ie. 30%).
84
+ *
85
+ * The rate is interpreted as a ratio out of OBOE_SAMPLE_RESOLUTION (currently 1,000,000).
86
+ *
87
+ * @param newRate A number between 0 (none) and OBOE_SAMPLE_RESOLUTION (a million)
88
+ */
89
+ static void setDefaultSampleRate(int newRate) {
90
+ oboe_settings_cfg_sample_rate_set(newRate);
91
+ }
92
+
93
+ /**
94
+ * Check if the current request should be traced based on the current settings.
95
+ *
96
+ * If xtrace is empty, or if it is identified as a foreign (ie. cross customer)
97
+ * trace, then sampling will be considered as a new trace.
98
+ * Otherwise sampling will be considered as adding to the current trace.
99
+ * Different layers may have special rules. Also special rules for AppView
100
+ * Web synthetic traces apply if in_tv_meta is given a non-empty string.
101
+ *
102
+ * This is designed to be called once per layer per request.
103
+ *
104
+ * @param layer Name of the layer being considered for tracing
105
+ * @param in_xtrace Incoming X-Trace ID (NULL or empty string if not present)
106
+ * @param in_tv_meta AppView Web ID from X-TV-Meta HTTP header or higher layer (NULL or empty string if not present).
107
+ * @return Zero to not trace; otherwise return the sample rate used in the low order
108
+ * bytes 0 to 2 and the sample source in the higher-order byte 3.
109
+ */
110
+ static int sampleRequest(
111
+ std::string layer,
112
+ std::string in_xtrace,
113
+ std::string in_tv_meta)
114
+ {
115
+ int sample_rate = 0;
116
+ int sample_source = 0;
117
+ int rc = (oboe_sample_layer(layer.c_str(), in_xtrace.c_str(), in_tv_meta.c_str(), &sample_rate, &sample_source));
118
+
119
+ return (rc == 0 ? 0 : (((sample_source & 0xFF) << 24) | (sample_rate & 0xFFFFFF)));
120
+ }
121
+
122
+ // returns pointer to current context (from thread-local storage)
123
+ static oboe_metadata_t *get() {
124
+ return oboe_context_get();
125
+ }
126
+
127
+ #ifdef SWIGJAVA
128
+ static std::string toStr() {
129
+ #else
130
+ static std::string toString() {
131
+ #endif
132
+ char buf[OBOE_MAX_METADATA_PACK_LEN];
133
+
134
+ oboe_metadata_t *md = Context::get();
135
+ int rc = oboe_metadata_tostr(md, buf, sizeof(buf) - 1);
136
+ if (rc == 0) {
137
+ return std::string(buf);
138
+ } else {
139
+ return std::string(); // throw exception?
140
+ }
141
+ }
142
+
143
+ static void set(oboe_metadata_t *md) {
144
+ oboe_context_set(md);
145
+ }
146
+
147
+ static void fromString(std::string s) {
148
+ oboe_context_set_fromstr(s.data(), s.size());
149
+ }
150
+
151
+ // this new object is managed by SWIG %newobject
152
+ static Metadata *copy() {
153
+ return new Metadata(Context::get());
154
+ }
155
+
156
+ static void clear() {
157
+ oboe_context_clear();
158
+ }
159
+
160
+ static bool isValid() {
161
+ return oboe_context_is_valid();
162
+ }
163
+
164
+ static void init() {
165
+ oboe_init();
166
+ }
167
+
168
+ // these new objects are managed by SWIG %newobject
169
+ static Event *createEvent();
170
+ static Event *startTrace();
171
+ };
172
+
173
+ class Event : private oboe_event_t {
174
+ friend class UdpReporter;
175
+ friend class FileReporter;
176
+ friend class Context;
177
+ friend class Metadata;
178
+
179
+ private:
180
+ Event() {
181
+ oboe_event_init(this, Context::get());
182
+ }
183
+
184
+ Event(const oboe_metadata_t *md, bool addEdge=true) {
185
+ // both methods copy metadata from md -> this
186
+ if (addEdge) {
187
+ // create_event automatically adds edge in event to md
188
+ oboe_metadata_create_event(md, this);
189
+ } else {
190
+ // initializes new Event with this md's task_id & new random op_id; no edges set
191
+ oboe_event_init(this, md);
192
+ }
193
+ }
194
+
195
+ public:
196
+ ~Event() {
197
+ oboe_event_destroy(this);
198
+ }
199
+
200
+ // called e.g. from Python e.addInfo("Key", None) & Ruby e.addInfo("Key", nil)
201
+ bool addInfo(char *key, void* val) {
202
+ // oboe_event_add_info(evt, key, NULL) does nothing
203
+ (void) key;
204
+ (void) val;
205
+ return true;
206
+ }
207
+
208
+ bool addInfo(char *key, const std::string& val) {
209
+ if (memchr(val.data(), '\0', val.size())) {
210
+ return oboe_event_add_info_binary(this, key, val.data(), val.size()) == 0;
211
+ } else {
212
+ return oboe_event_add_info(this, key, val.data()) == 0;
213
+ }
214
+ }
215
+
216
+ bool addInfo(char *key, long val) {
217
+ int64_t val_ = val;
218
+ return oboe_event_add_info_int64(this, key, val_) == 0;
219
+ }
220
+
221
+ bool addInfo(char *key, double val) {
222
+ return oboe_event_add_info_double(this, key, val) == 0;
223
+ }
224
+
225
+ bool addEdge(oboe_metadata_t *md) {
226
+ return oboe_event_add_edge(this, md) == 0;
227
+ }
228
+
229
+ bool addEdgeStr(const std::string& val) {
230
+ return oboe_event_add_edge_fromstr(this, val.c_str(), val.size()) == 0;
231
+ }
232
+
233
+ Metadata* getMetadata() {
234
+ return new Metadata(&this->metadata);
235
+ }
236
+
237
+ std::string metadataString() {
238
+ char buf[OBOE_MAX_METADATA_PACK_LEN];
239
+
240
+ int rc = oboe_metadata_tostr(&this->metadata, buf, sizeof(buf) - 1);
241
+ if (rc == 0) {
242
+ return std::string(buf);
243
+ } else {
244
+ return std::string(); // throw exception?
245
+ }
246
+ }
247
+
248
+ static Event* startTrace(const oboe_metadata_t *md);
249
+
250
+ };
251
+
252
+ Event *Context::createEvent() {
253
+ return new Event(Context::get());
254
+ }
255
+
256
+ Event *Metadata::createEvent() {
257
+ return new Event(this);
258
+ }
259
+
260
+ Event *Context::startTrace() {
261
+ oboe_metadata_t *md = Context::get();
262
+ oboe_metadata_random(md);
263
+ return new Event();
264
+ }
265
+
266
+ Event *Event::startTrace(const oboe_metadata_t *md) {
267
+ return new Event(md, false);
268
+ }
269
+
270
+ class UdpReporter : private oboe_reporter_t {
271
+ public:
272
+ UdpReporter(const char *addr, const char *port=NULL) {
273
+ if (port == NULL)
274
+ port = "7831";
275
+
276
+ oboe_reporter_udp_init(this, addr, port);
277
+ }
278
+
279
+ ~UdpReporter() {
280
+ oboe_reporter_destroy(this);
281
+ }
282
+
283
+ bool sendReport(Event *evt) {
284
+ return oboe_reporter_send(this, Context::get(), evt) >= 0;
285
+ }
286
+
287
+ bool sendReport(Event *evt, oboe_metadata_t *md) {
288
+ return oboe_reporter_send(this, md, evt) >= 0;
289
+ }
290
+ };
291
+
292
+ class FileReporter : private oboe_reporter_t {
293
+ public:
294
+ FileReporter(const char *file) {
295
+ oboe_reporter_file_init(this, file);
296
+ }
297
+
298
+ ~FileReporter() {
299
+ oboe_reporter_destroy(this);
300
+ }
301
+
302
+ bool sendReport(Event *evt) {
303
+ return oboe_reporter_send(this, Context::get(), evt) >= 0;
304
+ }
305
+
306
+ bool sendReport(Event *evt, oboe_metadata_t *md) {
307
+ return oboe_reporter_send(this, md, evt) >= 0;
308
+ }
309
+ };
310
+
311
+
312
+ class Config {
313
+ public:
314
+ /**
315
+ * Check if the Oboe library is compatible with a given version.revision.
316
+ *
317
+ * This will succeed if the library is at least as recent as specified and if no
318
+ * definitions have been removed since that revision.
319
+ *
320
+ * @param version The library's version number which increments every time the API changes.
321
+ * @param revision The revision of the current version of the library.
322
+ * @return Non-zero if the Oboe library is considered compatible with the specified revision.
323
+ */
324
+ static bool checkVersion(int version, int revision) {
325
+ return (oboe_config_check_version(version, revision) != 0);
326
+ }
327
+
328
+ /**
329
+ * Get the Oboe library version number.
330
+ *
331
+ * This number increments whenever an incompatible change to the API/ABI is made.
332
+ *
333
+ * @return The library's version number or -1 if the version is not known.
334
+ */
335
+ static int getVersion() {
336
+ return oboe_config_get_version();
337
+ }
338
+
339
+ /**
340
+ * Get the Oboe library revision number.
341
+ *
342
+ * This number increments whenever a compatible change is made to the
343
+ * API/ABI (ie. an addition).
344
+ *
345
+ * @return The library's revision number or -1 if not known.
346
+ */
347
+ static int getRevision() {
348
+ return oboe_config_get_revision();
349
+ }
350
+ };
351
+
352
+ #endif
@@ -0,0 +1,3886 @@
1
+ /* ----------------------------------------------------------------------------
2
+ * This file was automatically generated by SWIG (http://www.swig.org).
3
+ * Version 2.0.4
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
+
14
+ #ifdef __cplusplus
15
+ /* SwigValueWrapper is described in swig.swg */
16
+ template<typename T> class SwigValueWrapper {
17
+ struct SwigMovePointer {
18
+ T *ptr;
19
+ SwigMovePointer(T *p) : ptr(p) { }
20
+ ~SwigMovePointer() { delete ptr; }
21
+ SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
22
+ } pointer;
23
+ SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
24
+ SwigValueWrapper(const SwigValueWrapper<T>& rhs);
25
+ public:
26
+ SwigValueWrapper() : pointer(0) { }
27
+ SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
28
+ operator T&() const { return *pointer.ptr; }
29
+ T *operator&() { return pointer.ptr; }
30
+ };
31
+
32
+ template <typename T> T SwigValueInit() {
33
+ return T();
34
+ }
35
+ #endif
36
+
37
+ /* -----------------------------------------------------------------------------
38
+ * This section contains generic SWIG labels for method/variable
39
+ * declarations/attributes, and other compiler dependent labels.
40
+ * ----------------------------------------------------------------------------- */
41
+
42
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
43
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
44
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
45
+ # define SWIGTEMPLATEDISAMBIGUATOR template
46
+ # elif defined(__HP_aCC)
47
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
48
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
49
+ # define SWIGTEMPLATEDISAMBIGUATOR template
50
+ # else
51
+ # define SWIGTEMPLATEDISAMBIGUATOR
52
+ # endif
53
+ #endif
54
+
55
+ /* inline attribute */
56
+ #ifndef SWIGINLINE
57
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
58
+ # define SWIGINLINE inline
59
+ # else
60
+ # define SWIGINLINE
61
+ # endif
62
+ #endif
63
+
64
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
65
+ #ifndef SWIGUNUSED
66
+ # if defined(__GNUC__)
67
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
68
+ # define SWIGUNUSED __attribute__ ((__unused__))
69
+ # else
70
+ # define SWIGUNUSED
71
+ # endif
72
+ # elif defined(__ICC)
73
+ # define SWIGUNUSED __attribute__ ((__unused__))
74
+ # else
75
+ # define SWIGUNUSED
76
+ # endif
77
+ #endif
78
+
79
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
80
+ # if defined(_MSC_VER)
81
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
82
+ # endif
83
+ #endif
84
+
85
+ #ifndef SWIGUNUSEDPARM
86
+ # ifdef __cplusplus
87
+ # define SWIGUNUSEDPARM(p)
88
+ # else
89
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
90
+ # endif
91
+ #endif
92
+
93
+ /* internal SWIG method */
94
+ #ifndef SWIGINTERN
95
+ # define SWIGINTERN static SWIGUNUSED
96
+ #endif
97
+
98
+ /* internal inline SWIG method */
99
+ #ifndef SWIGINTERNINLINE
100
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
101
+ #endif
102
+
103
+ /* exporting methods */
104
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
105
+ # ifndef GCC_HASCLASSVISIBILITY
106
+ # define GCC_HASCLASSVISIBILITY
107
+ # endif
108
+ #endif
109
+
110
+ #ifndef SWIGEXPORT
111
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
112
+ # if defined(STATIC_LINKED)
113
+ # define SWIGEXPORT
114
+ # else
115
+ # define SWIGEXPORT __declspec(dllexport)
116
+ # endif
117
+ # else
118
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
119
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
120
+ # else
121
+ # define SWIGEXPORT
122
+ # endif
123
+ # endif
124
+ #endif
125
+
126
+ /* calling conventions for Windows */
127
+ #ifndef SWIGSTDCALL
128
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
129
+ # define SWIGSTDCALL __stdcall
130
+ # else
131
+ # define SWIGSTDCALL
132
+ # endif
133
+ #endif
134
+
135
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
136
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
137
+ # define _CRT_SECURE_NO_DEPRECATE
138
+ #endif
139
+
140
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
141
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
142
+ # define _SCL_SECURE_NO_DEPRECATE
143
+ #endif
144
+
145
+
146
+ /* -----------------------------------------------------------------------------
147
+ * This section contains generic SWIG labels for method/variable
148
+ * declarations/attributes, and other compiler dependent labels.
149
+ * ----------------------------------------------------------------------------- */
150
+
151
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
152
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
153
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
154
+ # define SWIGTEMPLATEDISAMBIGUATOR template
155
+ # elif defined(__HP_aCC)
156
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
157
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
158
+ # define SWIGTEMPLATEDISAMBIGUATOR template
159
+ # else
160
+ # define SWIGTEMPLATEDISAMBIGUATOR
161
+ # endif
162
+ #endif
163
+
164
+ /* inline attribute */
165
+ #ifndef SWIGINLINE
166
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
167
+ # define SWIGINLINE inline
168
+ # else
169
+ # define SWIGINLINE
170
+ # endif
171
+ #endif
172
+
173
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
174
+ #ifndef SWIGUNUSED
175
+ # if defined(__GNUC__)
176
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
177
+ # define SWIGUNUSED __attribute__ ((__unused__))
178
+ # else
179
+ # define SWIGUNUSED
180
+ # endif
181
+ # elif defined(__ICC)
182
+ # define SWIGUNUSED __attribute__ ((__unused__))
183
+ # else
184
+ # define SWIGUNUSED
185
+ # endif
186
+ #endif
187
+
188
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
189
+ # if defined(_MSC_VER)
190
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
191
+ # endif
192
+ #endif
193
+
194
+ #ifndef SWIGUNUSEDPARM
195
+ # ifdef __cplusplus
196
+ # define SWIGUNUSEDPARM(p)
197
+ # else
198
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
199
+ # endif
200
+ #endif
201
+
202
+ /* internal SWIG method */
203
+ #ifndef SWIGINTERN
204
+ # define SWIGINTERN static SWIGUNUSED
205
+ #endif
206
+
207
+ /* internal inline SWIG method */
208
+ #ifndef SWIGINTERNINLINE
209
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
210
+ #endif
211
+
212
+ /* exporting methods */
213
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
214
+ # ifndef GCC_HASCLASSVISIBILITY
215
+ # define GCC_HASCLASSVISIBILITY
216
+ # endif
217
+ #endif
218
+
219
+ #ifndef SWIGEXPORT
220
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
221
+ # if defined(STATIC_LINKED)
222
+ # define SWIGEXPORT
223
+ # else
224
+ # define SWIGEXPORT __declspec(dllexport)
225
+ # endif
226
+ # else
227
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
228
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
229
+ # else
230
+ # define SWIGEXPORT
231
+ # endif
232
+ # endif
233
+ #endif
234
+
235
+ /* calling conventions for Windows */
236
+ #ifndef SWIGSTDCALL
237
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
238
+ # define SWIGSTDCALL __stdcall
239
+ # else
240
+ # define SWIGSTDCALL
241
+ # endif
242
+ #endif
243
+
244
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
245
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
246
+ # define _CRT_SECURE_NO_DEPRECATE
247
+ #endif
248
+
249
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
250
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
251
+ # define _SCL_SECURE_NO_DEPRECATE
252
+ #endif
253
+
254
+
255
+ /* -----------------------------------------------------------------------------
256
+ * swigrun.swg
257
+ *
258
+ * This file contains generic C API SWIG runtime support for pointer
259
+ * type checking.
260
+ * ----------------------------------------------------------------------------- */
261
+
262
+ /* This should only be incremented when either the layout of swig_type_info changes,
263
+ or for whatever reason, the runtime changes incompatibly */
264
+ #define SWIG_RUNTIME_VERSION "4"
265
+
266
+ /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
267
+ #ifdef SWIG_TYPE_TABLE
268
+ # define SWIG_QUOTE_STRING(x) #x
269
+ # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
270
+ # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
271
+ #else
272
+ # define SWIG_TYPE_TABLE_NAME
273
+ #endif
274
+
275
+ /*
276
+ You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
277
+ creating a static or dynamic library from the SWIG runtime code.
278
+ In 99.9% of the cases, SWIG just needs to declare them as 'static'.
279
+
280
+ But only do this if strictly necessary, ie, if you have problems
281
+ with your compiler or suchlike.
282
+ */
283
+
284
+ #ifndef SWIGRUNTIME
285
+ # define SWIGRUNTIME SWIGINTERN
286
+ #endif
287
+
288
+ #ifndef SWIGRUNTIMEINLINE
289
+ # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
290
+ #endif
291
+
292
+ /* Generic buffer size */
293
+ #ifndef SWIG_BUFFER_SIZE
294
+ # define SWIG_BUFFER_SIZE 1024
295
+ #endif
296
+
297
+ /* Flags for pointer conversions */
298
+ #define SWIG_POINTER_DISOWN 0x1
299
+ #define SWIG_CAST_NEW_MEMORY 0x2
300
+
301
+ /* Flags for new pointer objects */
302
+ #define SWIG_POINTER_OWN 0x1
303
+
304
+
305
+ /*
306
+ Flags/methods for returning states.
307
+
308
+ The SWIG conversion methods, as ConvertPtr, return an integer
309
+ that tells if the conversion was successful or not. And if not,
310
+ an error code can be returned (see swigerrors.swg for the codes).
311
+
312
+ Use the following macros/flags to set or process the returning
313
+ states.
314
+
315
+ In old versions of SWIG, code such as the following was usually written:
316
+
317
+ if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
318
+ // success code
319
+ } else {
320
+ //fail code
321
+ }
322
+
323
+ Now you can be more explicit:
324
+
325
+ int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
326
+ if (SWIG_IsOK(res)) {
327
+ // success code
328
+ } else {
329
+ // fail code
330
+ }
331
+
332
+ which is the same really, but now you can also do
333
+
334
+ Type *ptr;
335
+ int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
336
+ if (SWIG_IsOK(res)) {
337
+ // success code
338
+ if (SWIG_IsNewObj(res) {
339
+ ...
340
+ delete *ptr;
341
+ } else {
342
+ ...
343
+ }
344
+ } else {
345
+ // fail code
346
+ }
347
+
348
+ I.e., now SWIG_ConvertPtr can return new objects and you can
349
+ identify the case and take care of the deallocation. Of course that
350
+ also requires SWIG_ConvertPtr to return new result values, such as
351
+
352
+ int SWIG_ConvertPtr(obj, ptr,...) {
353
+ if (<obj is ok>) {
354
+ if (<need new object>) {
355
+ *ptr = <ptr to new allocated object>;
356
+ return SWIG_NEWOBJ;
357
+ } else {
358
+ *ptr = <ptr to old object>;
359
+ return SWIG_OLDOBJ;
360
+ }
361
+ } else {
362
+ return SWIG_BADOBJ;
363
+ }
364
+ }
365
+
366
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
367
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
368
+ SWIG errors code.
369
+
370
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
371
+ allows to return the 'cast rank', for example, if you have this
372
+
373
+ int food(double)
374
+ int fooi(int);
375
+
376
+ and you call
377
+
378
+ food(1) // cast rank '1' (1 -> 1.0)
379
+ fooi(1) // cast rank '0'
380
+
381
+ just use the SWIG_AddCast()/SWIG_CheckState()
382
+ */
383
+
384
+ #define SWIG_OK (0)
385
+ #define SWIG_ERROR (-1)
386
+ #define SWIG_IsOK(r) (r >= 0)
387
+ #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
388
+
389
+ /* The CastRankLimit says how many bits are used for the cast rank */
390
+ #define SWIG_CASTRANKLIMIT (1 << 8)
391
+ /* The NewMask denotes the object was created (using new/malloc) */
392
+ #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
393
+ /* The TmpMask is for in/out typemaps that use temporal objects */
394
+ #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
395
+ /* Simple returning values */
396
+ #define SWIG_BADOBJ (SWIG_ERROR)
397
+ #define SWIG_OLDOBJ (SWIG_OK)
398
+ #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
399
+ #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
400
+ /* Check, add and del mask methods */
401
+ #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
402
+ #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
403
+ #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
404
+ #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
405
+ #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
406
+ #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
407
+
408
+ /* Cast-Rank Mode */
409
+ #if defined(SWIG_CASTRANK_MODE)
410
+ # ifndef SWIG_TypeRank
411
+ # define SWIG_TypeRank unsigned long
412
+ # endif
413
+ # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
414
+ # define SWIG_MAXCASTRANK (2)
415
+ # endif
416
+ # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
417
+ # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
418
+ SWIGINTERNINLINE int SWIG_AddCast(int r) {
419
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
420
+ }
421
+ SWIGINTERNINLINE int SWIG_CheckState(int r) {
422
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
423
+ }
424
+ #else /* no cast-rank mode */
425
+ # define SWIG_AddCast
426
+ # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
427
+ #endif
428
+
429
+
430
+ #include <string.h>
431
+
432
+ #ifdef __cplusplus
433
+ extern "C" {
434
+ #endif
435
+
436
+ typedef void *(*swig_converter_func)(void *, int *);
437
+ typedef struct swig_type_info *(*swig_dycast_func)(void **);
438
+
439
+ /* Structure to store information on one type */
440
+ typedef struct swig_type_info {
441
+ const char *name; /* mangled name of this type */
442
+ const char *str; /* human readable name of this type */
443
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
444
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
445
+ void *clientdata; /* language specific type data */
446
+ int owndata; /* flag if the structure owns the clientdata */
447
+ } swig_type_info;
448
+
449
+ /* Structure to store a type and conversion function used for casting */
450
+ typedef struct swig_cast_info {
451
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
452
+ swig_converter_func converter; /* function to cast the void pointers */
453
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
454
+ struct swig_cast_info *prev; /* pointer to the previous cast */
455
+ } swig_cast_info;
456
+
457
+ /* Structure used to store module information
458
+ * Each module generates one structure like this, and the runtime collects
459
+ * all of these structures and stores them in a circularly linked list.*/
460
+ typedef struct swig_module_info {
461
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
462
+ size_t size; /* Number of types in this module */
463
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
464
+ swig_type_info **type_initial; /* Array of initially generated type structures */
465
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
466
+ void *clientdata; /* Language specific module data */
467
+ } swig_module_info;
468
+
469
+ /*
470
+ Compare two type names skipping the space characters, therefore
471
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
472
+
473
+ Return 0 when the two name types are equivalent, as in
474
+ strncmp, but skipping ' '.
475
+ */
476
+ SWIGRUNTIME int
477
+ SWIG_TypeNameComp(const char *f1, const char *l1,
478
+ const char *f2, const char *l2) {
479
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
480
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
481
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
482
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
483
+ }
484
+ return (int)((l1 - f1) - (l2 - f2));
485
+ }
486
+
487
+ /*
488
+ Check type equivalence in a name list like <name1>|<name2>|...
489
+ Return 0 if not equal, 1 if equal
490
+ */
491
+ SWIGRUNTIME int
492
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
493
+ int equiv = 0;
494
+ const char* te = tb + strlen(tb);
495
+ const char* ne = nb;
496
+ while (!equiv && *ne) {
497
+ for (nb = ne; *ne; ++ne) {
498
+ if (*ne == '|') break;
499
+ }
500
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
501
+ if (*ne) ++ne;
502
+ }
503
+ return equiv;
504
+ }
505
+
506
+ /*
507
+ Check type equivalence in a name list like <name1>|<name2>|...
508
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
509
+ */
510
+ SWIGRUNTIME int
511
+ SWIG_TypeCompare(const char *nb, const char *tb) {
512
+ int equiv = 0;
513
+ const char* te = tb + strlen(tb);
514
+ const char* ne = nb;
515
+ while (!equiv && *ne) {
516
+ for (nb = ne; *ne; ++ne) {
517
+ if (*ne == '|') break;
518
+ }
519
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
520
+ if (*ne) ++ne;
521
+ }
522
+ return equiv;
523
+ }
524
+
525
+
526
+ /*
527
+ Check the typename
528
+ */
529
+ SWIGRUNTIME swig_cast_info *
530
+ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
531
+ if (ty) {
532
+ swig_cast_info *iter = ty->cast;
533
+ while (iter) {
534
+ if (strcmp(iter->type->name, c) == 0) {
535
+ if (iter == ty->cast)
536
+ return iter;
537
+ /* Move iter to the top of the linked list */
538
+ iter->prev->next = iter->next;
539
+ if (iter->next)
540
+ iter->next->prev = iter->prev;
541
+ iter->next = ty->cast;
542
+ iter->prev = 0;
543
+ if (ty->cast) ty->cast->prev = iter;
544
+ ty->cast = iter;
545
+ return iter;
546
+ }
547
+ iter = iter->next;
548
+ }
549
+ }
550
+ return 0;
551
+ }
552
+
553
+ /*
554
+ Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
555
+ */
556
+ SWIGRUNTIME swig_cast_info *
557
+ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
558
+ if (ty) {
559
+ swig_cast_info *iter = ty->cast;
560
+ while (iter) {
561
+ if (iter->type == from) {
562
+ if (iter == ty->cast)
563
+ return iter;
564
+ /* Move iter to the top of the linked list */
565
+ iter->prev->next = iter->next;
566
+ if (iter->next)
567
+ iter->next->prev = iter->prev;
568
+ iter->next = ty->cast;
569
+ iter->prev = 0;
570
+ if (ty->cast) ty->cast->prev = iter;
571
+ ty->cast = iter;
572
+ return iter;
573
+ }
574
+ iter = iter->next;
575
+ }
576
+ }
577
+ return 0;
578
+ }
579
+
580
+ /*
581
+ Cast a pointer up an inheritance hierarchy
582
+ */
583
+ SWIGRUNTIMEINLINE void *
584
+ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
585
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
586
+ }
587
+
588
+ /*
589
+ Dynamic pointer casting. Down an inheritance hierarchy
590
+ */
591
+ SWIGRUNTIME swig_type_info *
592
+ SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
593
+ swig_type_info *lastty = ty;
594
+ if (!ty || !ty->dcast) return ty;
595
+ while (ty && (ty->dcast)) {
596
+ ty = (*ty->dcast)(ptr);
597
+ if (ty) lastty = ty;
598
+ }
599
+ return lastty;
600
+ }
601
+
602
+ /*
603
+ Return the name associated with this type
604
+ */
605
+ SWIGRUNTIMEINLINE const char *
606
+ SWIG_TypeName(const swig_type_info *ty) {
607
+ return ty->name;
608
+ }
609
+
610
+ /*
611
+ Return the pretty name associated with this type,
612
+ that is an unmangled type name in a form presentable to the user.
613
+ */
614
+ SWIGRUNTIME const char *
615
+ SWIG_TypePrettyName(const swig_type_info *type) {
616
+ /* The "str" field contains the equivalent pretty names of the
617
+ type, separated by vertical-bar characters. We choose
618
+ to print the last name, as it is often (?) the most
619
+ specific. */
620
+ if (!type) return NULL;
621
+ if (type->str != NULL) {
622
+ const char *last_name = type->str;
623
+ const char *s;
624
+ for (s = type->str; *s; s++)
625
+ if (*s == '|') last_name = s+1;
626
+ return last_name;
627
+ }
628
+ else
629
+ return type->name;
630
+ }
631
+
632
+ /*
633
+ Set the clientdata field for a type
634
+ */
635
+ SWIGRUNTIME void
636
+ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
637
+ swig_cast_info *cast = ti->cast;
638
+ /* if (ti->clientdata == clientdata) return; */
639
+ ti->clientdata = clientdata;
640
+
641
+ while (cast) {
642
+ if (!cast->converter) {
643
+ swig_type_info *tc = cast->type;
644
+ if (!tc->clientdata) {
645
+ SWIG_TypeClientData(tc, clientdata);
646
+ }
647
+ }
648
+ cast = cast->next;
649
+ }
650
+ }
651
+ SWIGRUNTIME void
652
+ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
653
+ SWIG_TypeClientData(ti, clientdata);
654
+ ti->owndata = 1;
655
+ }
656
+
657
+ /*
658
+ Search for a swig_type_info structure only by mangled name
659
+ Search is a O(log #types)
660
+
661
+ We start searching at module start, and finish searching when start == end.
662
+ Note: if start == end at the beginning of the function, we go all the way around
663
+ the circular list.
664
+ */
665
+ SWIGRUNTIME swig_type_info *
666
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
667
+ swig_module_info *end,
668
+ const char *name) {
669
+ swig_module_info *iter = start;
670
+ do {
671
+ if (iter->size) {
672
+ register size_t l = 0;
673
+ register size_t r = iter->size - 1;
674
+ do {
675
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
676
+ register size_t i = (l + r) >> 1;
677
+ const char *iname = iter->types[i]->name;
678
+ if (iname) {
679
+ register int compare = strcmp(name, iname);
680
+ if (compare == 0) {
681
+ return iter->types[i];
682
+ } else if (compare < 0) {
683
+ if (i) {
684
+ r = i - 1;
685
+ } else {
686
+ break;
687
+ }
688
+ } else if (compare > 0) {
689
+ l = i + 1;
690
+ }
691
+ } else {
692
+ break; /* should never happen */
693
+ }
694
+ } while (l <= r);
695
+ }
696
+ iter = iter->next;
697
+ } while (iter != end);
698
+ return 0;
699
+ }
700
+
701
+ /*
702
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
703
+ It first searches the mangled names of the types, which is a O(log #types)
704
+ If a type is not found it then searches the human readable names, which is O(#types).
705
+
706
+ We start searching at module start, and finish searching when start == end.
707
+ Note: if start == end at the beginning of the function, we go all the way around
708
+ the circular list.
709
+ */
710
+ SWIGRUNTIME swig_type_info *
711
+ SWIG_TypeQueryModule(swig_module_info *start,
712
+ swig_module_info *end,
713
+ const char *name) {
714
+ /* STEP 1: Search the name field using binary search */
715
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
716
+ if (ret) {
717
+ return ret;
718
+ } else {
719
+ /* STEP 2: If the type hasn't been found, do a complete search
720
+ of the str field (the human readable name) */
721
+ swig_module_info *iter = start;
722
+ do {
723
+ register size_t i = 0;
724
+ for (; i < iter->size; ++i) {
725
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
726
+ return iter->types[i];
727
+ }
728
+ iter = iter->next;
729
+ } while (iter != end);
730
+ }
731
+
732
+ /* neither found a match */
733
+ return 0;
734
+ }
735
+
736
+ /*
737
+ Pack binary data into a string
738
+ */
739
+ SWIGRUNTIME char *
740
+ SWIG_PackData(char *c, void *ptr, size_t sz) {
741
+ static const char hex[17] = "0123456789abcdef";
742
+ register const unsigned char *u = (unsigned char *) ptr;
743
+ register const unsigned char *eu = u + sz;
744
+ for (; u != eu; ++u) {
745
+ register unsigned char uu = *u;
746
+ *(c++) = hex[(uu & 0xf0) >> 4];
747
+ *(c++) = hex[uu & 0xf];
748
+ }
749
+ return c;
750
+ }
751
+
752
+ /*
753
+ Unpack binary data from a string
754
+ */
755
+ SWIGRUNTIME const char *
756
+ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
757
+ register unsigned char *u = (unsigned char *) ptr;
758
+ register const unsigned char *eu = u + sz;
759
+ for (; u != eu; ++u) {
760
+ register char d = *(c++);
761
+ register unsigned char uu;
762
+ if ((d >= '0') && (d <= '9'))
763
+ uu = ((d - '0') << 4);
764
+ else if ((d >= 'a') && (d <= 'f'))
765
+ uu = ((d - ('a'-10)) << 4);
766
+ else
767
+ return (char *) 0;
768
+ d = *(c++);
769
+ if ((d >= '0') && (d <= '9'))
770
+ uu |= (d - '0');
771
+ else if ((d >= 'a') && (d <= 'f'))
772
+ uu |= (d - ('a'-10));
773
+ else
774
+ return (char *) 0;
775
+ *u = uu;
776
+ }
777
+ return c;
778
+ }
779
+
780
+ /*
781
+ Pack 'void *' into a string buffer.
782
+ */
783
+ SWIGRUNTIME char *
784
+ SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
785
+ char *r = buff;
786
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
787
+ *(r++) = '_';
788
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
789
+ if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
790
+ strcpy(r,name);
791
+ return buff;
792
+ }
793
+
794
+ SWIGRUNTIME const char *
795
+ SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
796
+ if (*c != '_') {
797
+ if (strcmp(c,"NULL") == 0) {
798
+ *ptr = (void *) 0;
799
+ return name;
800
+ } else {
801
+ return 0;
802
+ }
803
+ }
804
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
805
+ }
806
+
807
+ SWIGRUNTIME char *
808
+ SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
809
+ char *r = buff;
810
+ size_t lname = (name ? strlen(name) : 0);
811
+ if ((2*sz + 2 + lname) > bsz) return 0;
812
+ *(r++) = '_';
813
+ r = SWIG_PackData(r,ptr,sz);
814
+ if (lname) {
815
+ strncpy(r,name,lname+1);
816
+ } else {
817
+ *r = 0;
818
+ }
819
+ return buff;
820
+ }
821
+
822
+ SWIGRUNTIME const char *
823
+ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
824
+ if (*c != '_') {
825
+ if (strcmp(c,"NULL") == 0) {
826
+ memset(ptr,0,sz);
827
+ return name;
828
+ } else {
829
+ return 0;
830
+ }
831
+ }
832
+ return SWIG_UnpackData(++c,ptr,sz);
833
+ }
834
+
835
+ #ifdef __cplusplus
836
+ }
837
+ #endif
838
+
839
+ /* Errors in SWIG */
840
+ #define SWIG_UnknownError -1
841
+ #define SWIG_IOError -2
842
+ #define SWIG_RuntimeError -3
843
+ #define SWIG_IndexError -4
844
+ #define SWIG_TypeError -5
845
+ #define SWIG_DivisionByZero -6
846
+ #define SWIG_OverflowError -7
847
+ #define SWIG_SyntaxError -8
848
+ #define SWIG_ValueError -9
849
+ #define SWIG_SystemError -10
850
+ #define SWIG_AttributeError -11
851
+ #define SWIG_MemoryError -12
852
+ #define SWIG_NullReferenceError -13
853
+
854
+
855
+
856
+ #include <ruby.h>
857
+
858
+ /* Ruby 1.9.1 has a "memoisation optimisation" when compiling with GCC which
859
+ * breaks using rb_intern as an lvalue, as SWIG does. We work around this
860
+ * issue for now by disabling this.
861
+ * https://sourceforge.net/tracker/?func=detail&aid=2859614&group_id=1645&atid=101645
862
+ */
863
+ #ifdef rb_intern
864
+ # undef rb_intern
865
+ #endif
866
+
867
+ /* Remove global macros defined in Ruby's win32.h */
868
+ #ifdef write
869
+ # undef write
870
+ #endif
871
+ #ifdef read
872
+ # undef read
873
+ #endif
874
+ #ifdef bind
875
+ # undef bind
876
+ #endif
877
+ #ifdef close
878
+ # undef close
879
+ #endif
880
+ #ifdef connect
881
+ # undef connect
882
+ #endif
883
+
884
+
885
+ /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
886
+ #ifndef NUM2LL
887
+ #define NUM2LL(x) NUM2LONG((x))
888
+ #endif
889
+ #ifndef LL2NUM
890
+ #define LL2NUM(x) INT2NUM((long) (x))
891
+ #endif
892
+ #ifndef ULL2NUM
893
+ #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
894
+ #endif
895
+
896
+ /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
897
+ #ifndef NUM2ULL
898
+ #ifdef HAVE_LONG_LONG
899
+ #define NUM2ULL(x) rb_num2ull((x))
900
+ #else
901
+ #define NUM2ULL(x) NUM2ULONG(x)
902
+ #endif
903
+ #endif
904
+
905
+ /* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
906
+ /* Define these for older versions so we can just write code the new way */
907
+ #ifndef RSTRING_LEN
908
+ # define RSTRING_LEN(x) RSTRING(x)->len
909
+ #endif
910
+ #ifndef RSTRING_PTR
911
+ # define RSTRING_PTR(x) RSTRING(x)->ptr
912
+ #endif
913
+ #ifndef RSTRING_END
914
+ # define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x))
915
+ #endif
916
+ #ifndef RARRAY_LEN
917
+ # define RARRAY_LEN(x) RARRAY(x)->len
918
+ #endif
919
+ #ifndef RARRAY_PTR
920
+ # define RARRAY_PTR(x) RARRAY(x)->ptr
921
+ #endif
922
+ #ifndef RFLOAT_VALUE
923
+ # define RFLOAT_VALUE(x) RFLOAT(x)->value
924
+ #endif
925
+ #ifndef DOUBLE2NUM
926
+ # define DOUBLE2NUM(x) rb_float_new(x)
927
+ #endif
928
+ #ifndef RHASH_TBL
929
+ # define RHASH_TBL(x) (RHASH(x)->tbl)
930
+ #endif
931
+ #ifndef RHASH_ITER_LEV
932
+ # define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev)
933
+ #endif
934
+ #ifndef RHASH_IFNONE
935
+ # define RHASH_IFNONE(x) (RHASH(x)->ifnone)
936
+ #endif
937
+ #ifndef RHASH_SIZE
938
+ # define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries)
939
+ #endif
940
+ #ifndef RHASH_EMPTY_P
941
+ # define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0)
942
+ #endif
943
+ #ifndef RSTRUCT_LEN
944
+ # define RSTRUCT_LEN(x) RSTRUCT(x)->len
945
+ #endif
946
+ #ifndef RSTRUCT_PTR
947
+ # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
948
+ #endif
949
+
950
+
951
+
952
+ /*
953
+ * Need to be very careful about how these macros are defined, especially
954
+ * when compiling C++ code or C code with an ANSI C compiler.
955
+ *
956
+ * VALUEFUNC(f) is a macro used to typecast a C function that implements
957
+ * a Ruby method so that it can be passed as an argument to API functions
958
+ * like rb_define_method() and rb_define_singleton_method().
959
+ *
960
+ * VOIDFUNC(f) is a macro used to typecast a C function that implements
961
+ * either the "mark" or "free" stuff for a Ruby Data object, so that it
962
+ * can be passed as an argument to API functions like Data_Wrap_Struct()
963
+ * and Data_Make_Struct().
964
+ */
965
+
966
+ #ifdef __cplusplus
967
+ # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
968
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
969
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
970
+ # define VOIDFUNC(f) ((void (*)()) f)
971
+ # else
972
+ # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
973
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
974
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
975
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
976
+ # else /* These definitions should work for Ruby 1.7+ */
977
+ # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
978
+ # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
979
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
980
+ # endif
981
+ # endif
982
+ #else
983
+ # define VALUEFUNC(f) (f)
984
+ # define VOIDFUNC(f) (f)
985
+ #endif
986
+
987
+ /* Don't use for expressions have side effect */
988
+ #ifndef RB_STRING_VALUE
989
+ #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
990
+ #endif
991
+ #ifndef StringValue
992
+ #define StringValue(s) RB_STRING_VALUE(s)
993
+ #endif
994
+ #ifndef StringValuePtr
995
+ #define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s))
996
+ #endif
997
+ #ifndef StringValueLen
998
+ #define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
999
+ #endif
1000
+ #ifndef SafeStringValue
1001
+ #define SafeStringValue(v) do {\
1002
+ StringValue(v);\
1003
+ rb_check_safe_str(v);\
1004
+ } while (0)
1005
+ #endif
1006
+
1007
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
1008
+ #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
1009
+ #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
1010
+ #endif
1011
+
1012
+ static VALUE _mSWIG = Qnil;
1013
+
1014
+ /* -----------------------------------------------------------------------------
1015
+ * error manipulation
1016
+ * ----------------------------------------------------------------------------- */
1017
+
1018
+
1019
+ /* Define some additional error types */
1020
+ #define SWIG_ObjectPreviouslyDeletedError -100
1021
+
1022
+
1023
+ /* Define custom exceptions for errors that do not map to existing Ruby
1024
+ exceptions. Note this only works for C++ since a global cannot be
1025
+ initialized by a function in C. For C, fallback to rb_eRuntimeError.*/
1026
+
1027
+ SWIGINTERN VALUE
1028
+ getNullReferenceError(void) {
1029
+ static int init = 0;
1030
+ static VALUE rb_eNullReferenceError ;
1031
+ if (!init) {
1032
+ init = 1;
1033
+ rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
1034
+ }
1035
+ return rb_eNullReferenceError;
1036
+ }
1037
+
1038
+ SWIGINTERN VALUE
1039
+ getObjectPreviouslyDeletedError(void) {
1040
+ static int init = 0;
1041
+ static VALUE rb_eObjectPreviouslyDeleted ;
1042
+ if (!init) {
1043
+ init = 1;
1044
+ rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
1045
+ }
1046
+ return rb_eObjectPreviouslyDeleted;
1047
+ }
1048
+
1049
+
1050
+ SWIGINTERN VALUE
1051
+ SWIG_Ruby_ErrorType(int SWIG_code) {
1052
+ VALUE type;
1053
+ switch (SWIG_code) {
1054
+ case SWIG_MemoryError:
1055
+ type = rb_eNoMemError;
1056
+ break;
1057
+ case SWIG_IOError:
1058
+ type = rb_eIOError;
1059
+ break;
1060
+ case SWIG_RuntimeError:
1061
+ type = rb_eRuntimeError;
1062
+ break;
1063
+ case SWIG_IndexError:
1064
+ type = rb_eIndexError;
1065
+ break;
1066
+ case SWIG_TypeError:
1067
+ type = rb_eTypeError;
1068
+ break;
1069
+ case SWIG_DivisionByZero:
1070
+ type = rb_eZeroDivError;
1071
+ break;
1072
+ case SWIG_OverflowError:
1073
+ type = rb_eRangeError;
1074
+ break;
1075
+ case SWIG_SyntaxError:
1076
+ type = rb_eSyntaxError;
1077
+ break;
1078
+ case SWIG_ValueError:
1079
+ type = rb_eArgError;
1080
+ break;
1081
+ case SWIG_SystemError:
1082
+ type = rb_eFatal;
1083
+ break;
1084
+ case SWIG_AttributeError:
1085
+ type = rb_eRuntimeError;
1086
+ break;
1087
+ case SWIG_NullReferenceError:
1088
+ type = getNullReferenceError();
1089
+ break;
1090
+ case SWIG_ObjectPreviouslyDeletedError:
1091
+ type = getObjectPreviouslyDeletedError();
1092
+ break;
1093
+ case SWIG_UnknownError:
1094
+ type = rb_eRuntimeError;
1095
+ break;
1096
+ default:
1097
+ type = rb_eRuntimeError;
1098
+ }
1099
+ return type;
1100
+ }
1101
+
1102
+
1103
+ /* This function is called when a user inputs a wrong argument to
1104
+ a method.
1105
+ */
1106
+ SWIGINTERN
1107
+ const char* Ruby_Format_TypeError( const char* msg,
1108
+ const char* type,
1109
+ const char* name,
1110
+ const int argn,
1111
+ VALUE input )
1112
+ {
1113
+ char buf[128];
1114
+ VALUE str;
1115
+ VALUE asStr;
1116
+ if ( msg && *msg )
1117
+ {
1118
+ str = rb_str_new2(msg);
1119
+ }
1120
+ else
1121
+ {
1122
+ str = rb_str_new(NULL, 0);
1123
+ }
1124
+
1125
+ str = rb_str_cat2( str, "Expected argument " );
1126
+ sprintf( buf, "%d of type ", argn-1 );
1127
+ str = rb_str_cat2( str, buf );
1128
+ str = rb_str_cat2( str, type );
1129
+ str = rb_str_cat2( str, ", but got " );
1130
+ str = rb_str_cat2( str, rb_obj_classname(input) );
1131
+ str = rb_str_cat2( str, " " );
1132
+ asStr = rb_inspect(input);
1133
+ if ( RSTRING_LEN(asStr) > 30 )
1134
+ {
1135
+ str = rb_str_cat( str, StringValuePtr(asStr), 30 );
1136
+ str = rb_str_cat2( str, "..." );
1137
+ }
1138
+ else
1139
+ {
1140
+ str = rb_str_append( str, asStr );
1141
+ }
1142
+
1143
+ if ( name )
1144
+ {
1145
+ str = rb_str_cat2( str, "\n\tin SWIG method '" );
1146
+ str = rb_str_cat2( str, name );
1147
+ str = rb_str_cat2( str, "'" );
1148
+ }
1149
+
1150
+ return StringValuePtr( str );
1151
+ }
1152
+
1153
+ /* This function is called when an overloaded method fails */
1154
+ SWIGINTERN
1155
+ void Ruby_Format_OverloadedError(
1156
+ const int argc,
1157
+ const int maxargs,
1158
+ const char* method,
1159
+ const char* prototypes
1160
+ )
1161
+ {
1162
+ const char* msg = "Wrong # of arguments";
1163
+ if ( argc <= maxargs ) msg = "Wrong arguments";
1164
+ rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
1165
+ "Possible C/C++ prototypes are:\n%s",
1166
+ msg, method, prototypes);
1167
+ }
1168
+
1169
+ /* -----------------------------------------------------------------------------
1170
+ * rubytracking.swg
1171
+ *
1172
+ * This file contains support for tracking mappings from
1173
+ * Ruby objects to C++ objects. This functionality is needed
1174
+ * to implement mark functions for Ruby's mark and sweep
1175
+ * garbage collector.
1176
+ * ----------------------------------------------------------------------------- */
1177
+
1178
+ #ifdef __cplusplus
1179
+ extern "C" {
1180
+ #endif
1181
+
1182
+ /* Ruby 1.8 actually assumes the first case. */
1183
+ #if SIZEOF_VOIDP == SIZEOF_LONG
1184
+ # define SWIG2NUM(v) LONG2NUM((unsigned long)v)
1185
+ # define NUM2SWIG(x) (unsigned long)NUM2LONG(x)
1186
+ #elif SIZEOF_VOIDP == SIZEOF_LONG_LONG
1187
+ # define SWIG2NUM(v) LL2NUM((unsigned long long)v)
1188
+ # define NUM2SWIG(x) (unsigned long long)NUM2LL(x)
1189
+ #else
1190
+ # error sizeof(void*) is not the same as long or long long
1191
+ #endif
1192
+
1193
+
1194
+ /* Global Ruby hash table to store Trackings from C/C++
1195
+ structs to Ruby Objects.
1196
+ */
1197
+ static VALUE swig_ruby_trackings = Qnil;
1198
+
1199
+ /* Global variable that stores a reference to the ruby
1200
+ hash table delete function. */
1201
+ static ID swig_ruby_hash_delete;
1202
+
1203
+ /* Setup a Ruby hash table to store Trackings */
1204
+ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1205
+ /* Create a ruby hash table to store Trackings from C++
1206
+ objects to Ruby objects. */
1207
+
1208
+ /* Try to see if some other .so has already created a
1209
+ tracking hash table, which we keep hidden in an instance var
1210
+ in the SWIG module.
1211
+ This is done to allow multiple DSOs to share the same
1212
+ tracking table.
1213
+ */
1214
+ ID trackings_id = rb_intern( "@__trackings__" );
1215
+ VALUE verbose = rb_gv_get("VERBOSE");
1216
+ rb_gv_set("VERBOSE", Qfalse);
1217
+ swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
1218
+ rb_gv_set("VERBOSE", verbose);
1219
+
1220
+ /* No, it hasn't. Create one ourselves */
1221
+ if ( swig_ruby_trackings == Qnil )
1222
+ {
1223
+ swig_ruby_trackings = rb_hash_new();
1224
+ rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
1225
+ }
1226
+
1227
+ /* Now store a reference to the hash table delete function
1228
+ so that we only have to look it up once.*/
1229
+ swig_ruby_hash_delete = rb_intern("delete");
1230
+ }
1231
+
1232
+ /* Get a Ruby number to reference a pointer */
1233
+ SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1234
+ /* We cast the pointer to an unsigned long
1235
+ and then store a reference to it using
1236
+ a Ruby number object. */
1237
+
1238
+ /* Convert the pointer to a Ruby number */
1239
+ return SWIG2NUM(ptr);
1240
+ }
1241
+
1242
+ /* Get a Ruby number to reference an object */
1243
+ SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1244
+ /* We cast the object to an unsigned long
1245
+ and then store a reference to it using
1246
+ a Ruby number object. */
1247
+
1248
+ /* Convert the Object to a Ruby number */
1249
+ return SWIG2NUM(object);
1250
+ }
1251
+
1252
+ /* Get a Ruby object from a previously stored reference */
1253
+ SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1254
+ /* The provided Ruby number object is a reference
1255
+ to the Ruby object we want.*/
1256
+
1257
+ /* Convert the Ruby number to a Ruby object */
1258
+ return NUM2SWIG(reference);
1259
+ }
1260
+
1261
+ /* Add a Tracking from a C/C++ struct to a Ruby object */
1262
+ SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
1263
+ /* In a Ruby hash table we store the pointer and
1264
+ the associated Ruby object. The trick here is
1265
+ that we cannot store the Ruby object directly - if
1266
+ we do then it cannot be garbage collected. So
1267
+ instead we typecast it as a unsigned long and
1268
+ convert it to a Ruby number object.*/
1269
+
1270
+ /* Get a reference to the pointer as a Ruby number */
1271
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1272
+
1273
+ /* Get a reference to the Ruby object as a Ruby number */
1274
+ VALUE value = SWIG_RubyObjectToReference(object);
1275
+
1276
+ /* Store the mapping to the global hash table. */
1277
+ rb_hash_aset(swig_ruby_trackings, key, value);
1278
+ }
1279
+
1280
+ /* Get the Ruby object that owns the specified C/C++ struct */
1281
+ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1282
+ /* Get a reference to the pointer as a Ruby number */
1283
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1284
+
1285
+ /* Now lookup the value stored in the global hash table */
1286
+ VALUE value = rb_hash_aref(swig_ruby_trackings, key);
1287
+
1288
+ if (value == Qnil) {
1289
+ /* No object exists - return nil. */
1290
+ return Qnil;
1291
+ }
1292
+ else {
1293
+ /* Convert this value to Ruby object */
1294
+ return SWIG_RubyReferenceToObject(value);
1295
+ }
1296
+ }
1297
+
1298
+ /* Remove a Tracking from a C/C++ struct to a Ruby object. It
1299
+ is very important to remove objects once they are destroyed
1300
+ since the same memory address may be reused later to create
1301
+ a new object. */
1302
+ SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
1303
+ /* Get a reference to the pointer as a Ruby number */
1304
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1305
+
1306
+ /* Delete the object from the hash table by calling Ruby's
1307
+ do this we need to call the Hash.delete method.*/
1308
+ rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
1309
+ }
1310
+
1311
+ /* This is a helper method that unlinks a Ruby object from its
1312
+ underlying C++ object. This is needed if the lifetime of the
1313
+ Ruby object is longer than the C++ object */
1314
+ SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
1315
+ VALUE object = SWIG_RubyInstanceFor(ptr);
1316
+
1317
+ if (object != Qnil) {
1318
+ DATA_PTR(object) = 0;
1319
+ }
1320
+ }
1321
+
1322
+
1323
+ #ifdef __cplusplus
1324
+ }
1325
+ #endif
1326
+
1327
+ /* -----------------------------------------------------------------------------
1328
+ * Ruby API portion that goes into the runtime
1329
+ * ----------------------------------------------------------------------------- */
1330
+
1331
+ #ifdef __cplusplus
1332
+ extern "C" {
1333
+ #endif
1334
+
1335
+ SWIGINTERN VALUE
1336
+ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1337
+ if (NIL_P(target)) {
1338
+ target = o;
1339
+ } else {
1340
+ if (TYPE(target) != T_ARRAY) {
1341
+ VALUE o2 = target;
1342
+ target = rb_ary_new();
1343
+ rb_ary_push(target, o2);
1344
+ }
1345
+ rb_ary_push(target, o);
1346
+ }
1347
+ return target;
1348
+ }
1349
+
1350
+ /* For ruby1.8.4 and earlier. */
1351
+ #ifndef RUBY_INIT_STACK
1352
+ RUBY_EXTERN void Init_stack(VALUE* addr);
1353
+ # define RUBY_INIT_STACK \
1354
+ VALUE variable_in_this_stack_frame; \
1355
+ Init_stack(&variable_in_this_stack_frame);
1356
+ #endif
1357
+
1358
+
1359
+ #ifdef __cplusplus
1360
+ }
1361
+ #endif
1362
+
1363
+
1364
+ /* -----------------------------------------------------------------------------
1365
+ * rubyrun.swg
1366
+ *
1367
+ * This file contains the runtime support for Ruby modules
1368
+ * and includes code for managing global variables and pointer
1369
+ * type checking.
1370
+ * ----------------------------------------------------------------------------- */
1371
+
1372
+ /* For backward compatibility only */
1373
+ #define SWIG_POINTER_EXCEPTION 0
1374
+
1375
+ /* for raw pointers */
1376
+ #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1377
+ #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1378
+ #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
1379
+ #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
1380
+ #define swig_owntype ruby_owntype
1381
+
1382
+ /* for raw packed data */
1383
+ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
1384
+ #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1385
+
1386
+ /* for class or struct pointers */
1387
+ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1388
+ #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1389
+
1390
+ /* for C or C++ function pointers */
1391
+ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
1392
+ #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
1393
+
1394
+ /* for C++ member pointers, ie, member methods */
1395
+ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
1396
+ #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1397
+
1398
+
1399
+ /* Runtime API */
1400
+
1401
+ #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule()
1402
+ #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
1403
+
1404
+
1405
+ /* Error manipulation */
1406
+
1407
+ #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
1408
+ #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg)
1409
+ #define SWIG_fail goto fail
1410
+
1411
+
1412
+ /* Ruby-specific SWIG API */
1413
+
1414
+ #define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
1415
+ #define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
1416
+ #define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
1417
+ #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
1418
+ #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
1419
+
1420
+ #include "assert.h"
1421
+
1422
+ /* -----------------------------------------------------------------------------
1423
+ * pointers/data manipulation
1424
+ * ----------------------------------------------------------------------------- */
1425
+
1426
+ #ifdef __cplusplus
1427
+ extern "C" {
1428
+ #endif
1429
+
1430
+ typedef struct {
1431
+ VALUE klass;
1432
+ VALUE mImpl;
1433
+ void (*mark)(void *);
1434
+ void (*destroy)(void *);
1435
+ int trackObjects;
1436
+ } swig_class;
1437
+
1438
+
1439
+ /* Global pointer used to keep some internal SWIG stuff */
1440
+ static VALUE _cSWIG_Pointer = Qnil;
1441
+ static VALUE swig_runtime_data_type_pointer = Qnil;
1442
+
1443
+ /* Global IDs used to keep some internal SWIG stuff */
1444
+ static ID swig_arity_id = 0;
1445
+ static ID swig_call_id = 0;
1446
+
1447
+ /*
1448
+ If your swig extension is to be run within an embedded ruby and has
1449
+ director callbacks, you should set -DRUBY_EMBEDDED during compilation.
1450
+ This will reset ruby's stack frame on each entry point from the main
1451
+ program the first time a virtual director function is invoked (in a
1452
+ non-recursive way).
1453
+ If this is not done, you run the risk of Ruby trashing the stack.
1454
+ */
1455
+
1456
+ #ifdef RUBY_EMBEDDED
1457
+
1458
+ # define SWIG_INIT_STACK \
1459
+ if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
1460
+ ++swig_virtual_calls;
1461
+ # define SWIG_RELEASE_STACK --swig_virtual_calls;
1462
+ # define Ruby_DirectorTypeMismatchException(x) \
1463
+ rb_raise( rb_eTypeError, "%s", x ); return c_result;
1464
+
1465
+ static unsigned int swig_virtual_calls = 0;
1466
+
1467
+ #else /* normal non-embedded extension */
1468
+
1469
+ # define SWIG_INIT_STACK
1470
+ # define SWIG_RELEASE_STACK
1471
+ # define Ruby_DirectorTypeMismatchException(x) \
1472
+ throw Swig::DirectorTypeMismatchException( x );
1473
+
1474
+ #endif /* RUBY_EMBEDDED */
1475
+
1476
+
1477
+ SWIGRUNTIME VALUE
1478
+ getExceptionClass(void) {
1479
+ static int init = 0;
1480
+ static VALUE rubyExceptionClass ;
1481
+ if (!init) {
1482
+ init = 1;
1483
+ rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
1484
+ }
1485
+ return rubyExceptionClass;
1486
+ }
1487
+
1488
+ /* This code checks to see if the Ruby object being raised as part
1489
+ of an exception inherits from the Ruby class Exception. If so,
1490
+ the object is simply returned. If not, then a new Ruby exception
1491
+ object is created and that will be returned to Ruby.*/
1492
+ SWIGRUNTIME VALUE
1493
+ SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
1494
+ VALUE exceptionClass = getExceptionClass();
1495
+ if (rb_obj_is_kind_of(obj, exceptionClass)) {
1496
+ return obj;
1497
+ } else {
1498
+ return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
1499
+ }
1500
+ }
1501
+
1502
+ /* Initialize Ruby runtime support */
1503
+ SWIGRUNTIME void
1504
+ SWIG_Ruby_InitRuntime(void)
1505
+ {
1506
+ if (_mSWIG == Qnil) {
1507
+ _mSWIG = rb_define_module("SWIG");
1508
+ swig_call_id = rb_intern("call");
1509
+ swig_arity_id = rb_intern("arity");
1510
+ }
1511
+ }
1512
+
1513
+ /* Define Ruby class for C type */
1514
+ SWIGRUNTIME void
1515
+ SWIG_Ruby_define_class(swig_type_info *type)
1516
+ {
1517
+ VALUE klass;
1518
+ char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1519
+ sprintf(klass_name, "TYPE%s", type->name);
1520
+ if (NIL_P(_cSWIG_Pointer)) {
1521
+ _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
1522
+ rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
1523
+ }
1524
+ klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1525
+ free((void *) klass_name);
1526
+ }
1527
+
1528
+ /* Create a new pointer object */
1529
+ SWIGRUNTIME VALUE
1530
+ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1531
+ {
1532
+ int own = flags & SWIG_POINTER_OWN;
1533
+ int track;
1534
+ char *klass_name;
1535
+ swig_class *sklass;
1536
+ VALUE klass;
1537
+ VALUE obj;
1538
+
1539
+ if (!ptr)
1540
+ return Qnil;
1541
+
1542
+ if (type->clientdata) {
1543
+ sklass = (swig_class *) type->clientdata;
1544
+
1545
+ /* Are we tracking this class and have we already returned this Ruby object? */
1546
+ track = sklass->trackObjects;
1547
+ if (track) {
1548
+ obj = SWIG_RubyInstanceFor(ptr);
1549
+
1550
+ /* Check the object's type and make sure it has the correct type.
1551
+ It might not in cases where methods do things like
1552
+ downcast methods. */
1553
+ if (obj != Qnil) {
1554
+ VALUE value = rb_iv_get(obj, "@__swigtype__");
1555
+ char* type_name = RSTRING_PTR(value);
1556
+
1557
+ if (strcmp(type->name, type_name) == 0) {
1558
+ return obj;
1559
+ }
1560
+ }
1561
+ }
1562
+
1563
+ /* Create a new Ruby object */
1564
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark),
1565
+ ( own ? VOIDFUNC(sklass->destroy) :
1566
+ (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
1567
+ ), ptr);
1568
+
1569
+ /* If tracking is on for this class then track this object. */
1570
+ if (track) {
1571
+ SWIG_RubyAddTracking(ptr, obj);
1572
+ }
1573
+ } else {
1574
+ klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1575
+ sprintf(klass_name, "TYPE%s", type->name);
1576
+ klass = rb_const_get(_mSWIG, rb_intern(klass_name));
1577
+ free((void *) klass_name);
1578
+ obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1579
+ }
1580
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1581
+
1582
+ return obj;
1583
+ }
1584
+
1585
+ /* Create a new class instance (always owned) */
1586
+ SWIGRUNTIME VALUE
1587
+ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1588
+ {
1589
+ VALUE obj;
1590
+ swig_class *sklass = (swig_class *) type->clientdata;
1591
+ obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
1592
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1593
+ return obj;
1594
+ }
1595
+
1596
+ /* Get type mangle from class name */
1597
+ SWIGRUNTIMEINLINE char *
1598
+ SWIG_Ruby_MangleStr(VALUE obj)
1599
+ {
1600
+ VALUE stype = rb_iv_get(obj, "@__swigtype__");
1601
+ return StringValuePtr(stype);
1602
+ }
1603
+
1604
+ /* Acquire a pointer value */
1605
+ typedef void (*ruby_owntype)(void*);
1606
+
1607
+ SWIGRUNTIME ruby_owntype
1608
+ SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
1609
+ if (obj) {
1610
+ ruby_owntype oldown = RDATA(obj)->dfree;
1611
+ RDATA(obj)->dfree = own;
1612
+ return oldown;
1613
+ } else {
1614
+ return 0;
1615
+ }
1616
+ }
1617
+
1618
+ /* Convert a pointer value */
1619
+ SWIGRUNTIME int
1620
+ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
1621
+ {
1622
+ char *c;
1623
+ swig_cast_info *tc;
1624
+ void *vptr = 0;
1625
+
1626
+ /* Grab the pointer */
1627
+ if (NIL_P(obj)) {
1628
+ *ptr = 0;
1629
+ return SWIG_OK;
1630
+ } else {
1631
+ if (TYPE(obj) != T_DATA) {
1632
+ return SWIG_ERROR;
1633
+ }
1634
+ Data_Get_Struct(obj, void, vptr);
1635
+ }
1636
+
1637
+ if (own) *own = RDATA(obj)->dfree;
1638
+
1639
+ /* Check to see if the input object is giving up ownership
1640
+ of the underlying C struct or C++ object. If so then we
1641
+ need to reset the destructor since the Ruby object no
1642
+ longer owns the underlying C++ object.*/
1643
+ if (flags & SWIG_POINTER_DISOWN) {
1644
+ /* Is tracking on for this class? */
1645
+ int track = 0;
1646
+ if (ty && ty->clientdata) {
1647
+ swig_class *sklass = (swig_class *) ty->clientdata;
1648
+ track = sklass->trackObjects;
1649
+ }
1650
+
1651
+ if (track) {
1652
+ /* We are tracking objects for this class. Thus we change the destructor
1653
+ * to SWIG_RubyRemoveTracking. This allows us to
1654
+ * remove the mapping from the C++ to Ruby object
1655
+ * when the Ruby object is garbage collected. If we don't
1656
+ * do this, then it is possible we will return a reference
1657
+ * to a Ruby object that no longer exists thereby crashing Ruby. */
1658
+ RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
1659
+ } else {
1660
+ RDATA(obj)->dfree = 0;
1661
+ }
1662
+ }
1663
+
1664
+ /* Do type-checking if type info was provided */
1665
+ if (ty) {
1666
+ if (ty->clientdata) {
1667
+ if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
1668
+ if (vptr == 0) {
1669
+ /* The object has already been deleted */
1670
+ return SWIG_ObjectPreviouslyDeletedError;
1671
+ }
1672
+ *ptr = vptr;
1673
+ return SWIG_OK;
1674
+ }
1675
+ }
1676
+ if ((c = SWIG_MangleStr(obj)) == NULL) {
1677
+ return SWIG_ERROR;
1678
+ }
1679
+ tc = SWIG_TypeCheck(c, ty);
1680
+ if (!tc) {
1681
+ return SWIG_ERROR;
1682
+ } else {
1683
+ int newmemory = 0;
1684
+ *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
1685
+ assert(!newmemory); /* newmemory handling not yet implemented */
1686
+ }
1687
+ } else {
1688
+ *ptr = vptr;
1689
+ }
1690
+
1691
+ return SWIG_OK;
1692
+ }
1693
+
1694
+ /* Check convert */
1695
+ SWIGRUNTIMEINLINE int
1696
+ SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
1697
+ {
1698
+ char *c = SWIG_MangleStr(obj);
1699
+ if (!c) return 0;
1700
+ return SWIG_TypeCheck(c,ty) != 0;
1701
+ }
1702
+
1703
+ SWIGRUNTIME VALUE
1704
+ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
1705
+ char result[1024];
1706
+ char *r = result;
1707
+ if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
1708
+ *(r++) = '_';
1709
+ r = SWIG_PackData(r, ptr, sz);
1710
+ strcpy(r, type->name);
1711
+ return rb_str_new2(result);
1712
+ }
1713
+
1714
+ /* Convert a packed value value */
1715
+ SWIGRUNTIME int
1716
+ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
1717
+ swig_cast_info *tc;
1718
+ const char *c;
1719
+
1720
+ if (TYPE(obj) != T_STRING) goto type_error;
1721
+ c = StringValuePtr(obj);
1722
+ /* Pointer values must start with leading underscore */
1723
+ if (*c != '_') goto type_error;
1724
+ c++;
1725
+ c = SWIG_UnpackData(c, ptr, sz);
1726
+ if (ty) {
1727
+ tc = SWIG_TypeCheck(c, ty);
1728
+ if (!tc) goto type_error;
1729
+ }
1730
+ return SWIG_OK;
1731
+
1732
+ type_error:
1733
+ return SWIG_ERROR;
1734
+ }
1735
+
1736
+ SWIGRUNTIME swig_module_info *
1737
+ SWIG_Ruby_GetModule(void)
1738
+ {
1739
+ VALUE pointer;
1740
+ swig_module_info *ret = 0;
1741
+ VALUE verbose = rb_gv_get("VERBOSE");
1742
+
1743
+ /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
1744
+ rb_gv_set("VERBOSE", Qfalse);
1745
+
1746
+ /* first check if pointer already created */
1747
+ pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
1748
+ if (pointer != Qnil) {
1749
+ Data_Get_Struct(pointer, swig_module_info, ret);
1750
+ }
1751
+
1752
+ /* reinstate warnings */
1753
+ rb_gv_set("VERBOSE", verbose);
1754
+ return ret;
1755
+ }
1756
+
1757
+ SWIGRUNTIME void
1758
+ SWIG_Ruby_SetModule(swig_module_info *pointer)
1759
+ {
1760
+ /* register a new class */
1761
+ VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
1762
+ /* create and store the structure pointer to a global variable */
1763
+ swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
1764
+ rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
1765
+ }
1766
+
1767
+ /* This function can be used to check whether a proc or method or similarly
1768
+ callable function has been passed. Usually used in a %typecheck, like:
1769
+
1770
+ %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
1771
+ $result = SWIG_Ruby_isCallable( $input );
1772
+ }
1773
+ */
1774
+ SWIGINTERN
1775
+ int SWIG_Ruby_isCallable( VALUE proc )
1776
+ {
1777
+ if ( rb_respond_to( proc, swig_call_id ) == Qtrue )
1778
+ return 1;
1779
+ return 0;
1780
+ }
1781
+
1782
+ /* This function can be used to check the arity (number of arguments)
1783
+ a proc or method can take. Usually used in a %typecheck.
1784
+ Valid arities will be that equal to minimal or those < 0
1785
+ which indicate a variable number of parameters at the end.
1786
+ */
1787
+ SWIGINTERN
1788
+ int SWIG_Ruby_arity( VALUE proc, int minimal )
1789
+ {
1790
+ if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
1791
+ {
1792
+ VALUE num = rb_funcall( proc, swig_arity_id, 0 );
1793
+ int arity = NUM2INT(num);
1794
+ if ( arity < 0 && (arity+1) < -minimal ) return 1;
1795
+ if ( arity == minimal ) return 1;
1796
+ return 1;
1797
+ }
1798
+ return 0;
1799
+ }
1800
+
1801
+
1802
+ #ifdef __cplusplus
1803
+ }
1804
+ #endif
1805
+
1806
+
1807
+
1808
+ #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1809
+
1810
+ #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1811
+
1812
+
1813
+
1814
+ /* -------- TYPES TABLE (BEGIN) -------- */
1815
+
1816
+ #define SWIGTYPE_p_Config swig_types[0]
1817
+ #define SWIGTYPE_p_Context swig_types[1]
1818
+ #define SWIGTYPE_p_Event swig_types[2]
1819
+ #define SWIGTYPE_p_FileReporter swig_types[3]
1820
+ #define SWIGTYPE_p_Metadata swig_types[4]
1821
+ #define SWIGTYPE_p_UdpReporter swig_types[5]
1822
+ #define SWIGTYPE_p_char swig_types[6]
1823
+ #define SWIGTYPE_p_oboe_metadata_t swig_types[7]
1824
+ static swig_type_info *swig_types[9];
1825
+ static swig_module_info swig_module = {swig_types, 8, 0, 0, 0, 0};
1826
+ #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1827
+ #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1828
+
1829
+ /* -------- TYPES TABLE (END) -------- */
1830
+
1831
+ #define SWIG_init Init_oboe_metal
1832
+ #define SWIG_name "Oboe_metal"
1833
+
1834
+ static VALUE mOboe_metal;
1835
+
1836
+ #define SWIG_RUBY_THREAD_BEGIN_BLOCK
1837
+ #define SWIG_RUBY_THREAD_END_BLOCK
1838
+
1839
+
1840
+ #define SWIGVERSION 0x020004
1841
+ #define SWIG_VERSION SWIGVERSION
1842
+
1843
+
1844
+ #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
1845
+ #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
1846
+
1847
+
1848
+ #include <stdexcept>
1849
+
1850
+
1851
+ #include "oboe.hpp"
1852
+
1853
+
1854
+ #include <string>
1855
+
1856
+
1857
+ SWIGINTERN swig_type_info*
1858
+ SWIG_pchar_descriptor(void)
1859
+ {
1860
+ static int init = 0;
1861
+ static swig_type_info* info = 0;
1862
+ if (!init) {
1863
+ info = SWIG_TypeQuery("_p_char");
1864
+ init = 1;
1865
+ }
1866
+ return info;
1867
+ }
1868
+
1869
+
1870
+ SWIGINTERN int
1871
+ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
1872
+ {
1873
+ if (TYPE(obj) == T_STRING) {
1874
+ #if defined(StringValuePtr)
1875
+ char *cstr = StringValuePtr(obj);
1876
+ #else
1877
+ char *cstr = STR2CSTR(obj);
1878
+ #endif
1879
+ size_t size = RSTRING_LEN(obj) + 1;
1880
+ if (cptr) {
1881
+ if (alloc) {
1882
+ if (*alloc == SWIG_NEWOBJ) {
1883
+ *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size)));
1884
+ } else {
1885
+ *cptr = cstr;
1886
+ *alloc = SWIG_OLDOBJ;
1887
+ }
1888
+ }
1889
+ }
1890
+ if (psize) *psize = size;
1891
+ return SWIG_OK;
1892
+ } else {
1893
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1894
+ if (pchar_descriptor) {
1895
+ void* vptr = 0;
1896
+ if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
1897
+ if (cptr) *cptr = (char *)vptr;
1898
+ if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
1899
+ if (alloc) *alloc = SWIG_OLDOBJ;
1900
+ return SWIG_OK;
1901
+ }
1902
+ }
1903
+ }
1904
+ return SWIG_TypeError;
1905
+ }
1906
+
1907
+
1908
+ SWIGINTERN int
1909
+ SWIG_AsPtr_std_string (VALUE obj, std::string **val)
1910
+ {
1911
+ char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ;
1912
+ if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) {
1913
+ if (buf) {
1914
+ if (val) *val = new std::string(buf, size - 1);
1915
+ if (alloc == SWIG_NEWOBJ) delete[] buf;
1916
+ return SWIG_NEWOBJ;
1917
+ } else {
1918
+ if (val) *val = 0;
1919
+ return SWIG_OLDOBJ;
1920
+ }
1921
+ } else {
1922
+ static int init = 0;
1923
+ static swig_type_info* descriptor = 0;
1924
+ if (!init) {
1925
+ descriptor = SWIG_TypeQuery("std::string" " *");
1926
+ init = 1;
1927
+ }
1928
+ if (descriptor) {
1929
+ std::string *vptr;
1930
+ int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0);
1931
+ if (SWIG_IsOK(res) && val) *val = vptr;
1932
+ return res;
1933
+ }
1934
+ }
1935
+ return SWIG_ERROR;
1936
+ }
1937
+
1938
+
1939
+ SWIGINTERNINLINE VALUE
1940
+ SWIG_From_bool (bool value)
1941
+ {
1942
+ return value ? Qtrue : Qfalse;
1943
+ }
1944
+
1945
+
1946
+ SWIGINTERNINLINE VALUE
1947
+ SWIG_FromCharPtrAndSize(const char* carray, size_t size)
1948
+ {
1949
+ if (carray) {
1950
+ if (size > LONG_MAX) {
1951
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1952
+ return pchar_descriptor ?
1953
+ SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : Qnil;
1954
+ } else {
1955
+ return rb_str_new(carray, static_cast< long >(size));
1956
+ }
1957
+ } else {
1958
+ return Qnil;
1959
+ }
1960
+ }
1961
+
1962
+
1963
+ SWIGINTERNINLINE VALUE
1964
+ SWIG_From_std_string (const std::string& s)
1965
+ {
1966
+ return SWIG_FromCharPtrAndSize(s.data(), s.size());
1967
+ }
1968
+
1969
+
1970
+ #include <limits.h>
1971
+ #if !defined(SWIG_NO_LLONG_MAX)
1972
+ # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1973
+ # define LLONG_MAX __LONG_LONG_MAX__
1974
+ # define LLONG_MIN (-LLONG_MAX - 1LL)
1975
+ # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
1976
+ # endif
1977
+ #endif
1978
+
1979
+
1980
+ SWIGINTERN VALUE
1981
+ SWIG_ruby_failed(void)
1982
+ {
1983
+ return Qnil;
1984
+ }
1985
+
1986
+
1987
+ /*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
1988
+ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
1989
+ {
1990
+ VALUE obj = args[0];
1991
+ VALUE type = TYPE(obj);
1992
+ long *res = (long *)(args[1]);
1993
+ *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
1994
+ return obj;
1995
+ }
1996
+ /*@SWIG@*/
1997
+
1998
+ SWIGINTERN int
1999
+ SWIG_AsVal_long (VALUE obj, long* val)
2000
+ {
2001
+ VALUE type = TYPE(obj);
2002
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
2003
+ long v;
2004
+ VALUE a[2];
2005
+ a[0] = obj;
2006
+ a[1] = (VALUE)(&v);
2007
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
2008
+ if (val) *val = v;
2009
+ return SWIG_OK;
2010
+ }
2011
+ }
2012
+ return SWIG_TypeError;
2013
+ }
2014
+
2015
+
2016
+ SWIGINTERN int
2017
+ SWIG_AsVal_int (VALUE obj, int *val)
2018
+ {
2019
+ long v;
2020
+ int res = SWIG_AsVal_long (obj, &v);
2021
+ if (SWIG_IsOK(res)) {
2022
+ if ((v < INT_MIN || v > INT_MAX)) {
2023
+ return SWIG_OverflowError;
2024
+ } else {
2025
+ if (val) *val = static_cast< int >(v);
2026
+ }
2027
+ }
2028
+ return res;
2029
+ }
2030
+
2031
+
2032
+ #define SWIG_From_long LONG2NUM
2033
+
2034
+
2035
+ SWIGINTERNINLINE VALUE
2036
+ SWIG_From_int (int value)
2037
+ {
2038
+ return SWIG_From_long (value);
2039
+ }
2040
+
2041
+
2042
+
2043
+
2044
+
2045
+ /*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2046
+ SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE *args)
2047
+ {
2048
+ VALUE obj = args[0];
2049
+ VALUE type = TYPE(obj);
2050
+ double *res = (double *)(args[1]);
2051
+ *res = NUM2DBL(obj);
2052
+ return obj;
2053
+ }
2054
+ /*@SWIG@*/
2055
+
2056
+ SWIGINTERN int
2057
+ SWIG_AsVal_double (VALUE obj, double *val)
2058
+ {
2059
+ VALUE type = TYPE(obj);
2060
+ if ((type == T_FLOAT) || (type == T_FIXNUM) || (type == T_BIGNUM)) {
2061
+ double v;
2062
+ VALUE a[2];
2063
+ a[0] = obj;
2064
+ a[1] = (VALUE)(&v);
2065
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2DBL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
2066
+ if (val) *val = v;
2067
+ return SWIG_OK;
2068
+ }
2069
+ }
2070
+ return SWIG_TypeError;
2071
+ }
2072
+
2073
+ swig_class SwigClassMetadata;
2074
+
2075
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2076
+ SWIGINTERN VALUE
2077
+ _wrap_Metadata_allocate(VALUE self) {
2078
+ #else
2079
+ SWIGINTERN VALUE
2080
+ _wrap_Metadata_allocate(int argc, VALUE *argv, VALUE self) {
2081
+ #endif
2082
+
2083
+
2084
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Metadata);
2085
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2086
+ rb_obj_call_init(vresult, argc, argv);
2087
+ #endif
2088
+ return vresult;
2089
+ }
2090
+
2091
+
2092
+ SWIGINTERN VALUE
2093
+ _wrap_new_Metadata(int argc, VALUE *argv, VALUE self) {
2094
+ oboe_metadata_t *arg1 = (oboe_metadata_t *) 0 ;
2095
+ void *argp1 = 0 ;
2096
+ int res1 = 0 ;
2097
+ Metadata *result = 0 ;
2098
+
2099
+ if ((argc < 1) || (argc > 1)) {
2100
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2101
+ }
2102
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_oboe_metadata_t, 0 | 0 );
2103
+ if (!SWIG_IsOK(res1)) {
2104
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "oboe_metadata_t *","Metadata", 1, argv[0] ));
2105
+ }
2106
+ arg1 = reinterpret_cast< oboe_metadata_t * >(argp1);
2107
+ result = (Metadata *)new Metadata(arg1);
2108
+ DATA_PTR(self) = result;
2109
+ return self;
2110
+ fail:
2111
+ return Qnil;
2112
+ }
2113
+
2114
+
2115
+ SWIGINTERN void
2116
+ free_Metadata(Metadata *arg1) {
2117
+ delete arg1;
2118
+ }
2119
+
2120
+ SWIGINTERN VALUE
2121
+ _wrap_Metadata_fromString(int argc, VALUE *argv, VALUE self) {
2122
+ std::string arg1 ;
2123
+ Metadata *result = 0 ;
2124
+ VALUE vresult = Qnil;
2125
+
2126
+ if ((argc < 1) || (argc > 1)) {
2127
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2128
+ }
2129
+ {
2130
+ std::string *ptr = (std::string *)0;
2131
+ int res = SWIG_AsPtr_std_string(argv[0], &ptr);
2132
+ if (!SWIG_IsOK(res) || !ptr) {
2133
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::string","Metadata::fromString", 1, argv[0] ));
2134
+ }
2135
+ arg1 = *ptr;
2136
+ if (SWIG_IsNewObj(res)) delete ptr;
2137
+ }
2138
+ result = (Metadata *)Metadata::fromString(arg1);
2139
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Metadata, SWIG_POINTER_OWN | 0 );
2140
+ return vresult;
2141
+ fail:
2142
+ return Qnil;
2143
+ }
2144
+
2145
+
2146
+ SWIGINTERN VALUE
2147
+ _wrap_Metadata_createEvent(int argc, VALUE *argv, VALUE self) {
2148
+ Metadata *arg1 = (Metadata *) 0 ;
2149
+ void *argp1 = 0 ;
2150
+ int res1 = 0 ;
2151
+ Event *result = 0 ;
2152
+ VALUE vresult = Qnil;
2153
+
2154
+ if ((argc < 0) || (argc > 0)) {
2155
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2156
+ }
2157
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Metadata, 0 | 0 );
2158
+ if (!SWIG_IsOK(res1)) {
2159
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Metadata *","createEvent", 1, self ));
2160
+ }
2161
+ arg1 = reinterpret_cast< Metadata * >(argp1);
2162
+ result = (Event *)(arg1)->createEvent();
2163
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Event, SWIG_POINTER_OWN | 0 );
2164
+ return vresult;
2165
+ fail:
2166
+ return Qnil;
2167
+ }
2168
+
2169
+
2170
+ SWIGINTERN VALUE
2171
+ _wrap_Metadata_makeRandom(int argc, VALUE *argv, VALUE self) {
2172
+ Metadata *result = 0 ;
2173
+ VALUE vresult = Qnil;
2174
+
2175
+ if ((argc < 0) || (argc > 0)) {
2176
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2177
+ }
2178
+ result = (Metadata *)Metadata::makeRandom();
2179
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Metadata, SWIG_POINTER_OWN | 0 );
2180
+ return vresult;
2181
+ fail:
2182
+ return Qnil;
2183
+ }
2184
+
2185
+
2186
+ SWIGINTERN VALUE
2187
+ _wrap_Metadata_copy(int argc, VALUE *argv, VALUE self) {
2188
+ Metadata *arg1 = (Metadata *) 0 ;
2189
+ void *argp1 = 0 ;
2190
+ int res1 = 0 ;
2191
+ Metadata *result = 0 ;
2192
+ VALUE vresult = Qnil;
2193
+
2194
+ if ((argc < 0) || (argc > 0)) {
2195
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2196
+ }
2197
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Metadata, 0 | 0 );
2198
+ if (!SWIG_IsOK(res1)) {
2199
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Metadata *","copy", 1, self ));
2200
+ }
2201
+ arg1 = reinterpret_cast< Metadata * >(argp1);
2202
+ result = (Metadata *)(arg1)->copy();
2203
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Metadata, SWIG_POINTER_OWN | 0 );
2204
+ return vresult;
2205
+ fail:
2206
+ return Qnil;
2207
+ }
2208
+
2209
+
2210
+ SWIGINTERN VALUE
2211
+ _wrap_Metadata_isValid(int argc, VALUE *argv, VALUE self) {
2212
+ Metadata *arg1 = (Metadata *) 0 ;
2213
+ void *argp1 = 0 ;
2214
+ int res1 = 0 ;
2215
+ bool result;
2216
+ VALUE vresult = Qnil;
2217
+
2218
+ if ((argc < 0) || (argc > 0)) {
2219
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2220
+ }
2221
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Metadata, 0 | 0 );
2222
+ if (!SWIG_IsOK(res1)) {
2223
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Metadata *","isValid", 1, self ));
2224
+ }
2225
+ arg1 = reinterpret_cast< Metadata * >(argp1);
2226
+ result = (bool)(arg1)->isValid();
2227
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2228
+ return vresult;
2229
+ fail:
2230
+ return Qnil;
2231
+ }
2232
+
2233
+
2234
+ SWIGINTERN VALUE
2235
+ _wrap_Metadata_toString(int argc, VALUE *argv, VALUE self) {
2236
+ Metadata *arg1 = (Metadata *) 0 ;
2237
+ void *argp1 = 0 ;
2238
+ int res1 = 0 ;
2239
+ std::string result;
2240
+ VALUE vresult = Qnil;
2241
+
2242
+ if ((argc < 0) || (argc > 0)) {
2243
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2244
+ }
2245
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Metadata, 0 | 0 );
2246
+ if (!SWIG_IsOK(res1)) {
2247
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Metadata *","toString", 1, self ));
2248
+ }
2249
+ arg1 = reinterpret_cast< Metadata * >(argp1);
2250
+ result = (arg1)->toString();
2251
+ vresult = SWIG_From_std_string(static_cast< std::string >(result));
2252
+ return vresult;
2253
+ fail:
2254
+ return Qnil;
2255
+ }
2256
+
2257
+
2258
+ swig_class SwigClassContext;
2259
+
2260
+ SWIGINTERN VALUE
2261
+ _wrap_Context_setTracingMode(int argc, VALUE *argv, VALUE self) {
2262
+ int arg1 ;
2263
+ int val1 ;
2264
+ int ecode1 = 0 ;
2265
+
2266
+ if ((argc < 1) || (argc > 1)) {
2267
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2268
+ }
2269
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2270
+ if (!SWIG_IsOK(ecode1)) {
2271
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","Context::setTracingMode", 1, argv[0] ));
2272
+ }
2273
+ arg1 = static_cast< int >(val1);
2274
+ Context::setTracingMode(arg1);
2275
+ return Qnil;
2276
+ fail:
2277
+ return Qnil;
2278
+ }
2279
+
2280
+
2281
+ SWIGINTERN VALUE
2282
+ _wrap_Context_setDefaultSampleRate(int argc, VALUE *argv, VALUE self) {
2283
+ int arg1 ;
2284
+ int val1 ;
2285
+ int ecode1 = 0 ;
2286
+
2287
+ if ((argc < 1) || (argc > 1)) {
2288
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2289
+ }
2290
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2291
+ if (!SWIG_IsOK(ecode1)) {
2292
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","Context::setDefaultSampleRate", 1, argv[0] ));
2293
+ }
2294
+ arg1 = static_cast< int >(val1);
2295
+ Context::setDefaultSampleRate(arg1);
2296
+ return Qnil;
2297
+ fail:
2298
+ return Qnil;
2299
+ }
2300
+
2301
+
2302
+ SWIGINTERN VALUE
2303
+ _wrap_Context_sampleRequest(int argc, VALUE *argv, VALUE self) {
2304
+ std::string arg1 ;
2305
+ std::string arg2 ;
2306
+ std::string arg3 ;
2307
+ int result;
2308
+ VALUE vresult = Qnil;
2309
+
2310
+ if ((argc < 3) || (argc > 3)) {
2311
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
2312
+ }
2313
+ {
2314
+ std::string *ptr = (std::string *)0;
2315
+ int res = SWIG_AsPtr_std_string(argv[0], &ptr);
2316
+ if (!SWIG_IsOK(res) || !ptr) {
2317
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::string","Context::sampleRequest", 1, argv[0] ));
2318
+ }
2319
+ arg1 = *ptr;
2320
+ if (SWIG_IsNewObj(res)) delete ptr;
2321
+ }
2322
+ {
2323
+ std::string *ptr = (std::string *)0;
2324
+ int res = SWIG_AsPtr_std_string(argv[1], &ptr);
2325
+ if (!SWIG_IsOK(res) || !ptr) {
2326
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::string","Context::sampleRequest", 2, argv[1] ));
2327
+ }
2328
+ arg2 = *ptr;
2329
+ if (SWIG_IsNewObj(res)) delete ptr;
2330
+ }
2331
+ {
2332
+ std::string *ptr = (std::string *)0;
2333
+ int res = SWIG_AsPtr_std_string(argv[2], &ptr);
2334
+ if (!SWIG_IsOK(res) || !ptr) {
2335
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::string","Context::sampleRequest", 3, argv[2] ));
2336
+ }
2337
+ arg3 = *ptr;
2338
+ if (SWIG_IsNewObj(res)) delete ptr;
2339
+ }
2340
+ result = (int)Context::sampleRequest(arg1,arg2,arg3);
2341
+ vresult = SWIG_From_int(static_cast< int >(result));
2342
+ return vresult;
2343
+ fail:
2344
+ return Qnil;
2345
+ }
2346
+
2347
+
2348
+ SWIGINTERN VALUE
2349
+ _wrap_Context_get(int argc, VALUE *argv, VALUE self) {
2350
+ oboe_metadata_t *result = 0 ;
2351
+ VALUE vresult = Qnil;
2352
+
2353
+ if ((argc < 0) || (argc > 0)) {
2354
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2355
+ }
2356
+ result = (oboe_metadata_t *)Context::get();
2357
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_oboe_metadata_t, 0 | 0 );
2358
+ return vresult;
2359
+ fail:
2360
+ return Qnil;
2361
+ }
2362
+
2363
+
2364
+ SWIGINTERN VALUE
2365
+ _wrap_Context_toString(int argc, VALUE *argv, VALUE self) {
2366
+ std::string result;
2367
+ VALUE vresult = Qnil;
2368
+
2369
+ if ((argc < 0) || (argc > 0)) {
2370
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2371
+ }
2372
+ result = Context::toString();
2373
+ vresult = SWIG_From_std_string(static_cast< std::string >(result));
2374
+ return vresult;
2375
+ fail:
2376
+ return Qnil;
2377
+ }
2378
+
2379
+
2380
+ SWIGINTERN VALUE
2381
+ _wrap_Context_set(int argc, VALUE *argv, VALUE self) {
2382
+ oboe_metadata_t *arg1 = (oboe_metadata_t *) 0 ;
2383
+ void *argp1 = 0 ;
2384
+ int res1 = 0 ;
2385
+
2386
+ if ((argc < 1) || (argc > 1)) {
2387
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2388
+ }
2389
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_oboe_metadata_t, 0 | 0 );
2390
+ if (!SWIG_IsOK(res1)) {
2391
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "oboe_metadata_t *","Context::set", 1, argv[0] ));
2392
+ }
2393
+ arg1 = reinterpret_cast< oboe_metadata_t * >(argp1);
2394
+ Context::set(arg1);
2395
+ return Qnil;
2396
+ fail:
2397
+ return Qnil;
2398
+ }
2399
+
2400
+
2401
+ SWIGINTERN VALUE
2402
+ _wrap_Context_fromString(int argc, VALUE *argv, VALUE self) {
2403
+ std::string arg1 ;
2404
+
2405
+ if ((argc < 1) || (argc > 1)) {
2406
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2407
+ }
2408
+ {
2409
+ std::string *ptr = (std::string *)0;
2410
+ int res = SWIG_AsPtr_std_string(argv[0], &ptr);
2411
+ if (!SWIG_IsOK(res) || !ptr) {
2412
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::string","Context::fromString", 1, argv[0] ));
2413
+ }
2414
+ arg1 = *ptr;
2415
+ if (SWIG_IsNewObj(res)) delete ptr;
2416
+ }
2417
+ Context::fromString(arg1);
2418
+ return Qnil;
2419
+ fail:
2420
+ return Qnil;
2421
+ }
2422
+
2423
+
2424
+ SWIGINTERN VALUE
2425
+ _wrap_Context_copy(int argc, VALUE *argv, VALUE self) {
2426
+ Metadata *result = 0 ;
2427
+ VALUE vresult = Qnil;
2428
+
2429
+ if ((argc < 0) || (argc > 0)) {
2430
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2431
+ }
2432
+ result = (Metadata *)Context::copy();
2433
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Metadata, SWIG_POINTER_OWN | 0 );
2434
+ return vresult;
2435
+ fail:
2436
+ return Qnil;
2437
+ }
2438
+
2439
+
2440
+ SWIGINTERN VALUE
2441
+ _wrap_Context_clear(int argc, VALUE *argv, VALUE self) {
2442
+ if ((argc < 0) || (argc > 0)) {
2443
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2444
+ }
2445
+ Context::clear();
2446
+ return Qnil;
2447
+ fail:
2448
+ return Qnil;
2449
+ }
2450
+
2451
+
2452
+ SWIGINTERN VALUE
2453
+ _wrap_Context_isValid(int argc, VALUE *argv, VALUE self) {
2454
+ bool result;
2455
+ VALUE vresult = Qnil;
2456
+
2457
+ if ((argc < 0) || (argc > 0)) {
2458
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2459
+ }
2460
+ result = (bool)Context::isValid();
2461
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2462
+ return vresult;
2463
+ fail:
2464
+ return Qnil;
2465
+ }
2466
+
2467
+
2468
+ SWIGINTERN VALUE
2469
+ _wrap_Context_init(int argc, VALUE *argv, VALUE self) {
2470
+ if ((argc < 0) || (argc > 0)) {
2471
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2472
+ }
2473
+ Context::init();
2474
+ return Qnil;
2475
+ fail:
2476
+ return Qnil;
2477
+ }
2478
+
2479
+
2480
+ SWIGINTERN VALUE
2481
+ _wrap_Context_createEvent(int argc, VALUE *argv, VALUE self) {
2482
+ Event *result = 0 ;
2483
+ VALUE vresult = Qnil;
2484
+
2485
+ if ((argc < 0) || (argc > 0)) {
2486
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2487
+ }
2488
+ result = (Event *)Context::createEvent();
2489
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Event, SWIG_POINTER_OWN | 0 );
2490
+ return vresult;
2491
+ fail:
2492
+ return Qnil;
2493
+ }
2494
+
2495
+
2496
+ SWIGINTERN VALUE
2497
+ _wrap_Context_startTrace(int argc, VALUE *argv, VALUE self) {
2498
+ Event *result = 0 ;
2499
+ VALUE vresult = Qnil;
2500
+
2501
+ if ((argc < 0) || (argc > 0)) {
2502
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2503
+ }
2504
+ result = (Event *)Context::startTrace();
2505
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Event, SWIG_POINTER_OWN | 0 );
2506
+ return vresult;
2507
+ fail:
2508
+ return Qnil;
2509
+ }
2510
+
2511
+
2512
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2513
+ SWIGINTERN VALUE
2514
+ _wrap_Context_allocate(VALUE self) {
2515
+ #else
2516
+ SWIGINTERN VALUE
2517
+ _wrap_Context_allocate(int argc, VALUE *argv, VALUE self) {
2518
+ #endif
2519
+
2520
+
2521
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Context);
2522
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2523
+ rb_obj_call_init(vresult, argc, argv);
2524
+ #endif
2525
+ return vresult;
2526
+ }
2527
+
2528
+
2529
+ SWIGINTERN VALUE
2530
+ _wrap_new_Context(int argc, VALUE *argv, VALUE self) {
2531
+ Context *result = 0 ;
2532
+
2533
+ if ((argc < 0) || (argc > 0)) {
2534
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2535
+ }
2536
+ result = (Context *)new Context();
2537
+ DATA_PTR(self) = result;
2538
+ return self;
2539
+ fail:
2540
+ return Qnil;
2541
+ }
2542
+
2543
+
2544
+ SWIGINTERN void
2545
+ free_Context(Context *arg1) {
2546
+ delete arg1;
2547
+ }
2548
+
2549
+ swig_class SwigClassEvent;
2550
+
2551
+ SWIGINTERN void
2552
+ free_Event(Event *arg1) {
2553
+ delete arg1;
2554
+ }
2555
+
2556
+ SWIGINTERN VALUE
2557
+ _wrap_Event_addInfo__SWIG_0(int argc, VALUE *argv, VALUE self) {
2558
+ Event *arg1 = (Event *) 0 ;
2559
+ char *arg2 = (char *) 0 ;
2560
+ void *arg3 = (void *) 0 ;
2561
+ void *argp1 = 0 ;
2562
+ int res1 = 0 ;
2563
+ int res2 ;
2564
+ char *buf2 = 0 ;
2565
+ int alloc2 = 0 ;
2566
+ int res3 ;
2567
+ bool result;
2568
+ VALUE vresult = Qnil;
2569
+
2570
+ if ((argc < 2) || (argc > 2)) {
2571
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2572
+ }
2573
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Event, 0 | 0 );
2574
+ if (!SWIG_IsOK(res1)) {
2575
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Event *","addInfo", 1, self ));
2576
+ }
2577
+ arg1 = reinterpret_cast< Event * >(argp1);
2578
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
2579
+ if (!SWIG_IsOK(res2)) {
2580
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","addInfo", 2, argv[0] ));
2581
+ }
2582
+ arg2 = reinterpret_cast< char * >(buf2);
2583
+ res3 = SWIG_ConvertPtr(argv[1],SWIG_as_voidptrptr(&arg3), 0, 0);
2584
+ if (!SWIG_IsOK(res3)) {
2585
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "void *","addInfo", 3, argv[1] ));
2586
+ }
2587
+ result = (bool)(arg1)->addInfo(arg2,arg3);
2588
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2589
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2590
+ return vresult;
2591
+ fail:
2592
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2593
+ return Qnil;
2594
+ }
2595
+
2596
+
2597
+ SWIGINTERN VALUE
2598
+ _wrap_Event_addInfo__SWIG_1(int argc, VALUE *argv, VALUE self) {
2599
+ Event *arg1 = (Event *) 0 ;
2600
+ char *arg2 = (char *) 0 ;
2601
+ std::string *arg3 = 0 ;
2602
+ void *argp1 = 0 ;
2603
+ int res1 = 0 ;
2604
+ int res2 ;
2605
+ char *buf2 = 0 ;
2606
+ int alloc2 = 0 ;
2607
+ int res3 = SWIG_OLDOBJ ;
2608
+ bool result;
2609
+ VALUE vresult = Qnil;
2610
+
2611
+ if ((argc < 2) || (argc > 2)) {
2612
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2613
+ }
2614
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Event, 0 | 0 );
2615
+ if (!SWIG_IsOK(res1)) {
2616
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Event *","addInfo", 1, self ));
2617
+ }
2618
+ arg1 = reinterpret_cast< Event * >(argp1);
2619
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
2620
+ if (!SWIG_IsOK(res2)) {
2621
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","addInfo", 2, argv[0] ));
2622
+ }
2623
+ arg2 = reinterpret_cast< char * >(buf2);
2624
+ {
2625
+ std::string *ptr = (std::string *)0;
2626
+ res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
2627
+ if (!SWIG_IsOK(res3)) {
2628
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::string const &","addInfo", 3, argv[1] ));
2629
+ }
2630
+ if (!ptr) {
2631
+ SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","addInfo", 3, argv[1]));
2632
+ }
2633
+ arg3 = ptr;
2634
+ }
2635
+ result = (bool)(arg1)->addInfo(arg2,(std::string const &)*arg3);
2636
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2637
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2638
+ if (SWIG_IsNewObj(res3)) delete arg3;
2639
+ return vresult;
2640
+ fail:
2641
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2642
+ if (SWIG_IsNewObj(res3)) delete arg3;
2643
+ return Qnil;
2644
+ }
2645
+
2646
+
2647
+ SWIGINTERN VALUE
2648
+ _wrap_Event_addInfo__SWIG_2(int argc, VALUE *argv, VALUE self) {
2649
+ Event *arg1 = (Event *) 0 ;
2650
+ char *arg2 = (char *) 0 ;
2651
+ long arg3 ;
2652
+ void *argp1 = 0 ;
2653
+ int res1 = 0 ;
2654
+ int res2 ;
2655
+ char *buf2 = 0 ;
2656
+ int alloc2 = 0 ;
2657
+ long val3 ;
2658
+ int ecode3 = 0 ;
2659
+ bool result;
2660
+ VALUE vresult = Qnil;
2661
+
2662
+ if ((argc < 2) || (argc > 2)) {
2663
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2664
+ }
2665
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Event, 0 | 0 );
2666
+ if (!SWIG_IsOK(res1)) {
2667
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Event *","addInfo", 1, self ));
2668
+ }
2669
+ arg1 = reinterpret_cast< Event * >(argp1);
2670
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
2671
+ if (!SWIG_IsOK(res2)) {
2672
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","addInfo", 2, argv[0] ));
2673
+ }
2674
+ arg2 = reinterpret_cast< char * >(buf2);
2675
+ ecode3 = SWIG_AsVal_long(argv[1], &val3);
2676
+ if (!SWIG_IsOK(ecode3)) {
2677
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "long","addInfo", 3, argv[1] ));
2678
+ }
2679
+ arg3 = static_cast< long >(val3);
2680
+ result = (bool)(arg1)->addInfo(arg2,arg3);
2681
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2682
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2683
+ return vresult;
2684
+ fail:
2685
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2686
+ return Qnil;
2687
+ }
2688
+
2689
+
2690
+ SWIGINTERN VALUE
2691
+ _wrap_Event_addInfo__SWIG_3(int argc, VALUE *argv, VALUE self) {
2692
+ Event *arg1 = (Event *) 0 ;
2693
+ char *arg2 = (char *) 0 ;
2694
+ double arg3 ;
2695
+ void *argp1 = 0 ;
2696
+ int res1 = 0 ;
2697
+ int res2 ;
2698
+ char *buf2 = 0 ;
2699
+ int alloc2 = 0 ;
2700
+ double val3 ;
2701
+ int ecode3 = 0 ;
2702
+ bool result;
2703
+ VALUE vresult = Qnil;
2704
+
2705
+ if ((argc < 2) || (argc > 2)) {
2706
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2707
+ }
2708
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Event, 0 | 0 );
2709
+ if (!SWIG_IsOK(res1)) {
2710
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Event *","addInfo", 1, self ));
2711
+ }
2712
+ arg1 = reinterpret_cast< Event * >(argp1);
2713
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
2714
+ if (!SWIG_IsOK(res2)) {
2715
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","addInfo", 2, argv[0] ));
2716
+ }
2717
+ arg2 = reinterpret_cast< char * >(buf2);
2718
+ ecode3 = SWIG_AsVal_double(argv[1], &val3);
2719
+ if (!SWIG_IsOK(ecode3)) {
2720
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","addInfo", 3, argv[1] ));
2721
+ }
2722
+ arg3 = static_cast< double >(val3);
2723
+ result = (bool)(arg1)->addInfo(arg2,arg3);
2724
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2725
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2726
+ return vresult;
2727
+ fail:
2728
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2729
+ return Qnil;
2730
+ }
2731
+
2732
+
2733
+ SWIGINTERN VALUE _wrap_Event_addInfo(int nargs, VALUE *args, VALUE self) {
2734
+ int argc;
2735
+ VALUE argv[4];
2736
+ int ii;
2737
+
2738
+ argc = nargs + 1;
2739
+ argv[0] = self;
2740
+ if (argc > 4) SWIG_fail;
2741
+ for (ii = 1; (ii < argc); ++ii) {
2742
+ argv[ii] = args[ii-1];
2743
+ }
2744
+ if (argc == 3) {
2745
+ int _v;
2746
+ void *vptr = 0;
2747
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Event, 0);
2748
+ _v = SWIG_CheckState(res);
2749
+ if (_v) {
2750
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
2751
+ _v = SWIG_CheckState(res);
2752
+ if (_v) {
2753
+ void *ptr = 0;
2754
+ int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
2755
+ _v = SWIG_CheckState(res);
2756
+ if (_v) {
2757
+ return _wrap_Event_addInfo__SWIG_0(nargs, args, self);
2758
+ }
2759
+ }
2760
+ }
2761
+ }
2762
+ if (argc == 3) {
2763
+ int _v;
2764
+ void *vptr = 0;
2765
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Event, 0);
2766
+ _v = SWIG_CheckState(res);
2767
+ if (_v) {
2768
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
2769
+ _v = SWIG_CheckState(res);
2770
+ if (_v) {
2771
+ {
2772
+ int res = SWIG_AsVal_long(argv[2], NULL);
2773
+ _v = SWIG_CheckState(res);
2774
+ }
2775
+ if (_v) {
2776
+ return _wrap_Event_addInfo__SWIG_2(nargs, args, self);
2777
+ }
2778
+ }
2779
+ }
2780
+ }
2781
+ if (argc == 3) {
2782
+ int _v;
2783
+ void *vptr = 0;
2784
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Event, 0);
2785
+ _v = SWIG_CheckState(res);
2786
+ if (_v) {
2787
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
2788
+ _v = SWIG_CheckState(res);
2789
+ if (_v) {
2790
+ {
2791
+ int res = SWIG_AsVal_double(argv[2], NULL);
2792
+ _v = SWIG_CheckState(res);
2793
+ }
2794
+ if (_v) {
2795
+ return _wrap_Event_addInfo__SWIG_3(nargs, args, self);
2796
+ }
2797
+ }
2798
+ }
2799
+ }
2800
+ if (argc == 3) {
2801
+ int _v;
2802
+ void *vptr = 0;
2803
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Event, 0);
2804
+ _v = SWIG_CheckState(res);
2805
+ if (_v) {
2806
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
2807
+ _v = SWIG_CheckState(res);
2808
+ if (_v) {
2809
+ int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
2810
+ _v = SWIG_CheckState(res);
2811
+ if (_v) {
2812
+ return _wrap_Event_addInfo__SWIG_1(nargs, args, self);
2813
+ }
2814
+ }
2815
+ }
2816
+ }
2817
+
2818
+ fail:
2819
+ Ruby_Format_OverloadedError( argc, 4, "Event.addInfo",
2820
+ " bool Event.addInfo(char *key, void *val)\n"
2821
+ " bool Event.addInfo(char *key, std::string const &val)\n"
2822
+ " bool Event.addInfo(char *key, long val)\n"
2823
+ " bool Event.addInfo(char *key, double val)\n");
2824
+
2825
+ return Qnil;
2826
+ }
2827
+
2828
+
2829
+ SWIGINTERN VALUE
2830
+ _wrap_Event_addEdge(int argc, VALUE *argv, VALUE self) {
2831
+ Event *arg1 = (Event *) 0 ;
2832
+ oboe_metadata_t *arg2 = (oboe_metadata_t *) 0 ;
2833
+ void *argp1 = 0 ;
2834
+ int res1 = 0 ;
2835
+ void *argp2 = 0 ;
2836
+ int res2 = 0 ;
2837
+ bool result;
2838
+ VALUE vresult = Qnil;
2839
+
2840
+ if ((argc < 1) || (argc > 1)) {
2841
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2842
+ }
2843
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Event, 0 | 0 );
2844
+ if (!SWIG_IsOK(res1)) {
2845
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Event *","addEdge", 1, self ));
2846
+ }
2847
+ arg1 = reinterpret_cast< Event * >(argp1);
2848
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_oboe_metadata_t, 0 | 0 );
2849
+ if (!SWIG_IsOK(res2)) {
2850
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "oboe_metadata_t *","addEdge", 2, argv[0] ));
2851
+ }
2852
+ arg2 = reinterpret_cast< oboe_metadata_t * >(argp2);
2853
+ result = (bool)(arg1)->addEdge(arg2);
2854
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2855
+ return vresult;
2856
+ fail:
2857
+ return Qnil;
2858
+ }
2859
+
2860
+
2861
+ SWIGINTERN VALUE
2862
+ _wrap_Event_addEdgeStr(int argc, VALUE *argv, VALUE self) {
2863
+ Event *arg1 = (Event *) 0 ;
2864
+ std::string *arg2 = 0 ;
2865
+ void *argp1 = 0 ;
2866
+ int res1 = 0 ;
2867
+ int res2 = SWIG_OLDOBJ ;
2868
+ bool result;
2869
+ VALUE vresult = Qnil;
2870
+
2871
+ if ((argc < 1) || (argc > 1)) {
2872
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2873
+ }
2874
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Event, 0 | 0 );
2875
+ if (!SWIG_IsOK(res1)) {
2876
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Event *","addEdgeStr", 1, self ));
2877
+ }
2878
+ arg1 = reinterpret_cast< Event * >(argp1);
2879
+ {
2880
+ std::string *ptr = (std::string *)0;
2881
+ res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
2882
+ if (!SWIG_IsOK(res2)) {
2883
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","addEdgeStr", 2, argv[0] ));
2884
+ }
2885
+ if (!ptr) {
2886
+ SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","addEdgeStr", 2, argv[0]));
2887
+ }
2888
+ arg2 = ptr;
2889
+ }
2890
+ result = (bool)(arg1)->addEdgeStr((std::string const &)*arg2);
2891
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2892
+ if (SWIG_IsNewObj(res2)) delete arg2;
2893
+ return vresult;
2894
+ fail:
2895
+ if (SWIG_IsNewObj(res2)) delete arg2;
2896
+ return Qnil;
2897
+ }
2898
+
2899
+
2900
+ SWIGINTERN VALUE
2901
+ _wrap_Event_getMetadata(int argc, VALUE *argv, VALUE self) {
2902
+ Event *arg1 = (Event *) 0 ;
2903
+ void *argp1 = 0 ;
2904
+ int res1 = 0 ;
2905
+ Metadata *result = 0 ;
2906
+ VALUE vresult = Qnil;
2907
+
2908
+ if ((argc < 0) || (argc > 0)) {
2909
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2910
+ }
2911
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Event, 0 | 0 );
2912
+ if (!SWIG_IsOK(res1)) {
2913
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Event *","getMetadata", 1, self ));
2914
+ }
2915
+ arg1 = reinterpret_cast< Event * >(argp1);
2916
+ result = (Metadata *)(arg1)->getMetadata();
2917
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Metadata, SWIG_POINTER_OWN | 0 );
2918
+ return vresult;
2919
+ fail:
2920
+ return Qnil;
2921
+ }
2922
+
2923
+
2924
+ SWIGINTERN VALUE
2925
+ _wrap_Event_metadataString(int argc, VALUE *argv, VALUE self) {
2926
+ Event *arg1 = (Event *) 0 ;
2927
+ void *argp1 = 0 ;
2928
+ int res1 = 0 ;
2929
+ std::string result;
2930
+ VALUE vresult = Qnil;
2931
+
2932
+ if ((argc < 0) || (argc > 0)) {
2933
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2934
+ }
2935
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Event, 0 | 0 );
2936
+ if (!SWIG_IsOK(res1)) {
2937
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Event *","metadataString", 1, self ));
2938
+ }
2939
+ arg1 = reinterpret_cast< Event * >(argp1);
2940
+ result = (arg1)->metadataString();
2941
+ vresult = SWIG_From_std_string(static_cast< std::string >(result));
2942
+ return vresult;
2943
+ fail:
2944
+ return Qnil;
2945
+ }
2946
+
2947
+
2948
+ SWIGINTERN VALUE
2949
+ _wrap_Event_startTrace(int argc, VALUE *argv, VALUE self) {
2950
+ oboe_metadata_t *arg1 = (oboe_metadata_t *) 0 ;
2951
+ void *argp1 = 0 ;
2952
+ int res1 = 0 ;
2953
+ Event *result = 0 ;
2954
+ VALUE vresult = Qnil;
2955
+
2956
+ if ((argc < 1) || (argc > 1)) {
2957
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2958
+ }
2959
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_oboe_metadata_t, 0 | 0 );
2960
+ if (!SWIG_IsOK(res1)) {
2961
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "oboe_metadata_t const *","Event::startTrace", 1, argv[0] ));
2962
+ }
2963
+ arg1 = reinterpret_cast< oboe_metadata_t * >(argp1);
2964
+ result = (Event *)Event::startTrace((oboe_metadata_t const *)arg1);
2965
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Event, SWIG_POINTER_OWN | 0 );
2966
+ return vresult;
2967
+ fail:
2968
+ return Qnil;
2969
+ }
2970
+
2971
+
2972
+ swig_class SwigClassUdpReporter;
2973
+
2974
+ SWIGINTERN VALUE
2975
+ _wrap_new_UdpReporter__SWIG_0(int argc, VALUE *argv, VALUE self) {
2976
+ char *arg1 = (char *) 0 ;
2977
+ char *arg2 = (char *) 0 ;
2978
+ int res1 ;
2979
+ char *buf1 = 0 ;
2980
+ int alloc1 = 0 ;
2981
+ int res2 ;
2982
+ char *buf2 = 0 ;
2983
+ int alloc2 = 0 ;
2984
+ UdpReporter *result = 0 ;
2985
+
2986
+ if ((argc < 2) || (argc > 2)) {
2987
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2988
+ }
2989
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
2990
+ if (!SWIG_IsOK(res1)) {
2991
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","UdpReporter", 1, argv[0] ));
2992
+ }
2993
+ arg1 = reinterpret_cast< char * >(buf1);
2994
+ res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
2995
+ if (!SWIG_IsOK(res2)) {
2996
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","UdpReporter", 2, argv[1] ));
2997
+ }
2998
+ arg2 = reinterpret_cast< char * >(buf2);
2999
+ result = (UdpReporter *)new UdpReporter((char const *)arg1,(char const *)arg2);
3000
+ DATA_PTR(self) = result;
3001
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
3002
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
3003
+ return self;
3004
+ fail:
3005
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
3006
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
3007
+ return Qnil;
3008
+ }
3009
+
3010
+
3011
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
3012
+ SWIGINTERN VALUE
3013
+ _wrap_UdpReporter_allocate(VALUE self) {
3014
+ #else
3015
+ SWIGINTERN VALUE
3016
+ _wrap_UdpReporter_allocate(int argc, VALUE *argv, VALUE self) {
3017
+ #endif
3018
+
3019
+
3020
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_UdpReporter);
3021
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
3022
+ rb_obj_call_init(vresult, argc, argv);
3023
+ #endif
3024
+ return vresult;
3025
+ }
3026
+
3027
+
3028
+ SWIGINTERN VALUE
3029
+ _wrap_new_UdpReporter__SWIG_1(int argc, VALUE *argv, VALUE self) {
3030
+ char *arg1 = (char *) 0 ;
3031
+ int res1 ;
3032
+ char *buf1 = 0 ;
3033
+ int alloc1 = 0 ;
3034
+ UdpReporter *result = 0 ;
3035
+
3036
+ if ((argc < 1) || (argc > 1)) {
3037
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3038
+ }
3039
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
3040
+ if (!SWIG_IsOK(res1)) {
3041
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","UdpReporter", 1, argv[0] ));
3042
+ }
3043
+ arg1 = reinterpret_cast< char * >(buf1);
3044
+ result = (UdpReporter *)new UdpReporter((char const *)arg1);
3045
+ DATA_PTR(self) = result;
3046
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
3047
+ return self;
3048
+ fail:
3049
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
3050
+ return Qnil;
3051
+ }
3052
+
3053
+
3054
+ SWIGINTERN VALUE _wrap_new_UdpReporter(int nargs, VALUE *args, VALUE self) {
3055
+ int argc;
3056
+ VALUE argv[2];
3057
+ int ii;
3058
+
3059
+ argc = nargs;
3060
+ if (argc > 2) SWIG_fail;
3061
+ for (ii = 0; (ii < argc); ++ii) {
3062
+ argv[ii] = args[ii];
3063
+ }
3064
+ if (argc == 1) {
3065
+ int _v;
3066
+ int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
3067
+ _v = SWIG_CheckState(res);
3068
+ if (_v) {
3069
+ return _wrap_new_UdpReporter__SWIG_1(nargs, args, self);
3070
+ }
3071
+ }
3072
+ if (argc == 2) {
3073
+ int _v;
3074
+ int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
3075
+ _v = SWIG_CheckState(res);
3076
+ if (_v) {
3077
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
3078
+ _v = SWIG_CheckState(res);
3079
+ if (_v) {
3080
+ return _wrap_new_UdpReporter__SWIG_0(nargs, args, self);
3081
+ }
3082
+ }
3083
+ }
3084
+
3085
+ fail:
3086
+ Ruby_Format_OverloadedError( argc, 2, "UdpReporter.new",
3087
+ " UdpReporter.new(char const *addr, char const *port)\n"
3088
+ " UdpReporter.new(char const *addr)\n");
3089
+
3090
+ return Qnil;
3091
+ }
3092
+
3093
+
3094
+ SWIGINTERN void
3095
+ free_UdpReporter(UdpReporter *arg1) {
3096
+ delete arg1;
3097
+ }
3098
+
3099
+ SWIGINTERN VALUE
3100
+ _wrap_UdpReporter_sendReport__SWIG_0(int argc, VALUE *argv, VALUE self) {
3101
+ UdpReporter *arg1 = (UdpReporter *) 0 ;
3102
+ Event *arg2 = (Event *) 0 ;
3103
+ void *argp1 = 0 ;
3104
+ int res1 = 0 ;
3105
+ void *argp2 = 0 ;
3106
+ int res2 = 0 ;
3107
+ bool result;
3108
+ VALUE vresult = Qnil;
3109
+
3110
+ if ((argc < 1) || (argc > 1)) {
3111
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3112
+ }
3113
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_UdpReporter, 0 | 0 );
3114
+ if (!SWIG_IsOK(res1)) {
3115
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "UdpReporter *","sendReport", 1, self ));
3116
+ }
3117
+ arg1 = reinterpret_cast< UdpReporter * >(argp1);
3118
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Event, 0 | 0 );
3119
+ if (!SWIG_IsOK(res2)) {
3120
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Event *","sendReport", 2, argv[0] ));
3121
+ }
3122
+ arg2 = reinterpret_cast< Event * >(argp2);
3123
+ result = (bool)(arg1)->sendReport(arg2);
3124
+ vresult = SWIG_From_bool(static_cast< bool >(result));
3125
+ return vresult;
3126
+ fail:
3127
+ return Qnil;
3128
+ }
3129
+
3130
+
3131
+ SWIGINTERN VALUE
3132
+ _wrap_UdpReporter_sendReport__SWIG_1(int argc, VALUE *argv, VALUE self) {
3133
+ UdpReporter *arg1 = (UdpReporter *) 0 ;
3134
+ Event *arg2 = (Event *) 0 ;
3135
+ oboe_metadata_t *arg3 = (oboe_metadata_t *) 0 ;
3136
+ void *argp1 = 0 ;
3137
+ int res1 = 0 ;
3138
+ void *argp2 = 0 ;
3139
+ int res2 = 0 ;
3140
+ void *argp3 = 0 ;
3141
+ int res3 = 0 ;
3142
+ bool result;
3143
+ VALUE vresult = Qnil;
3144
+
3145
+ if ((argc < 2) || (argc > 2)) {
3146
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3147
+ }
3148
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_UdpReporter, 0 | 0 );
3149
+ if (!SWIG_IsOK(res1)) {
3150
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "UdpReporter *","sendReport", 1, self ));
3151
+ }
3152
+ arg1 = reinterpret_cast< UdpReporter * >(argp1);
3153
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Event, 0 | 0 );
3154
+ if (!SWIG_IsOK(res2)) {
3155
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Event *","sendReport", 2, argv[0] ));
3156
+ }
3157
+ arg2 = reinterpret_cast< Event * >(argp2);
3158
+ res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_oboe_metadata_t, 0 | 0 );
3159
+ if (!SWIG_IsOK(res3)) {
3160
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "oboe_metadata_t *","sendReport", 3, argv[1] ));
3161
+ }
3162
+ arg3 = reinterpret_cast< oboe_metadata_t * >(argp3);
3163
+ result = (bool)(arg1)->sendReport(arg2,arg3);
3164
+ vresult = SWIG_From_bool(static_cast< bool >(result));
3165
+ return vresult;
3166
+ fail:
3167
+ return Qnil;
3168
+ }
3169
+
3170
+
3171
+ SWIGINTERN VALUE _wrap_UdpReporter_sendReport(int nargs, VALUE *args, VALUE self) {
3172
+ int argc;
3173
+ VALUE argv[4];
3174
+ int ii;
3175
+
3176
+ argc = nargs + 1;
3177
+ argv[0] = self;
3178
+ if (argc > 4) SWIG_fail;
3179
+ for (ii = 1; (ii < argc); ++ii) {
3180
+ argv[ii] = args[ii-1];
3181
+ }
3182
+ if (argc == 2) {
3183
+ int _v;
3184
+ void *vptr = 0;
3185
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_UdpReporter, 0);
3186
+ _v = SWIG_CheckState(res);
3187
+ if (_v) {
3188
+ void *vptr = 0;
3189
+ int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Event, 0);
3190
+ _v = SWIG_CheckState(res);
3191
+ if (_v) {
3192
+ return _wrap_UdpReporter_sendReport__SWIG_0(nargs, args, self);
3193
+ }
3194
+ }
3195
+ }
3196
+ if (argc == 3) {
3197
+ int _v;
3198
+ void *vptr = 0;
3199
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_UdpReporter, 0);
3200
+ _v = SWIG_CheckState(res);
3201
+ if (_v) {
3202
+ void *vptr = 0;
3203
+ int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Event, 0);
3204
+ _v = SWIG_CheckState(res);
3205
+ if (_v) {
3206
+ void *vptr = 0;
3207
+ int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_oboe_metadata_t, 0);
3208
+ _v = SWIG_CheckState(res);
3209
+ if (_v) {
3210
+ return _wrap_UdpReporter_sendReport__SWIG_1(nargs, args, self);
3211
+ }
3212
+ }
3213
+ }
3214
+ }
3215
+
3216
+ fail:
3217
+ Ruby_Format_OverloadedError( argc, 4, "UdpReporter.sendReport",
3218
+ " bool UdpReporter.sendReport(Event *evt)\n"
3219
+ " bool UdpReporter.sendReport(Event *evt, oboe_metadata_t *md)\n");
3220
+
3221
+ return Qnil;
3222
+ }
3223
+
3224
+
3225
+ swig_class SwigClassFileReporter;
3226
+
3227
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
3228
+ SWIGINTERN VALUE
3229
+ _wrap_FileReporter_allocate(VALUE self) {
3230
+ #else
3231
+ SWIGINTERN VALUE
3232
+ _wrap_FileReporter_allocate(int argc, VALUE *argv, VALUE self) {
3233
+ #endif
3234
+
3235
+
3236
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_FileReporter);
3237
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
3238
+ rb_obj_call_init(vresult, argc, argv);
3239
+ #endif
3240
+ return vresult;
3241
+ }
3242
+
3243
+
3244
+ SWIGINTERN VALUE
3245
+ _wrap_new_FileReporter(int argc, VALUE *argv, VALUE self) {
3246
+ char *arg1 = (char *) 0 ;
3247
+ int res1 ;
3248
+ char *buf1 = 0 ;
3249
+ int alloc1 = 0 ;
3250
+ FileReporter *result = 0 ;
3251
+
3252
+ if ((argc < 1) || (argc > 1)) {
3253
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3254
+ }
3255
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
3256
+ if (!SWIG_IsOK(res1)) {
3257
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","FileReporter", 1, argv[0] ));
3258
+ }
3259
+ arg1 = reinterpret_cast< char * >(buf1);
3260
+ result = (FileReporter *)new FileReporter((char const *)arg1);
3261
+ DATA_PTR(self) = result;
3262
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
3263
+ return self;
3264
+ fail:
3265
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
3266
+ return Qnil;
3267
+ }
3268
+
3269
+
3270
+ SWIGINTERN void
3271
+ free_FileReporter(FileReporter *arg1) {
3272
+ delete arg1;
3273
+ }
3274
+
3275
+ SWIGINTERN VALUE
3276
+ _wrap_FileReporter_sendReport__SWIG_0(int argc, VALUE *argv, VALUE self) {
3277
+ FileReporter *arg1 = (FileReporter *) 0 ;
3278
+ Event *arg2 = (Event *) 0 ;
3279
+ void *argp1 = 0 ;
3280
+ int res1 = 0 ;
3281
+ void *argp2 = 0 ;
3282
+ int res2 = 0 ;
3283
+ bool result;
3284
+ VALUE vresult = Qnil;
3285
+
3286
+ if ((argc < 1) || (argc > 1)) {
3287
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3288
+ }
3289
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FileReporter, 0 | 0 );
3290
+ if (!SWIG_IsOK(res1)) {
3291
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FileReporter *","sendReport", 1, self ));
3292
+ }
3293
+ arg1 = reinterpret_cast< FileReporter * >(argp1);
3294
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Event, 0 | 0 );
3295
+ if (!SWIG_IsOK(res2)) {
3296
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Event *","sendReport", 2, argv[0] ));
3297
+ }
3298
+ arg2 = reinterpret_cast< Event * >(argp2);
3299
+ result = (bool)(arg1)->sendReport(arg2);
3300
+ vresult = SWIG_From_bool(static_cast< bool >(result));
3301
+ return vresult;
3302
+ fail:
3303
+ return Qnil;
3304
+ }
3305
+
3306
+
3307
+ SWIGINTERN VALUE
3308
+ _wrap_FileReporter_sendReport__SWIG_1(int argc, VALUE *argv, VALUE self) {
3309
+ FileReporter *arg1 = (FileReporter *) 0 ;
3310
+ Event *arg2 = (Event *) 0 ;
3311
+ oboe_metadata_t *arg3 = (oboe_metadata_t *) 0 ;
3312
+ void *argp1 = 0 ;
3313
+ int res1 = 0 ;
3314
+ void *argp2 = 0 ;
3315
+ int res2 = 0 ;
3316
+ void *argp3 = 0 ;
3317
+ int res3 = 0 ;
3318
+ bool result;
3319
+ VALUE vresult = Qnil;
3320
+
3321
+ if ((argc < 2) || (argc > 2)) {
3322
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3323
+ }
3324
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FileReporter, 0 | 0 );
3325
+ if (!SWIG_IsOK(res1)) {
3326
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FileReporter *","sendReport", 1, self ));
3327
+ }
3328
+ arg1 = reinterpret_cast< FileReporter * >(argp1);
3329
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_Event, 0 | 0 );
3330
+ if (!SWIG_IsOK(res2)) {
3331
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "Event *","sendReport", 2, argv[0] ));
3332
+ }
3333
+ arg2 = reinterpret_cast< Event * >(argp2);
3334
+ res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_oboe_metadata_t, 0 | 0 );
3335
+ if (!SWIG_IsOK(res3)) {
3336
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "oboe_metadata_t *","sendReport", 3, argv[1] ));
3337
+ }
3338
+ arg3 = reinterpret_cast< oboe_metadata_t * >(argp3);
3339
+ result = (bool)(arg1)->sendReport(arg2,arg3);
3340
+ vresult = SWIG_From_bool(static_cast< bool >(result));
3341
+ return vresult;
3342
+ fail:
3343
+ return Qnil;
3344
+ }
3345
+
3346
+
3347
+ SWIGINTERN VALUE _wrap_FileReporter_sendReport(int nargs, VALUE *args, VALUE self) {
3348
+ int argc;
3349
+ VALUE argv[4];
3350
+ int ii;
3351
+
3352
+ argc = nargs + 1;
3353
+ argv[0] = self;
3354
+ if (argc > 4) SWIG_fail;
3355
+ for (ii = 1; (ii < argc); ++ii) {
3356
+ argv[ii] = args[ii-1];
3357
+ }
3358
+ if (argc == 2) {
3359
+ int _v;
3360
+ void *vptr = 0;
3361
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_FileReporter, 0);
3362
+ _v = SWIG_CheckState(res);
3363
+ if (_v) {
3364
+ void *vptr = 0;
3365
+ int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Event, 0);
3366
+ _v = SWIG_CheckState(res);
3367
+ if (_v) {
3368
+ return _wrap_FileReporter_sendReport__SWIG_0(nargs, args, self);
3369
+ }
3370
+ }
3371
+ }
3372
+ if (argc == 3) {
3373
+ int _v;
3374
+ void *vptr = 0;
3375
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_FileReporter, 0);
3376
+ _v = SWIG_CheckState(res);
3377
+ if (_v) {
3378
+ void *vptr = 0;
3379
+ int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Event, 0);
3380
+ _v = SWIG_CheckState(res);
3381
+ if (_v) {
3382
+ void *vptr = 0;
3383
+ int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_oboe_metadata_t, 0);
3384
+ _v = SWIG_CheckState(res);
3385
+ if (_v) {
3386
+ return _wrap_FileReporter_sendReport__SWIG_1(nargs, args, self);
3387
+ }
3388
+ }
3389
+ }
3390
+ }
3391
+
3392
+ fail:
3393
+ Ruby_Format_OverloadedError( argc, 4, "FileReporter.sendReport",
3394
+ " bool FileReporter.sendReport(Event *evt)\n"
3395
+ " bool FileReporter.sendReport(Event *evt, oboe_metadata_t *md)\n");
3396
+
3397
+ return Qnil;
3398
+ }
3399
+
3400
+
3401
+ swig_class SwigClassConfig;
3402
+
3403
+ SWIGINTERN VALUE
3404
+ _wrap_Config_checkVersion(int argc, VALUE *argv, VALUE self) {
3405
+ int arg1 ;
3406
+ int arg2 ;
3407
+ int val1 ;
3408
+ int ecode1 = 0 ;
3409
+ int val2 ;
3410
+ int ecode2 = 0 ;
3411
+ bool result;
3412
+ VALUE vresult = Qnil;
3413
+
3414
+ if ((argc < 2) || (argc > 2)) {
3415
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3416
+ }
3417
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3418
+ if (!SWIG_IsOK(ecode1)) {
3419
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","Config::checkVersion", 1, argv[0] ));
3420
+ }
3421
+ arg1 = static_cast< int >(val1);
3422
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
3423
+ if (!SWIG_IsOK(ecode2)) {
3424
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Config::checkVersion", 2, argv[1] ));
3425
+ }
3426
+ arg2 = static_cast< int >(val2);
3427
+ result = (bool)Config::checkVersion(arg1,arg2);
3428
+ vresult = SWIG_From_bool(static_cast< bool >(result));
3429
+ return vresult;
3430
+ fail:
3431
+ return Qnil;
3432
+ }
3433
+
3434
+
3435
+ SWIGINTERN VALUE
3436
+ _wrap_Config_getVersion(int argc, VALUE *argv, VALUE self) {
3437
+ int result;
3438
+ VALUE vresult = Qnil;
3439
+
3440
+ if ((argc < 0) || (argc > 0)) {
3441
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3442
+ }
3443
+ result = (int)Config::getVersion();
3444
+ vresult = SWIG_From_int(static_cast< int >(result));
3445
+ return vresult;
3446
+ fail:
3447
+ return Qnil;
3448
+ }
3449
+
3450
+
3451
+ SWIGINTERN VALUE
3452
+ _wrap_Config_getRevision(int argc, VALUE *argv, VALUE self) {
3453
+ int result;
3454
+ VALUE vresult = Qnil;
3455
+
3456
+ if ((argc < 0) || (argc > 0)) {
3457
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3458
+ }
3459
+ result = (int)Config::getRevision();
3460
+ vresult = SWIG_From_int(static_cast< int >(result));
3461
+ return vresult;
3462
+ fail:
3463
+ return Qnil;
3464
+ }
3465
+
3466
+
3467
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
3468
+ SWIGINTERN VALUE
3469
+ _wrap_Config_allocate(VALUE self) {
3470
+ #else
3471
+ SWIGINTERN VALUE
3472
+ _wrap_Config_allocate(int argc, VALUE *argv, VALUE self) {
3473
+ #endif
3474
+
3475
+
3476
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Config);
3477
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
3478
+ rb_obj_call_init(vresult, argc, argv);
3479
+ #endif
3480
+ return vresult;
3481
+ }
3482
+
3483
+
3484
+ SWIGINTERN VALUE
3485
+ _wrap_new_Config(int argc, VALUE *argv, VALUE self) {
3486
+ Config *result = 0 ;
3487
+
3488
+ if ((argc < 0) || (argc > 0)) {
3489
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3490
+ }
3491
+ result = (Config *)new Config();
3492
+ DATA_PTR(self) = result;
3493
+ return self;
3494
+ fail:
3495
+ return Qnil;
3496
+ }
3497
+
3498
+
3499
+ SWIGINTERN void
3500
+ free_Config(Config *arg1) {
3501
+ delete arg1;
3502
+ }
3503
+
3504
+
3505
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
3506
+
3507
+ static void *_p_MetadataTo_p_oboe_metadata_t(void *x, int *SWIGUNUSEDPARM(newmemory)) {
3508
+ return (void *)((oboe_metadata_t *) ((Metadata *) x));
3509
+ }
3510
+ static swig_type_info _swigt__p_Config = {"_p_Config", "Config *", 0, 0, (void*)0, 0};
3511
+ static swig_type_info _swigt__p_Context = {"_p_Context", "Context *", 0, 0, (void*)0, 0};
3512
+ static swig_type_info _swigt__p_Event = {"_p_Event", "Event *", 0, 0, (void*)0, 0};
3513
+ static swig_type_info _swigt__p_FileReporter = {"_p_FileReporter", "FileReporter *", 0, 0, (void*)0, 0};
3514
+ static swig_type_info _swigt__p_Metadata = {"_p_Metadata", "Metadata *", 0, 0, (void*)0, 0};
3515
+ static swig_type_info _swigt__p_UdpReporter = {"_p_UdpReporter", "UdpReporter *", 0, 0, (void*)0, 0};
3516
+ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
3517
+ static swig_type_info _swigt__p_oboe_metadata_t = {"_p_oboe_metadata_t", "oboe_metadata_t *", 0, 0, (void*)0, 0};
3518
+
3519
+ static swig_type_info *swig_type_initial[] = {
3520
+ &_swigt__p_Config,
3521
+ &_swigt__p_Context,
3522
+ &_swigt__p_Event,
3523
+ &_swigt__p_FileReporter,
3524
+ &_swigt__p_Metadata,
3525
+ &_swigt__p_UdpReporter,
3526
+ &_swigt__p_char,
3527
+ &_swigt__p_oboe_metadata_t,
3528
+ };
3529
+
3530
+ static swig_cast_info _swigc__p_Config[] = { {&_swigt__p_Config, 0, 0, 0},{0, 0, 0, 0}};
3531
+ static swig_cast_info _swigc__p_Context[] = { {&_swigt__p_Context, 0, 0, 0},{0, 0, 0, 0}};
3532
+ static swig_cast_info _swigc__p_Event[] = { {&_swigt__p_Event, 0, 0, 0},{0, 0, 0, 0}};
3533
+ static swig_cast_info _swigc__p_FileReporter[] = { {&_swigt__p_FileReporter, 0, 0, 0},{0, 0, 0, 0}};
3534
+ static swig_cast_info _swigc__p_Metadata[] = { {&_swigt__p_Metadata, 0, 0, 0},{0, 0, 0, 0}};
3535
+ static swig_cast_info _swigc__p_UdpReporter[] = { {&_swigt__p_UdpReporter, 0, 0, 0},{0, 0, 0, 0}};
3536
+ static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
3537
+ static swig_cast_info _swigc__p_oboe_metadata_t[] = { {&_swigt__p_Metadata, _p_MetadataTo_p_oboe_metadata_t, 0, 0}, {&_swigt__p_oboe_metadata_t, 0, 0, 0},{0, 0, 0, 0}};
3538
+
3539
+ static swig_cast_info *swig_cast_initial[] = {
3540
+ _swigc__p_Config,
3541
+ _swigc__p_Context,
3542
+ _swigc__p_Event,
3543
+ _swigc__p_FileReporter,
3544
+ _swigc__p_Metadata,
3545
+ _swigc__p_UdpReporter,
3546
+ _swigc__p_char,
3547
+ _swigc__p_oboe_metadata_t,
3548
+ };
3549
+
3550
+
3551
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
3552
+
3553
+ /* -----------------------------------------------------------------------------
3554
+ * Type initialization:
3555
+ * This problem is tough by the requirement that no dynamic
3556
+ * memory is used. Also, since swig_type_info structures store pointers to
3557
+ * swig_cast_info structures and swig_cast_info structures store pointers back
3558
+ * to swig_type_info structures, we need some lookup code at initialization.
3559
+ * The idea is that swig generates all the structures that are needed.
3560
+ * The runtime then collects these partially filled structures.
3561
+ * The SWIG_InitializeModule function takes these initial arrays out of
3562
+ * swig_module, and does all the lookup, filling in the swig_module.types
3563
+ * array with the correct data and linking the correct swig_cast_info
3564
+ * structures together.
3565
+ *
3566
+ * The generated swig_type_info structures are assigned staticly to an initial
3567
+ * array. We just loop through that array, and handle each type individually.
3568
+ * First we lookup if this type has been already loaded, and if so, use the
3569
+ * loaded structure instead of the generated one. Then we have to fill in the
3570
+ * cast linked list. The cast data is initially stored in something like a
3571
+ * two-dimensional array. Each row corresponds to a type (there are the same
3572
+ * number of rows as there are in the swig_type_initial array). Each entry in
3573
+ * a column is one of the swig_cast_info structures for that type.
3574
+ * The cast_initial array is actually an array of arrays, because each row has
3575
+ * a variable number of columns. So to actually build the cast linked list,
3576
+ * we find the array of casts associated with the type, and loop through it
3577
+ * adding the casts to the list. The one last trick we need to do is making
3578
+ * sure the type pointer in the swig_cast_info struct is correct.
3579
+ *
3580
+ * First off, we lookup the cast->type name to see if it is already loaded.
3581
+ * There are three cases to handle:
3582
+ * 1) If the cast->type has already been loaded AND the type we are adding
3583
+ * casting info to has not been loaded (it is in this module), THEN we
3584
+ * replace the cast->type pointer with the type pointer that has already
3585
+ * been loaded.
3586
+ * 2) If BOTH types (the one we are adding casting info to, and the
3587
+ * cast->type) are loaded, THEN the cast info has already been loaded by
3588
+ * the previous module so we just ignore it.
3589
+ * 3) Finally, if cast->type has not already been loaded, then we add that
3590
+ * swig_cast_info to the linked list (because the cast->type) pointer will
3591
+ * be correct.
3592
+ * ----------------------------------------------------------------------------- */
3593
+
3594
+ #ifdef __cplusplus
3595
+ extern "C" {
3596
+ #if 0
3597
+ } /* c-mode */
3598
+ #endif
3599
+ #endif
3600
+
3601
+ #if 0
3602
+ #define SWIGRUNTIME_DEBUG
3603
+ #endif
3604
+
3605
+
3606
+ SWIGRUNTIME void
3607
+ SWIG_InitializeModule(void *clientdata) {
3608
+ size_t i;
3609
+ swig_module_info *module_head, *iter;
3610
+ int found, init;
3611
+
3612
+ clientdata = clientdata;
3613
+
3614
+ /* check to see if the circular list has been setup, if not, set it up */
3615
+ if (swig_module.next==0) {
3616
+ /* Initialize the swig_module */
3617
+ swig_module.type_initial = swig_type_initial;
3618
+ swig_module.cast_initial = swig_cast_initial;
3619
+ swig_module.next = &swig_module;
3620
+ init = 1;
3621
+ } else {
3622
+ init = 0;
3623
+ }
3624
+
3625
+ /* Try and load any already created modules */
3626
+ module_head = SWIG_GetModule(clientdata);
3627
+ if (!module_head) {
3628
+ /* This is the first module loaded for this interpreter */
3629
+ /* so set the swig module into the interpreter */
3630
+ SWIG_SetModule(clientdata, &swig_module);
3631
+ module_head = &swig_module;
3632
+ } else {
3633
+ /* the interpreter has loaded a SWIG module, but has it loaded this one? */
3634
+ found=0;
3635
+ iter=module_head;
3636
+ do {
3637
+ if (iter==&swig_module) {
3638
+ found=1;
3639
+ break;
3640
+ }
3641
+ iter=iter->next;
3642
+ } while (iter!= module_head);
3643
+
3644
+ /* if the is found in the list, then all is done and we may leave */
3645
+ if (found) return;
3646
+ /* otherwise we must add out module into the list */
3647
+ swig_module.next = module_head->next;
3648
+ module_head->next = &swig_module;
3649
+ }
3650
+
3651
+ /* When multiple interpeters are used, a module could have already been initialized in
3652
+ a different interpreter, but not yet have a pointer in this interpreter.
3653
+ In this case, we do not want to continue adding types... everything should be
3654
+ set up already */
3655
+ if (init == 0) return;
3656
+
3657
+ /* Now work on filling in swig_module.types */
3658
+ #ifdef SWIGRUNTIME_DEBUG
3659
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
3660
+ #endif
3661
+ for (i = 0; i < swig_module.size; ++i) {
3662
+ swig_type_info *type = 0;
3663
+ swig_type_info *ret;
3664
+ swig_cast_info *cast;
3665
+
3666
+ #ifdef SWIGRUNTIME_DEBUG
3667
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
3668
+ #endif
3669
+
3670
+ /* if there is another module already loaded */
3671
+ if (swig_module.next != &swig_module) {
3672
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
3673
+ }
3674
+ if (type) {
3675
+ /* Overwrite clientdata field */
3676
+ #ifdef SWIGRUNTIME_DEBUG
3677
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
3678
+ #endif
3679
+ if (swig_module.type_initial[i]->clientdata) {
3680
+ type->clientdata = swig_module.type_initial[i]->clientdata;
3681
+ #ifdef SWIGRUNTIME_DEBUG
3682
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
3683
+ #endif
3684
+ }
3685
+ } else {
3686
+ type = swig_module.type_initial[i];
3687
+ }
3688
+
3689
+ /* Insert casting types */
3690
+ cast = swig_module.cast_initial[i];
3691
+ while (cast->type) {
3692
+
3693
+ /* Don't need to add information already in the list */
3694
+ ret = 0;
3695
+ #ifdef SWIGRUNTIME_DEBUG
3696
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
3697
+ #endif
3698
+ if (swig_module.next != &swig_module) {
3699
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
3700
+ #ifdef SWIGRUNTIME_DEBUG
3701
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
3702
+ #endif
3703
+ }
3704
+ if (ret) {
3705
+ if (type == swig_module.type_initial[i]) {
3706
+ #ifdef SWIGRUNTIME_DEBUG
3707
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
3708
+ #endif
3709
+ cast->type = ret;
3710
+ ret = 0;
3711
+ } else {
3712
+ /* Check for casting already in the list */
3713
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
3714
+ #ifdef SWIGRUNTIME_DEBUG
3715
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
3716
+ #endif
3717
+ if (!ocast) ret = 0;
3718
+ }
3719
+ }
3720
+
3721
+ if (!ret) {
3722
+ #ifdef SWIGRUNTIME_DEBUG
3723
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
3724
+ #endif
3725
+ if (type->cast) {
3726
+ type->cast->prev = cast;
3727
+ cast->next = type->cast;
3728
+ }
3729
+ type->cast = cast;
3730
+ }
3731
+ cast++;
3732
+ }
3733
+ /* Set entry in modules->types array equal to the type */
3734
+ swig_module.types[i] = type;
3735
+ }
3736
+ swig_module.types[i] = 0;
3737
+
3738
+ #ifdef SWIGRUNTIME_DEBUG
3739
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
3740
+ for (i = 0; i < swig_module.size; ++i) {
3741
+ int j = 0;
3742
+ swig_cast_info *cast = swig_module.cast_initial[i];
3743
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
3744
+ while (cast->type) {
3745
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
3746
+ cast++;
3747
+ ++j;
3748
+ }
3749
+ printf("---- Total casts: %d\n",j);
3750
+ }
3751
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
3752
+ #endif
3753
+ }
3754
+
3755
+ /* This function will propagate the clientdata field of type to
3756
+ * any new swig_type_info structures that have been added into the list
3757
+ * of equivalent types. It is like calling
3758
+ * SWIG_TypeClientData(type, clientdata) a second time.
3759
+ */
3760
+ SWIGRUNTIME void
3761
+ SWIG_PropagateClientData(void) {
3762
+ size_t i;
3763
+ swig_cast_info *equiv;
3764
+ static int init_run = 0;
3765
+
3766
+ if (init_run) return;
3767
+ init_run = 1;
3768
+
3769
+ for (i = 0; i < swig_module.size; i++) {
3770
+ if (swig_module.types[i]->clientdata) {
3771
+ equiv = swig_module.types[i]->cast;
3772
+ while (equiv) {
3773
+ if (!equiv->converter) {
3774
+ if (equiv->type && !equiv->type->clientdata)
3775
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
3776
+ }
3777
+ equiv = equiv->next;
3778
+ }
3779
+ }
3780
+ }
3781
+ }
3782
+
3783
+ #ifdef __cplusplus
3784
+ #if 0
3785
+ { /* c-mode */
3786
+ #endif
3787
+ }
3788
+ #endif
3789
+
3790
+ /*
3791
+
3792
+ */
3793
+ #ifdef __cplusplus
3794
+ extern "C"
3795
+ #endif
3796
+ SWIGEXPORT void Init_oboe_metal(void) {
3797
+ size_t i;
3798
+
3799
+ SWIG_InitRuntime();
3800
+ mOboe_metal = rb_define_module("Oboe_metal");
3801
+
3802
+ SWIG_InitializeModule(0);
3803
+ for (i = 0; i < swig_module.size; i++) {
3804
+ SWIG_define_class(swig_module.types[i]);
3805
+ }
3806
+
3807
+ SWIG_RubyInitializeTrackings();
3808
+
3809
+ SwigClassMetadata.klass = rb_define_class_under(mOboe_metal, "Metadata", rb_cObject);
3810
+ SWIG_TypeClientData(SWIGTYPE_p_Metadata, (void *) &SwigClassMetadata);
3811
+ rb_define_alloc_func(SwigClassMetadata.klass, _wrap_Metadata_allocate);
3812
+ rb_define_method(SwigClassMetadata.klass, "initialize", VALUEFUNC(_wrap_new_Metadata), -1);
3813
+ rb_define_singleton_method(SwigClassMetadata.klass, "fromString", VALUEFUNC(_wrap_Metadata_fromString), -1);
3814
+ rb_define_method(SwigClassMetadata.klass, "createEvent", VALUEFUNC(_wrap_Metadata_createEvent), -1);
3815
+ rb_define_singleton_method(SwigClassMetadata.klass, "makeRandom", VALUEFUNC(_wrap_Metadata_makeRandom), -1);
3816
+ rb_define_method(SwigClassMetadata.klass, "copy", VALUEFUNC(_wrap_Metadata_copy), -1);
3817
+ rb_define_method(SwigClassMetadata.klass, "isValid", VALUEFUNC(_wrap_Metadata_isValid), -1);
3818
+ rb_define_method(SwigClassMetadata.klass, "toString", VALUEFUNC(_wrap_Metadata_toString), -1);
3819
+ SwigClassMetadata.mark = 0;
3820
+ SwigClassMetadata.destroy = (void (*)(void *)) free_Metadata;
3821
+ SwigClassMetadata.trackObjects = 0;
3822
+
3823
+ SwigClassContext.klass = rb_define_class_under(mOboe_metal, "Context", rb_cObject);
3824
+ SWIG_TypeClientData(SWIGTYPE_p_Context, (void *) &SwigClassContext);
3825
+ rb_define_alloc_func(SwigClassContext.klass, _wrap_Context_allocate);
3826
+ rb_define_method(SwigClassContext.klass, "initialize", VALUEFUNC(_wrap_new_Context), -1);
3827
+ rb_define_singleton_method(SwigClassContext.klass, "setTracingMode", VALUEFUNC(_wrap_Context_setTracingMode), -1);
3828
+ rb_define_singleton_method(SwigClassContext.klass, "setDefaultSampleRate", VALUEFUNC(_wrap_Context_setDefaultSampleRate), -1);
3829
+ rb_define_singleton_method(SwigClassContext.klass, "sampleRequest", VALUEFUNC(_wrap_Context_sampleRequest), -1);
3830
+ rb_define_singleton_method(SwigClassContext.klass, "get", VALUEFUNC(_wrap_Context_get), -1);
3831
+ rb_define_singleton_method(SwigClassContext.klass, "toString", VALUEFUNC(_wrap_Context_toString), -1);
3832
+ rb_define_singleton_method(SwigClassContext.klass, "set", VALUEFUNC(_wrap_Context_set), -1);
3833
+ rb_define_singleton_method(SwigClassContext.klass, "fromString", VALUEFUNC(_wrap_Context_fromString), -1);
3834
+ rb_define_singleton_method(SwigClassContext.klass, "copy", VALUEFUNC(_wrap_Context_copy), -1);
3835
+ rb_define_singleton_method(SwigClassContext.klass, "clear", VALUEFUNC(_wrap_Context_clear), -1);
3836
+ rb_define_singleton_method(SwigClassContext.klass, "isValid", VALUEFUNC(_wrap_Context_isValid), -1);
3837
+ rb_define_singleton_method(SwigClassContext.klass, "init", VALUEFUNC(_wrap_Context_init), -1);
3838
+ rb_define_singleton_method(SwigClassContext.klass, "createEvent", VALUEFUNC(_wrap_Context_createEvent), -1);
3839
+ rb_define_singleton_method(SwigClassContext.klass, "startTrace", VALUEFUNC(_wrap_Context_startTrace), -1);
3840
+ SwigClassContext.mark = 0;
3841
+ SwigClassContext.destroy = (void (*)(void *)) free_Context;
3842
+ SwigClassContext.trackObjects = 0;
3843
+
3844
+ SwigClassEvent.klass = rb_define_class_under(mOboe_metal, "Event", rb_cObject);
3845
+ SWIG_TypeClientData(SWIGTYPE_p_Event, (void *) &SwigClassEvent);
3846
+ rb_undef_alloc_func(SwigClassEvent.klass);
3847
+ rb_define_method(SwigClassEvent.klass, "addInfo", VALUEFUNC(_wrap_Event_addInfo), -1);
3848
+ rb_define_method(SwigClassEvent.klass, "addEdge", VALUEFUNC(_wrap_Event_addEdge), -1);
3849
+ rb_define_method(SwigClassEvent.klass, "addEdgeStr", VALUEFUNC(_wrap_Event_addEdgeStr), -1);
3850
+ rb_define_method(SwigClassEvent.klass, "getMetadata", VALUEFUNC(_wrap_Event_getMetadata), -1);
3851
+ rb_define_method(SwigClassEvent.klass, "metadataString", VALUEFUNC(_wrap_Event_metadataString), -1);
3852
+ rb_define_singleton_method(SwigClassEvent.klass, "startTrace", VALUEFUNC(_wrap_Event_startTrace), -1);
3853
+ SwigClassEvent.mark = 0;
3854
+ SwigClassEvent.destroy = (void (*)(void *)) free_Event;
3855
+ SwigClassEvent.trackObjects = 0;
3856
+
3857
+ SwigClassUdpReporter.klass = rb_define_class_under(mOboe_metal, "UdpReporter", rb_cObject);
3858
+ SWIG_TypeClientData(SWIGTYPE_p_UdpReporter, (void *) &SwigClassUdpReporter);
3859
+ rb_define_alloc_func(SwigClassUdpReporter.klass, _wrap_UdpReporter_allocate);
3860
+ rb_define_method(SwigClassUdpReporter.klass, "initialize", VALUEFUNC(_wrap_new_UdpReporter), -1);
3861
+ rb_define_method(SwigClassUdpReporter.klass, "sendReport", VALUEFUNC(_wrap_UdpReporter_sendReport), -1);
3862
+ SwigClassUdpReporter.mark = 0;
3863
+ SwigClassUdpReporter.destroy = (void (*)(void *)) free_UdpReporter;
3864
+ SwigClassUdpReporter.trackObjects = 0;
3865
+
3866
+ SwigClassFileReporter.klass = rb_define_class_under(mOboe_metal, "FileReporter", rb_cObject);
3867
+ SWIG_TypeClientData(SWIGTYPE_p_FileReporter, (void *) &SwigClassFileReporter);
3868
+ rb_define_alloc_func(SwigClassFileReporter.klass, _wrap_FileReporter_allocate);
3869
+ rb_define_method(SwigClassFileReporter.klass, "initialize", VALUEFUNC(_wrap_new_FileReporter), -1);
3870
+ rb_define_method(SwigClassFileReporter.klass, "sendReport", VALUEFUNC(_wrap_FileReporter_sendReport), -1);
3871
+ SwigClassFileReporter.mark = 0;
3872
+ SwigClassFileReporter.destroy = (void (*)(void *)) free_FileReporter;
3873
+ SwigClassFileReporter.trackObjects = 0;
3874
+
3875
+ SwigClassConfig.klass = rb_define_class_under(mOboe_metal, "Config", rb_cObject);
3876
+ SWIG_TypeClientData(SWIGTYPE_p_Config, (void *) &SwigClassConfig);
3877
+ rb_define_alloc_func(SwigClassConfig.klass, _wrap_Config_allocate);
3878
+ rb_define_method(SwigClassConfig.klass, "initialize", VALUEFUNC(_wrap_new_Config), -1);
3879
+ rb_define_singleton_method(SwigClassConfig.klass, "checkVersion", VALUEFUNC(_wrap_Config_checkVersion), -1);
3880
+ rb_define_singleton_method(SwigClassConfig.klass, "getVersion", VALUEFUNC(_wrap_Config_getVersion), -1);
3881
+ rb_define_singleton_method(SwigClassConfig.klass, "getRevision", VALUEFUNC(_wrap_Config_getRevision), -1);
3882
+ SwigClassConfig.mark = 0;
3883
+ SwigClassConfig.destroy = (void (*)(void *)) free_Config;
3884
+ SwigClassConfig.trackObjects = 0;
3885
+ }
3886
+