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

Re: otcl c++ variable binding.




Hi Karu,

The C++ variable, duplicate_, must be a member variable of the class.
Likewise, the OTcl variable, duplicate_, is an instance variable
of the OTcl class.  You can access this instance variable only through
an object instance in the class Classifier/MH.  So, your code should read

	set cmh [new Classifier/MH]
	$cmh set duplicate_

to access this instance variable.

Additional details of all of this binding can be found in
the documentation, at http://www-mash.cs.berkeley.edu/ns/nsDoc.tar.gz.

Hope this helps,


Kannan



> From: Karunaharan Ratnam <[email protected]>
> Date: Thu, 28 May 1998 21:53:17 EDT

> HI,
> 
> I tried to create a new variable duplicate_ in C++ and want to
> bind it to duplicate_ in otcl.
> I have a new class of type Classifier/MH, and set 
> "Classifier/MH set duplicate_ 0" in ns-default.tcl.
> 
> In the file MH.cc, I defined the var duplicate_ as integer, and bound it by,
> bind("duplicate_", &duplicate_).
> 
> But, when I try to access the variable duplicate_ in the test script,
> it gave an error saying 
>  can't read "duplicate_": no such variable
> 
> Any help.
> 
> Karu.
> 

--
[email protected]
http://www.isi.edu/~kannan