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

Re: [ns] problem in binding new class variable



Hi, Sergio.

As mentioned on Marc Greis' tutoral - VII.3 Necessary Changes
(http://www.isi.edu/nsnam/ns/tutorial/nsnew.html#third):

The file 'tcl/lib/ns-default.tcl' has to be edited too. This is the file
where all default values for the Tcl objects are defined. Insert the
following line to set '0' as the default value of your new variable:

Agent/LossMonitor set newvar_ 0

Best regards,

--Lipas


----- Original Message -----
From: "Sergio Andreozzi" <[email protected]>
To: <[email protected]>
Sent: Tuesday, June 05, 2001 4:56 PM
Subject: [ns] problem in binding new class variable


> I need to add some class variable to Agent/LossMonitor.
> I added the definition of the variable in the loss-monitor.h
>
> class LossMonitor : public Agent {
> public:
>  LossMonitor();
>  virtual int command(int argc, const char*const* argv);
>  virtual void recv(Packet* pkt, Handler*);
> protected:
>     ........
>          int newvar_;
>
>
>
> LossMonitor::LossMonitor() : Agent(PT_NTYPE)
> {   ..........
>      newvar=0;
>      bind("newvar_", &newvar_);
> }
>
>
> I compiled and all seemed to be good.
>
> When I execute a script I receive the following message:
>
> warning: no class variable Agent/LossMonitor::newvar_
>
> I don't understand where is the problem. Any other change to do???
>
> Thanks for your help
>
> Sergio
>
>
>
>