fixed Bug 1587 - PDCP logs are always created (even if not requested)
authorNicola Baldo <nbaldo@cttc.es>
Fri, 22 Feb 2013 13:30:50 +0100
changeset 9669 eb758c67f9f2
parent 9668 f587f226735e
child 9670 ff49b1defa8b
fixed Bug 1587 - PDCP logs are always created (even if not requested)
src/lte/helper/lte-helper.cc
--- a/src/lte/helper/lte-helper.cc	Fri Feb 22 11:11:17 2013 +0100
+++ b/src/lte/helper/lte-helper.cc	Fri Feb 22 13:30:50 2013 +0100
@@ -120,9 +120,6 @@
   m_phyTxStats = CreateObject<PhyTxStatsCalculator> ();
   m_phyRxStats = CreateObject<PhyRxStatsCalculator> ();
   m_macStats = CreateObject<MacStatsCalculator> ();
-  m_rlcStats = CreateObject<RadioBearerStatsCalculator> ("RLC");
-  m_pdcpStats = CreateObject<RadioBearerStatsCalculator> ("PDCP");
-
   Object::DoStart ();
 
 }
@@ -831,6 +828,8 @@
 void
 LteHelper::EnableRlcTraces (void)
 {
+  NS_ASSERT_MSG (m_rlcStats == 0, "please make sure that LteHelper::EnableRlcTraces is called at most once");
+  m_rlcStats = CreateObject<RadioBearerStatsCalculator> ("RLC");
   m_radioBearerStatsConnector.EnableRlcStats (m_rlcStats);
 }
 
@@ -1339,6 +1338,8 @@
 void
 LteHelper::EnablePdcpTraces (void)
 {
+  NS_ASSERT_MSG (m_pdcpStats == 0, "please make sure that LteHelper::EnablePdcpTraces is called at most once");
+  m_pdcpStats = CreateObject<RadioBearerStatsCalculator> ("PDCP");
   m_radioBearerStatsConnector.EnablePdcpStats (m_pdcpStats);
 }