Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

RandomCommand Class Reference

Inheritance diagram for RandomCommand:

Inheritance graph
[legend]
Collaboration diagram for RandomCommand:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RandomCommand ()
virtual int command (int argc, const char *const *argv)

Constructor & Destructor Documentation

RandomCommand::RandomCommand  )  [inline]
 

Definition at line 138 of file misc.cc.

References random().

00138 : TclCommand("ns-random") { }

Here is the call graph for this function:


Member Function Documentation

int RandomCommand::command int  argc,
const char *const *  argv
[virtual]
 

Definition at line 146 of file misc.cc.

References Random::random(), Random::seed(), and Random::seed_heuristically().

00147 {
00148         Tcl& tcl = Tcl::instance();
00149         if (argc == 1) {
00150                 sprintf(tcl.buffer(), "%u", Random::random());
00151                 tcl.result(tcl.buffer());
00152         } else if (argc == 2) {
00153                 int seed = atoi(argv[1]);
00154                 if (seed == 0)
00155                         seed = Random::seed_heuristically();
00156                 else
00157                         Random::seed(seed);
00158                 tcl.resultf("%d", seed);
00159         }
00160         return (TCL_OK);
00161 }

Here is the call graph for this function:


The documentation for this class was generated from the following file:
Generated on Tue Apr 20 13:11:34 2004 for NS2.26SourcesOriginal by doxygen 1.3.3