From a6df99796599f71148bd6bb50087be892e9c5965 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Mon, 8 Jun 2009 13:44:51 +0200 Subject: [PATCH] bug 583: Simulator::SetImplementation not implemented --- src/simulator/simulator.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/simulator/simulator.cc b/src/simulator/simulator.cc index e90c99d19..d54d10ad4 100644 --- a/src/simulator/simulator.cc +++ b/src/simulator/simulator.cc @@ -292,7 +292,19 @@ Simulator::GetMaximumSimulationTime (void) void Simulator::SetImplementation (Ptr 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 Simulator::GetImplementation (void)