bug 583: Simulator::SetImplementation not implemented

This commit is contained in:
Mathieu Lacage
2009-06-08 13:44:51 +02:00
parent 7f4d04d9f7
commit a6df997965

View File

@@ -292,7 +292,19 @@ Simulator::GetMaximumSimulationTime (void)
void
Simulator::SetImplementation (Ptr<SimulatorImpl> impl)
{
NS_FATAL_ERROR ("TODO");
if (PeekImpl () != 0)
{
NS_FATAL_ERROR ("It is not possible to set the implementation after calling any Simulator:: function. Call Simulator::SetImplementation earlier or after Simulator::Destroy.");
}
*PeekImpl () = impl;
//
// Note: we call LogSetTimePrinter _after_ creating the implementation
// object because the act of creation can trigger calls to the logging
// framework which would call the TimePrinter function which would call
// Simulator::Now which would call Simulator::GetImpl, and, thus, get us
// in an infinite recursion until the stack explodes.
//
LogSetTimePrinter (&TimePrinter);
}
Ptr<SimulatorImpl>
Simulator::GetImplementation (void)