7
%newobject Bar::get_new_foo;
9
%typemap(in, numinputs=0) Foo** foo (Foo *temp) {
10
/* %typemap(in, numinputs=0) Foo** foo */
14
%typemap(argout) Foo** foo {
15
/* %typemap(argout) Foo** foo */
16
$result = SWIG_NewPointerObj((void *) *$1, $*1_descriptor, 0);
19
%apply SWIGTYPE *DISOWN {Foo* ownedFoo};
33
/* Helper method that can be called from Ruby that checks
34
that two Ruby objects are pointing to the same underlying
36
bool cpp_equal(const Foo* other)
38
return (this == other);
41
/* Just a simple method to call on Foo*/
55
Bar(): owned_(new Foo), unowned_(0)
64
/* Test that track objects works with %newobject */
65
static Foo* get_new_foo()
70
/* Test the same foo Ruby object is created each time */
76
/* Test that track objects works with argout parameters.*/
77
void get_owned_foo_by_argument(Foo** foo)
82
/* Test that track objects works with the DISOWN typemap.*/
83
void set_owned_foo(Foo* ownedFoo)
89
Foo* get_unowned_foo()
94
void set_unowned_foo(Foo* foo)
104
class ItemB: public ItemA
109
ItemB* downcast(ItemA* item)
111
return static_cast<ItemB*>(item);
7
%newobject Bar::get_new_foo;
9
%typemap(in, numinputs=0) Foo** foo (Foo *temp) {
10
/* %typemap(in, numinputs=0) Foo** foo */
14
%typemap(argout) Foo** foo {
15
/* %typemap(argout) Foo** foo */
16
$result = SWIG_NewPointerObj((void *) *$1, $*1_descriptor, 0);
19
%apply SWIGTYPE *DISOWN {Foo* ownedFoo};
33
/* Helper method that can be called from Ruby that checks
34
that two Ruby objects are pointing to the same underlying
36
bool cpp_equal(const Foo* other)
38
return (this == other);
41
/* Just a simple method to call on Foo*/
42
const char* say_hello()
55
Bar(): owned_(new Foo), unowned_(0)
64
/* Test that track objects works with %newobject */
65
static Foo* get_new_foo()
70
/* Test the same foo Ruby object is created each time */
76
/* Test that track objects works with argout parameters.*/
77
void get_owned_foo_by_argument(Foo** foo)
82
/* Test that track objects works with the DISOWN typemap.*/
83
void set_owned_foo(Foo* ownedFoo)
89
Foo* get_unowned_foo()
94
void set_unowned_foo(Foo* foo)
104
class ItemB: public ItemA
109
ItemB* downcast(ItemA* item)
111
return static_cast<ItemB*>(item);