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

Re: [ns] Command method




Command method is used to call C++ command procedures for the given
shadow class from OTcl.
when the following line is called from class rtprotoDV method in OTcl:
$self send-update [$peers_($nbr) addr?] [$peers_($nbr) port?] $id [array
size update]

the foll line in rtProtoDV.cc's command method gets executed
int rtProtoDV::command(int argc, const char*const* argv)
{
	if (strcmp(argv[1], "send-update") == 0) {
	...

you can explicitly call command by
$self cmd send-update ..
or as in this case it checks if an OTcl send-update method is defined, if
not calls the command function in C++ implicitly.
--Padma.

On Wed, 21 Mar 2001, Andrea Josi wrote:


> Hi everybody,
> i'm reading chapter 3 of NS manual, and i can't
> understand the use of the COMMAND method;
> perhaps the reason is that the use of splitObjects is
> not clear to me;
>
> * it seems that the COMMAND method is used when an
> OTCL method is called although its only implementation
> is in C++, is that correct ?
>
> * if that's correct, then why for example in the
> rtProtoDV COMMAND method (in rtProtoDV.cc) there is a
> call to the sendpkt method although there are "send"
> methods in route-proto.tcl ?
>
> * has this something to do with the fact that in NS
> routing is done in OTCL and packet manipulation in C++
> ? (again, is that correct ?)
>
> Thanks a lot in advance.
>
>
> ______________________________________________________________________
> Do You Yahoo!?
> Il tuo indirizzo gratis e per sempre @yahoo.it su http://mail.yahoo.it
>

-- 
------------------------------------------------
Be true to your work, your word, and your friend.
--Thoreau

Padmaparna Haldar