set the implementation Scheduler after setting the implementation
authorGuillaume Seguin <guillaume@segu.in>
Tue Nov 10 10:31:51 2009 +0100 (3 months ago)
changeset 54938ffa53e9a701
parent 5492 5718e4171536
child 5494 5774651f7b98
set the implementation Scheduler after setting the implementation
src/simulator/simulator.cc
     1.1 --- a/src/simulator/simulator.cc	Tue Nov 10 07:45:32 2009 +0100
     1.2 +++ b/src/simulator/simulator.cc	Tue Nov 10 10:31:51 2009 +0100
     1.3 @@ -297,6 +297,12 @@
     1.4        NS_FATAL_ERROR ("It is not possible to set the implementation after calling any Simulator:: function. Call Simulator::SetImplementation earlier or after Simulator::Destroy.");
     1.5      }
     1.6    *PeekImpl () = impl;
     1.7 +  // Set the default scheduler
     1.8 +  ObjectFactory factory;
     1.9 +  StringValue s;
    1.10 +  g_schedTypeImpl.GetValue (s);
    1.11 +  factory.SetTypeId (s.Get ());
    1.12 +  impl->SetScheduler (factory.Create<Scheduler> ());
    1.13  //
    1.14  // Note: we call LogSetTimePrinter _after_ creating the implementation
    1.15  // object because the act of creation can trigger calls to the logging