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

[ns] Fw: Fw: RE .access variables in different class



 
HI,
   Sorry for one mistake in my last email,
   To get the handle of UdpAgent, 
      udp_handle= (UdpAgent *) TclObject::lookup(argv[2]); 
       return TCL_OK;



Hi,
   You should get the handle for that class(UdpAgent) first, then you can access  its public memeber.
   In Tcl script:
   $udp [new Agent/UDP]
   Then the handle is $udp   
   In order to get it in CBR_traffic.cc, you should add one more command entry in function in this file:
  command ( int argc ,const char*const)
  {
      if (strcmp(argv[1], "attach-udp-handle")= = 0)
           udp_handle=argv[2];
           return (TCL_OK);
      )
Finally in your Tcl script:
  $cbr0 attach-udp-handle $udp
  Then you can use udp_handle to access any public menbers of UdpAgent.
Hope it can work.
Best Regards,