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

problems with binding variables.



Hi,

I am trying to add a new integer variable, pt_, to the Class Queue
(defined in
queue.h). I am also binding it to a variable pt_ so that I can change it
from the interpreter, and have a initializer statement in
ns-default.tcl. The problem is that the default value is not reflected
in the running code.  Specifically, this is what I am doing.

In queue.h

class Queue:: public Connector{
    :
     :



protected:
    int pt_ ; // this is a new variable
}

In queue.cc, in the constructor

Queue::Queue(): ....
{
:
:
bind("pt_", &pt_); // binding to a variable otcl variable pt_
}

In ns-2/tcl/ns-default-tcl

Queue set pt_ 10 // initializing the variable pt_


The problem is that pt_ does not get initialized to 10. Do I have
something else?


Thanks for the help,

regards

Rajesh