ext/oboe_metal/src/oboe_wrap.cxx in oboe-2.1.3 vs ext/oboe_metal/src/oboe_wrap.cxx in oboe-2.1.4

- old
+ new

@@ -1,8 +1,8 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.8 + * Version 2.0.4 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make * changes to this file unless you know what you are doing--modify the SWIG * interface file instead. @@ -1550,11 +1550,11 @@ /* Check the object's type and make sure it has the correct type. It might not in cases where methods do things like downcast methods. */ if (obj != Qnil) { VALUE value = rb_iv_get(obj, "@__swigtype__"); - const char* type_name = RSTRING_PTR(value); + char* type_name = RSTRING_PTR(value); if (strcmp(type->name, type_name) == 0) { return obj; } } @@ -1811,19 +1811,20 @@ /* -------- TYPES TABLE (BEGIN) -------- */ -#define SWIGTYPE_p_Context swig_types[0] -#define SWIGTYPE_p_Event swig_types[1] -#define SWIGTYPE_p_FileReporter swig_types[2] -#define SWIGTYPE_p_Metadata swig_types[3] -#define SWIGTYPE_p_UdpReporter swig_types[4] -#define SWIGTYPE_p_char swig_types[5] -#define SWIGTYPE_p_oboe_metadata_t swig_types[6] -static swig_type_info *swig_types[8]; -static swig_module_info swig_module = {swig_types, 7, 0, 0, 0, 0}; +#define SWIGTYPE_p_Config swig_types[0] +#define SWIGTYPE_p_Context swig_types[1] +#define SWIGTYPE_p_Event swig_types[2] +#define SWIGTYPE_p_FileReporter swig_types[3] +#define SWIGTYPE_p_Metadata swig_types[4] +#define SWIGTYPE_p_UdpReporter swig_types[5] +#define SWIGTYPE_p_char swig_types[6] +#define SWIGTYPE_p_oboe_metadata_t swig_types[7] +static swig_type_info *swig_types[9]; +static swig_module_info swig_module = {swig_types, 8, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) /* -------- TYPES TABLE (END) -------- */ @@ -1834,11 +1835,11 @@ #define SWIG_RUBY_THREAD_BEGIN_BLOCK #define SWIG_RUBY_THREAD_END_BLOCK -#define SWIGVERSION 0x020008 +#define SWIGVERSION 0x020004 #define SWIG_VERSION SWIGVERSION #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) @@ -1964,21 +1965,28 @@ { return SWIG_FromCharPtrAndSize(s.data(), s.size()); } +#include <limits.h> +#if !defined(SWIG_NO_LLONG_MAX) +# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) +# define LLONG_MAX __LONG_LONG_MAX__ +# define LLONG_MIN (-LLONG_MAX - 1LL) +# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) +# endif +#endif - SWIGINTERN VALUE SWIG_ruby_failed(void) { return Qnil; } -/*@SWIG:/usr/local/share/swig/2.0.8/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/ +/*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args) { VALUE obj = args[0]; VALUE type = TYPE(obj); long *res = (long *)(args[1]); @@ -2003,11 +2011,30 @@ } return SWIG_TypeError; } -/*@SWIG:/usr/local/share/swig/2.0.8/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/ +SWIGINTERN int +SWIG_AsVal_int (VALUE obj, int *val) +{ + long v; + int res = SWIG_AsVal_long (obj, &v); + if (SWIG_IsOK(res)) { + if ((v < INT_MIN || v > INT_MAX)) { + return SWIG_OverflowError; + } else { + if (val) *val = static_cast< int >(v); + } + } + return res; +} + + + + + +/*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/ SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE *args) { VALUE obj = args[0]; VALUE type = TYPE(obj); double *res = (double *)(args[1]); @@ -2031,12 +2058,22 @@ } } return SWIG_TypeError; } -static swig_class SwigClassMetadata; + #define SWIG_From_long LONG2NUM + + +SWIGINTERNINLINE VALUE +SWIG_From_int (int value) +{ + return SWIG_From_long (value); +} + +swig_class SwigClassMetadata; + #ifdef HAVE_RB_DEFINE_ALLOC_FUNC SWIGINTERN VALUE _wrap_Metadata_allocate(VALUE self) { #else SWIGINTERN VALUE @@ -2097,11 +2134,11 @@ } arg1 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } result = (Metadata *)Metadata::fromString(arg1); - vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Metadata, 0 | 0 ); + vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Metadata, SWIG_POINTER_OWN | 0 ); return vresult; fail: return Qnil; } @@ -2216,13 +2253,101 @@ fail: return Qnil; } -static swig_class SwigClassContext; +swig_class SwigClassContext; SWIGINTERN VALUE +_wrap_Context_setTracingMode(int argc, VALUE *argv, VALUE self) { + int arg1 ; + int val1 ; + int ecode1 = 0 ; + + if ((argc < 1) || (argc > 1)) { + rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; + } + ecode1 = SWIG_AsVal_int(argv[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","Context::setTracingMode", 1, argv[0] )); + } + arg1 = static_cast< int >(val1); + Context::setTracingMode(arg1); + return Qnil; +fail: + return Qnil; +} + + +SWIGINTERN VALUE +_wrap_Context_setDefaultSampleRate(int argc, VALUE *argv, VALUE self) { + int arg1 ; + int val1 ; + int ecode1 = 0 ; + + if ((argc < 1) || (argc > 1)) { + rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; + } + ecode1 = SWIG_AsVal_int(argv[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","Context::setDefaultSampleRate", 1, argv[0] )); + } + arg1 = static_cast< int >(val1); + Context::setDefaultSampleRate(arg1); + return Qnil; +fail: + return Qnil; +} + + +SWIGINTERN VALUE +_wrap_Context_sampleRequest(int argc, VALUE *argv, VALUE self) { + std::string arg1 ; + std::string arg2 ; + std::string arg3 ; + bool result; + VALUE vresult = Qnil; + + if ((argc < 3) || (argc > 3)) { + rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail; + } + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(argv[0], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::string","Context::sampleRequest", 1, argv[0] )); + } + arg1 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(argv[1], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::string","Context::sampleRequest", 2, argv[1] )); + } + arg2 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(argv[2], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), Ruby_Format_TypeError( "", "std::string","Context::sampleRequest", 3, argv[2] )); + } + arg3 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + result = (bool)Context::sampleRequest(arg1,arg2,arg3); + vresult = SWIG_From_bool(static_cast< bool >(result)); + return vresult; +fail: + return Qnil; +} + + +SWIGINTERN VALUE _wrap_Context_get(int argc, VALUE *argv, VALUE self) { oboe_metadata_t *result = 0 ; VALUE vresult = Qnil; if ((argc < 0) || (argc > 0)) { @@ -2419,11 +2544,11 @@ SWIGINTERN void free_Context(Context *arg1) { delete arg1; } -static swig_class SwigClassEvent; +swig_class SwigClassEvent; SWIGINTERN void free_Event(Event *arg1) { delete arg1; } @@ -2732,10 +2857,49 @@ return Qnil; } SWIGINTERN VALUE +_wrap_Event_addEdgeStr(int argc, VALUE *argv, VALUE self) { + Event *arg1 = (Event *) 0 ; + std::string *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 = SWIG_OLDOBJ ; + bool result; + VALUE vresult = Qnil; + + if ((argc < 1) || (argc > 1)) { + rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; + } + res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Event *","addEdgeStr", 1, self )); + } + arg1 = reinterpret_cast< Event * >(argp1); + { + std::string *ptr = (std::string *)0; + res2 = SWIG_AsPtr_std_string(argv[0], &ptr); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","addEdgeStr", 2, argv[0] )); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","addEdgeStr", 2, argv[0])); + } + arg2 = ptr; + } + result = (bool)(arg1)->addEdgeStr((std::string const &)*arg2); + vresult = SWIG_From_bool(static_cast< bool >(result)); + if (SWIG_IsNewObj(res2)) delete arg2; + return vresult; +fail: + if (SWIG_IsNewObj(res2)) delete arg2; + return Qnil; +} + + +SWIGINTERN VALUE _wrap_Event_getMetadata(int argc, VALUE *argv, VALUE self) { Event *arg1 = (Event *) 0 ; void *argp1 = 0 ; int res1 = 0 ; Metadata *result = 0 ; @@ -2796,18 +2960,18 @@ if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "oboe_metadata_t const *","Event::startTrace", 1, argv[0] )); } arg1 = reinterpret_cast< oboe_metadata_t * >(argp1); result = (Event *)Event::startTrace((oboe_metadata_t const *)arg1); - vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Event, 0 | 0 ); + vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Event, SWIG_POINTER_OWN | 0 ); return vresult; fail: return Qnil; } -static swig_class SwigClassUdpReporter; +swig_class SwigClassUdpReporter; SWIGINTERN VALUE _wrap_new_UdpReporter__SWIG_0(int argc, VALUE *argv, VALUE self) { char *arg1 = (char *) 0 ; char *arg2 = (char *) 0 ; @@ -3056,11 +3220,11 @@ return Qnil; } -static swig_class SwigClassFileReporter; +swig_class SwigClassFileReporter; #ifdef HAVE_RB_DEFINE_ALLOC_FUNC SWIGINTERN VALUE _wrap_FileReporter_allocate(VALUE self) { #else @@ -3232,43 +3396,150 @@ return Qnil; } +swig_class SwigClassConfig; +SWIGINTERN VALUE +_wrap_Config_checkVersion(int argc, VALUE *argv, VALUE self) { + int arg1 ; + int arg2 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + bool result; + VALUE vresult = Qnil; + + if ((argc < 2) || (argc > 2)) { + rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; + } + ecode1 = SWIG_AsVal_int(argv[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","Config::checkVersion", 1, argv[0] )); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(argv[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Config::checkVersion", 2, argv[1] )); + } + arg2 = static_cast< int >(val2); + result = (bool)Config::checkVersion(arg1,arg2); + vresult = SWIG_From_bool(static_cast< bool >(result)); + return vresult; +fail: + return Qnil; +} + + +SWIGINTERN VALUE +_wrap_Config_getVersion(int argc, VALUE *argv, VALUE self) { + int result; + VALUE vresult = Qnil; + + if ((argc < 0) || (argc > 0)) { + rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; + } + result = (int)Config::getVersion(); + vresult = SWIG_From_int(static_cast< int >(result)); + return vresult; +fail: + return Qnil; +} + + +SWIGINTERN VALUE +_wrap_Config_getRevision(int argc, VALUE *argv, VALUE self) { + int result; + VALUE vresult = Qnil; + + if ((argc < 0) || (argc > 0)) { + rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; + } + result = (int)Config::getRevision(); + vresult = SWIG_From_int(static_cast< int >(result)); + return vresult; +fail: + return Qnil; +} + + +#ifdef HAVE_RB_DEFINE_ALLOC_FUNC +SWIGINTERN VALUE +_wrap_Config_allocate(VALUE self) { +#else + SWIGINTERN VALUE + _wrap_Config_allocate(int argc, VALUE *argv, VALUE self) { +#endif + + + VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Config); +#ifndef HAVE_RB_DEFINE_ALLOC_FUNC + rb_obj_call_init(vresult, argc, argv); +#endif + return vresult; + } + + +SWIGINTERN VALUE +_wrap_new_Config(int argc, VALUE *argv, VALUE self) { + Config *result = 0 ; + + if ((argc < 0) || (argc > 0)) { + rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; + } + result = (Config *)new Config(); + DATA_PTR(self) = result; + return self; +fail: + return Qnil; +} + + +SWIGINTERN void +free_Config(Config *arg1) { + delete arg1; +} + + /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ static void *_p_MetadataTo_p_oboe_metadata_t(void *x, int *SWIGUNUSEDPARM(newmemory)) { return (void *)((oboe_metadata_t *) ((Metadata *) x)); } +static swig_type_info _swigt__p_Config = {"_p_Config", "Config *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Context = {"_p_Context", "Context *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Event = {"_p_Event", "Event *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_FileReporter = {"_p_FileReporter", "FileReporter *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Metadata = {"_p_Metadata", "Metadata *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_UdpReporter = {"_p_UdpReporter", "UdpReporter *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_oboe_metadata_t = {"_p_oboe_metadata_t", "oboe_metadata_t *", 0, 0, (void*)0, 0}; static swig_type_info *swig_type_initial[] = { + &_swigt__p_Config, &_swigt__p_Context, &_swigt__p_Event, &_swigt__p_FileReporter, &_swigt__p_Metadata, &_swigt__p_UdpReporter, &_swigt__p_char, &_swigt__p_oboe_metadata_t, }; +static swig_cast_info _swigc__p_Config[] = { {&_swigt__p_Config, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Context[] = { {&_swigt__p_Context, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Event[] = { {&_swigt__p_Event, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_FileReporter[] = { {&_swigt__p_FileReporter, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Metadata[] = { {&_swigt__p_Metadata, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_UdpReporter[] = { {&_swigt__p_UdpReporter, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; 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}}; static swig_cast_info *swig_cast_initial[] = { + _swigc__p_Config, _swigc__p_Context, _swigc__p_Event, _swigc__p_FileReporter, _swigc__p_Metadata, _swigc__p_UdpReporter, @@ -3335,12 +3606,13 @@ SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { size_t i; swig_module_info *module_head, *iter; int found, init; - (void *)clientdata; + clientdata = clientdata; + /* check to see if the circular list has been setup, if not, set it up */ if (swig_module.next==0) { /* Initialize the swig_module */ swig_module.type_initial = swig_type_initial; swig_module.cast_initial = swig_cast_initial; @@ -3550,10 +3822,13 @@ SwigClassContext.klass = rb_define_class_under(mOboe_metal, "Context", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_Context, (void *) &SwigClassContext); rb_define_alloc_func(SwigClassContext.klass, _wrap_Context_allocate); rb_define_method(SwigClassContext.klass, "initialize", VALUEFUNC(_wrap_new_Context), -1); + rb_define_singleton_method(SwigClassContext.klass, "setTracingMode", VALUEFUNC(_wrap_Context_setTracingMode), -1); + rb_define_singleton_method(SwigClassContext.klass, "setDefaultSampleRate", VALUEFUNC(_wrap_Context_setDefaultSampleRate), -1); + rb_define_singleton_method(SwigClassContext.klass, "sampleRequest", VALUEFUNC(_wrap_Context_sampleRequest), -1); rb_define_singleton_method(SwigClassContext.klass, "get", VALUEFUNC(_wrap_Context_get), -1); rb_define_singleton_method(SwigClassContext.klass, "toString", VALUEFUNC(_wrap_Context_toString), -1); rb_define_singleton_method(SwigClassContext.klass, "set", VALUEFUNC(_wrap_Context_set), -1); rb_define_singleton_method(SwigClassContext.klass, "fromString", VALUEFUNC(_wrap_Context_fromString), -1); rb_define_singleton_method(SwigClassContext.klass, "copy", VALUEFUNC(_wrap_Context_copy), -1); @@ -3569,10 +3844,11 @@ SwigClassEvent.klass = rb_define_class_under(mOboe_metal, "Event", rb_cObject); SWIG_TypeClientData(SWIGTYPE_p_Event, (void *) &SwigClassEvent); rb_undef_alloc_func(SwigClassEvent.klass); rb_define_method(SwigClassEvent.klass, "addInfo", VALUEFUNC(_wrap_Event_addInfo), -1); rb_define_method(SwigClassEvent.klass, "addEdge", VALUEFUNC(_wrap_Event_addEdge), -1); + rb_define_method(SwigClassEvent.klass, "addEdgeStr", VALUEFUNC(_wrap_Event_addEdgeStr), -1); rb_define_method(SwigClassEvent.klass, "getMetadata", VALUEFUNC(_wrap_Event_getMetadata), -1); rb_define_method(SwigClassEvent.klass, "metadataString", VALUEFUNC(_wrap_Event_metadataString), -1); rb_define_singleton_method(SwigClassEvent.klass, "startTrace", VALUEFUNC(_wrap_Event_startTrace), -1); SwigClassEvent.mark = 0; SwigClassEvent.destroy = (void (*)(void *)) free_Event; @@ -3593,7 +3869,18 @@ rb_define_method(SwigClassFileReporter.klass, "initialize", VALUEFUNC(_wrap_new_FileReporter), -1); rb_define_method(SwigClassFileReporter.klass, "sendReport", VALUEFUNC(_wrap_FileReporter_sendReport), -1); SwigClassFileReporter.mark = 0; SwigClassFileReporter.destroy = (void (*)(void *)) free_FileReporter; SwigClassFileReporter.trackObjects = 0; + + SwigClassConfig.klass = rb_define_class_under(mOboe_metal, "Config", rb_cObject); + SWIG_TypeClientData(SWIGTYPE_p_Config, (void *) &SwigClassConfig); + rb_define_alloc_func(SwigClassConfig.klass, _wrap_Config_allocate); + rb_define_method(SwigClassConfig.klass, "initialize", VALUEFUNC(_wrap_new_Config), -1); + rb_define_singleton_method(SwigClassConfig.klass, "checkVersion", VALUEFUNC(_wrap_Config_checkVersion), -1); + rb_define_singleton_method(SwigClassConfig.klass, "getVersion", VALUEFUNC(_wrap_Config_getVersion), -1); + rb_define_singleton_method(SwigClassConfig.klass, "getRevision", VALUEFUNC(_wrap_Config_getRevision), -1); + SwigClassConfig.mark = 0; + SwigClassConfig.destroy = (void (*)(void *)) free_Config; + SwigClassConfig.trackObjects = 0; }