« Return to Thread: Recognizing the same objects

Recognizing the same objects

by Daniel K. O.-2 :: Rate this Message:

Reply to Author | View in Thread

Hello everybody.

Is it possible to make SWIG recognize that 2 objects are actually the
same [wrapped object]? Like:

void setFoo(Foo *f);
Foo* getFoo();

So in the wrapped code (e.g. python):

x = Foo()
x.name = "some data" # data appended in the python's side
setFoo(x)

a = getFoo()
b = getFoo()

print a.name
print b.name

And I would like the print output to be "some data".
Assuming I can add data members to Foo itself (in the original C++
class), would it be possible?

Otherwise I might need to redesign the API (any suggestion?) or stick
with python+pyrex.


Regards


--
Daniel K. O.
"The only way to succeed is to build success yourself"

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user

 « Return to Thread: Recognizing the same objects

LightInTheBox - Buy quality products at wholesale price