From 9f88fcc217474ef512a4cfebb41270965f2faf83 Mon Sep 17 00:00:00 2001 From: Marco Miozzo Date: Tue, 4 Jun 2013 16:29:06 +0200 Subject: [PATCH] Remove Install method with building from the BuildingsHelper --- src/buildings/helper/buildings-helper.cc | 25 ----------------------- src/buildings/helper/buildings-helper.h | 26 ++++++++++++++++++++---- 2 files changed, 22 insertions(+), 29 deletions(-) diff --git a/src/buildings/helper/buildings-helper.cc b/src/buildings/helper/buildings-helper.cc index 82ad7a96b..78561123b 100644 --- a/src/buildings/helper/buildings-helper.cc +++ b/src/buildings/helper/buildings-helper.cc @@ -59,31 +59,6 @@ BuildingsHelper::Install (Ptr node) } - -void -BuildingsHelper::Install (NodeContainer c, Ptr building) -{ - for (NodeContainer::Iterator i = c.Begin (); i != c.End (); ++i) - { - Install (*i, building); - } -} - - -void -BuildingsHelper::Install (Ptr node, Ptr building) -{ - Ptr object = node; - Ptr model = object->GetObject (); - if (model == 0) - { - NS_ABORT_MSG_UNLESS (0 != model, "node " << node->GetId () << " does not have a MobilityModel"); - - } - Ptr buildingInfo = CreateObject (building); - model->AggregateObject (buildingInfo); -} - void BuildingsHelper::MakeMobilityModelConsistent () { diff --git a/src/buildings/helper/buildings-helper.h b/src/buildings/helper/buildings-helper.h index b2902a8f6..180ab09d1 100644 --- a/src/buildings/helper/buildings-helper.h +++ b/src/buildings/helper/buildings-helper.h @@ -36,11 +36,29 @@ class Building; class BuildingsHelper { public: - static void Install (Ptr node); // for outdoor nodes - static void Install (NodeContainer c); // for outdoor nodes - static void Install (Ptr node, Ptr building); - static void Install (NodeContainer c, Ptr building); + /** + * Install the MobilityBuildingInfo to a node + * + * \param node the mobility model of the node to be updated + */ + static void Install (Ptr node); // for any nodes + /** + * Install the MobilityBuildingInfo to the set of nodes in a NodeContainer + * + * \param c the NodeContainer including the nodes to be updated + */ + static void Install (NodeContainer c); // for any nodes + /** + * Update the node in the simulation scenario MobilityBuildingInfo according + * to the buildings created + * + */ static void MakeMobilityModelConsistent (); + /** + * Update the MobilityBuildingInfo according to the buildings created + * + * \param bmm the mobility model of the node to be updated + */ static void MakeConsistent (Ptr bmm); };