Class: Cbc_wrapper::IntArray
- Inherits:
-
Object
- Object
- Cbc_wrapper::IntArray
- Defined in:
- ext/cbc-wrapper/cbc_wrap.c
Class Method Summary collapse
Instance Method Summary collapse
-
#[](*args) ⇒ Object
call-seq: [](index) -> int.
-
#[]=(*args) ⇒ Object
call-seq: []=(index, value).
- #cast(*args) ⇒ Object
- #initialize(*args) ⇒ Object constructor
Constructor Details
#initialize(*args) ⇒ Object
2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 |
# File 'ext/cbc-wrapper/cbc_wrap.c', line 2264
SWIGINTERN VALUE
_wrap_new_IntArray(int argc, VALUE *argv, VALUE self) {
size_t arg1 ;
size_t val1 ;
int ecode1 = 0 ;
IntArray *result = 0 ;
if ((argc < 1) || (argc > 1)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
}
ecode1 = SWIG_AsVal_size_t(argv[0], &val1);
if (!SWIG_IsOK(ecode1)) {
SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "size_t","IntArray", 1, argv[0] ));
}
arg1 = (size_t)(val1);
result = (IntArray *)new_IntArray(arg1);
DATA_PTR(self) = result;
return self;
fail:
return Qnil;
}
|
Class Method Details
.frompointer(*args) ⇒ Object
2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 |
# File 'ext/cbc-wrapper/cbc_wrap.c', line 2405
SWIGINTERN VALUE
_wrap_IntArray_frompointer(int argc, VALUE *argv, VALUE self) {
int *arg1 = (int *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
IntArray *result = 0 ;
VALUE vresult = Qnil;
if ((argc < 1) || (argc > 1)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_int, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "int *","IntArray_frompointer", 1, argv[0] ));
}
arg1 = (int *)(argp1);
result = (IntArray *)IntArray_frompointer(arg1);
vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_IntArray, 0 | 0 );
return vresult;
fail:
return Qnil;
}
|
Instance Method Details
#[](*args) ⇒ Object
call-seq:
[](index) -> int
Element accessor/slicing.
2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 |
# File 'ext/cbc-wrapper/cbc_wrap.c', line 2304
SWIGINTERN VALUE
_wrap_IntArray___getitem__(int argc, VALUE *argv, VALUE self) {
IntArray *arg1 = (IntArray *) 0 ;
size_t arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int ecode2 = 0 ;
int 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_IntArray, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "IntArray *","__getitem__", 1, self ));
}
arg1 = (IntArray *)(argp1);
ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","__getitem__", 2, argv[0] ));
}
arg2 = (size_t)(val2);
result = (int)IntArray___getitem__(arg1,arg2);
vresult = SWIG_From_int((int)(result));
return vresult;
fail:
return Qnil;
}
|
#[]=(*args) ⇒ Object
call-seq:
[]=(index, value)
Element setter/slicing.
2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 |
# File 'ext/cbc-wrapper/cbc_wrap.c', line 2344
SWIGINTERN VALUE
_wrap_IntArray___setitem__(int argc, VALUE *argv, VALUE self) {
IntArray *arg1 = (IntArray *) 0 ;
size_t arg2 ;
int arg3 ;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int ecode2 = 0 ;
int val3 ;
int ecode3 = 0 ;
if ((argc < 2) || (argc > 2)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_IntArray, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "IntArray *","__setitem__", 1, self ));
}
arg1 = (IntArray *)(argp1);
ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","__setitem__", 2, argv[0] ));
}
arg2 = (size_t)(val2);
ecode3 = SWIG_AsVal_int(argv[1], &val3);
if (!SWIG_IsOK(ecode3)) {
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","__setitem__", 3, argv[1] ));
}
arg3 = (int)(val3);
IntArray___setitem__(arg1,arg2,arg3);
return Qnil;
fail:
return Qnil;
}
|
#cast(*args) ⇒ Object
2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 |
# File 'ext/cbc-wrapper/cbc_wrap.c', line 2381
SWIGINTERN VALUE
_wrap_IntArray_cast(int argc, VALUE *argv, VALUE self) {
IntArray *arg1 = (IntArray *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int *result = 0 ;
VALUE vresult = Qnil;
if ((argc < 0) || (argc > 0)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_IntArray, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "IntArray *","cast", 1, self ));
}
arg1 = (IntArray *)(argp1);
result = (int *)IntArray_cast(arg1);
vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 );
return vresult;
fail:
return Qnil;
}
|