11.4.2 Default Values

Default values for member variables, those visible in OTcl only and those linked between OTcl and C++ with bind are initialized in the ~ns/tcl/lib/ns-default.tcl file. For example, Agent is initialized as follows:

        Agent set fid_ 0
        Agent set prio_ 0
        Agent set addr_ 0
        Agent set dst_ 0
        Agent set flags_ 0

Generally these initializations are placed in the OTcl namespace before any objects of these types are created. Thus, when an Agent object is created, the calls to bind in the objects' constructors will causes the corresponding member variables to be set to these specified defaults.



Tom Henderson 2014-12-17