next up previous contents index
Next: 3.3 Class Tcl Up: 3. OTcl Linkage Previous: 3.1 Concept Overview

3.2 Code Overview

In this document, we use the term ``interpreter'' to be synonymous with the OTcl interpreter. The code to interface with the interpreter resides in a separate directory, tclcl. The rest of the simulator code resides in the directory, ns-2. We will use the notation file to refer to a particular file in the Tcl directory. Similarly, we will use the notation, file to refer to a particular file in the ns-2 directory.

There are a number of classes defined in . We only focus on the six that are used in : The Class TclSectionsec:Tcl contains the methods that C++ code will use to access the interpreter. The class TclObjectSectionsec:TclObject is the base class for all simulator objects that are also mirrored in the compiled hierarchy. The class TclClassSectionsec:TclClass defines the interpreted class hierarchy, and the methods to permit the user to instantiate TclObjects. The class TclCommandSectionsec:TclCommand is used to define simple global interpreter commands. The class EmbeddedTclSectionsec:EmbeddedTcl contains the methods to load higher level builtin commands that make configuring simulations easier. Finally, the class InstVarSectionsec:InstVar contains methods to access C++ member variables as OTcl instance variables.

The procedures and functions described in this chapter can be found in Tcl.{cc, h}, Tcl2.cc, tcl-object.tcl, and, tracedvar.{cc, h}. The file tcl2c++.c is used in building , and is mentioned briefly in this chapter.


next up previous contents index
Next: 3.3 Class Tcl Up: 3. OTcl Linkage Previous: 3.1 Concept Overview

2000-08-24