Bug 1873 - Energy source checked to be aggregated to the node
authorTomasz Seweryn <tomasz.seweryn7@gmail.com>
Sat, 26 Apr 2014 23:01:09 +0200
changeset 10701 37823f33885f
parent 10700 159c58e203a6
child 10702 da097212be1f
Bug 1873 - Energy source checked to be aggregated to the node
RELEASE_NOTES
src/energy/helper/basic-energy-source-helper.cc
src/energy/helper/energy-model-helper.h
src/energy/helper/rv-battery-model-helper.cc
--- a/RELEASE_NOTES	Thu Apr 24 17:38:36 2014 -0700
+++ b/RELEASE_NOTES	Sat Apr 26 23:01:09 2014 +0200
@@ -67,6 +67,7 @@
 - Bug 1855 - SixLowPanNetDevice is not correctly indexed
 - Bug 1862 - NS_LOG="Time=*|prefix_time" causes stack overflow
 - Bug 1870 - Remove unnecessary AsInt functions
+- Bug 1873 - Energy source checked to be aggregated to the node
 - Bug 1874 - Ipv4L3Protocol::ProcessFragment: addressCombination and idProto identifiers not properly computed
 - Bug 1882 - int64x64 tests trigger valgrind bug
 - Bug 1883 - IPv6 don't consider the prefix and network when choosing output address
--- a/src/energy/helper/basic-energy-source-helper.cc	Thu Apr 24 17:38:36 2014 -0700
+++ b/src/energy/helper/basic-energy-source-helper.cc	Sat Apr 26 23:01:09 2014 +0200
@@ -42,13 +42,7 @@
 BasicEnergySourceHelper::DoInstall (Ptr<Node> node) const
 {
   NS_ASSERT (node != NULL);
-  // check if energy source already exists
-  Ptr<EnergySource> source = node->GetObject<EnergySource> ();
-  if (source != NULL)
-    {
-      NS_FATAL_ERROR ("Energy source already installed!");
-    }
-  source = m_basicEnergySource.Create<EnergySource> ();
+  Ptr<EnergySource> source = m_basicEnergySource.Create<EnergySource> ();
   NS_ASSERT (source != NULL);
   source->SetNode (node);
   return source;
--- a/src/energy/helper/energy-model-helper.h	Thu Apr 24 17:38:36 2014 -0700
+++ b/src/energy/helper/energy-model-helper.h	Sat Apr 26 23:01:09 2014 +0200
@@ -38,8 +38,8 @@
  * \ingroup energy
  * \brief Creates EnergySource objects.
  *
- * This class creates and installs an energy source onto network nodes. Only a
- * single source can exist on a network node.
+ * This class creates and installs an energy source onto network nodes.
+ * Multiple sources can exist on a network node.
  *
  */
 class EnergySourceHelper
--- a/src/energy/helper/rv-battery-model-helper.cc	Thu Apr 24 17:38:36 2014 -0700
+++ b/src/energy/helper/rv-battery-model-helper.cc	Sat Apr 26 23:01:09 2014 +0200
@@ -42,13 +42,7 @@
 RvBatteryModelHelper::DoInstall (Ptr<Node> node) const
 {
   NS_ASSERT (node != NULL);
-  // check if energy source already exists
-  Ptr<EnergySource> source = node->GetObject<EnergySource> ();
-  if (source != NULL)
-    {
-      NS_FATAL_ERROR ("Energy source already installed!");
-    }
-  source = m_rvBatteryModel.Create<EnergySource> ();
+  Ptr<EnergySource> source = m_rvBatteryModel.Create<EnergySource> ();
   NS_ASSERT (source != NULL);
   source->SetNode (node);
   return source;