[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Addressing problem between Tcl and C++



Hi

I have a problem with sending adresses from Tcl to different
C++-objects. I create a subclass to mac.cc that's specific to the
Mac-protocol I'm trying to create. The constructor in this class calls
first of all the mac-constructor and then executes it's own constructor.
This constructor is called from 'add-interface'-procedure within
mobile_node.tcl to create an object of this type. I also create other
objects from this procedure, and I want to send these new objects
addresses to my mac object and some other objects.
After this I try to pass the address of this object from mobile_node.tcl
to other objects thruogh the 'command' function within the receiving
(C++)-objects. This is where I get some problems. There's no problem
receiving the correct address in objects that inherit from connector or
some other 'top-level'-class, but when I try to receive the correct
address in my mac object I get the wrong  address. If I, on the other
hand, receives the objects address in the base class mac.cc then I get
the correct address.
The question is: why's this happening? Does Tcl use some sort of
relative addressing instead of absolute addressing? I have some debug
printing in mobile_node.tcl and it's always the same object (='_o16')
that I use to send the address from, it works in the same way as when
setting sendtarget and recvtarget, and the only time I get the wrong
address is when I want to send the address to my inherited mac-class.
I would really like to get some answers to this problem.

Best regards
/Johan Nielsen