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

Re: [ns] how to access otcl object in C++?



You might want to check the chapter on Otcl linkage in the NS manual.

Debo

On Sun, 23 Sep 2001, dupacks wrote:

> hi everyone.
> I've got problem in my simulation code.
> I have to access otcl object in C++ code.
> 
> ========================================
> Class Link
> 
> Link instproc init { src dst } {
>         $self next
>         
>         # Debo
>         $self instvar id_
>         set id_ [Link set nl_]
>         Link set nl_ [expr $id_ + 1]
>         
> # puts -nonewline "Link "
> # puts " $id_  init"
> 
>         #modified for interface code
>         $self instvar trace_ fromNode_ toNode_ color_ oldColor_
>         set fromNode_ $src
>         set toNode_   $dst
>         set color_ "black"
>         set oldColor_ "black"
> 
>         set trace_ ""
> }
> =======================================
> 
> for example, I have some method.
> short a(...)
> {
>        ....
>        NsObject* obj = xxxxxx;
> }
> 
> obj should fromNode_ in Link type class.
> how to write code at xxxxxx?
> 
> thanks in advance.
> Jini.
> 
>