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

[ns] How to obtain a member of another class instanced in Tcl



Hi, everyone
My problem is as follows:-
I define a TclObject P, which is a queue. Its equivalent shadow object
PQueue has a member B, which is an agent in C++. I want to attach agent B to
a node. Can I obtain this agent in Tcl and then use it in the attach-agent
command? I am confused in Tcl how to obtain or copy a member defined in C++.
If I implement a PQueue::command, tcl.resultf("%s", B->name()) only
transfers the name other than the object to Tcl. And the command can only
return TCL_OK or TCL_ERROR. Does NS exist such a mechanism to transfer an
object to Tcl? Any advice is highly appreciated. Thanks!

Rdgs,
Zhigao