Cosmetic: change strings in the bind commands for queue. Move Bind() before CommandLine::Parse() in example script

Tom Henderson 2007-05-04 11:50:02 -07:00
parent 8819fdde7a
commit a6f05a05e0
3 changed files with 21 additions and 11 deletions

View File

@ -72,7 +72,9 @@ using namespace ns3;
int main (int argc, char *argv[]) int main (int argc, char *argv[])
{ {
CommandLine::Parse (argc, argv);
// Users may find it convenient to turn on explicit debugging
// for selected modules; the below lines suggest how to do this
#if 0 #if 0
DebugComponentEnable("Object"); DebugComponentEnable("Object");
DebugComponentEnable("Queue"); DebugComponentEnable("Queue");
@ -82,20 +84,28 @@ int main (int argc, char *argv[])
DebugComponentEnable("PointToPointNetDevice"); DebugComponentEnable("PointToPointNetDevice");
#endif #endif
// Optionally, specify some default values for Queue objects. // Set up some default values for the simulation. Use the Bind()
// For this example, we specify that we want each queue to // technique to tell the system what subclass of Queue to use,
// be a DropTail queue, with a limit of 30 packets. // and what the queue limit is
// Specify DropTail for default queue type (note. this is actually
// the default, but included here as an example).
Bind ("queue", "DropTail"); //Queue::Default(DropTailQueue());
// Specify limit of 30 in units of packets (not implemented).
// Queue::Default().SetLimitPackets(30);
// The below Bind command tells the queue factory which class to
// instantiate, when the queue factory is invoked in the topology code
Bind ("Queue", "DropTailQueue");
//Bind ("DropTailQueue::m_maxPackets", 30);
// Allow the user to override any of the defaults and the above
// Bind()s at run-time, via command-line arguments
CommandLine::Parse (argc, argv);
// Here, we will explicitly create four nodes. In more sophisticated
// topologies, we could configure a node factory.
Node* n0 = new InternetNode (); Node* n0 = new InternetNode ();
Node* n1 = new InternetNode (); Node* n1 = new InternetNode ();
Node* n2 = new InternetNode (); Node* n2 = new InternetNode ();
Node* n3 = new InternetNode (); Node* n3 = new InternetNode ();
// We create the channels first without any IP addressing information
PointToPointChannel *channel0 = PointToPointChannel *channel0 =
PointToPointTopology::AddPointToPointLink ( PointToPointTopology::AddPointToPointLink (
n0, Ipv4Address("10.1.1.1"), n0, Ipv4Address("10.1.1.1"),

View File

@ -29,7 +29,7 @@ public:
QueueStackInitializationClass () { QueueStackInitializationClass () {
Queue::Default (DropTailQueue ()); Queue::Default (DropTailQueue ());
static DropTailQueue queue; static DropTailQueue queue;
Queue::AddDefault (queue, "DropTail"); Queue::AddDefault (queue, "DropTailQueue");
} }
} queue_stack_initialization_class; } queue_stack_initialization_class;

View File

@ -242,7 +242,7 @@ Queue::AddDefault (Queue &queue, const std::string &name)
StringEnumDefaultValue * StringEnumDefaultValue *
Queue::GetDefault (void) Queue::GetDefault (void)
{ {
static StringEnumDefaultValue value ("queue", "Packet Queue"); static StringEnumDefaultValue value ("Queue", "Packet Queue");
return &value; return &value;
} }
Queue::List * Queue::List *