Remove Install method with building from the BuildingsHelper

This commit is contained in:
Marco Miozzo
2013-06-04 16:29:06 +02:00
parent efd46793d4
commit 9f88fcc217
2 changed files with 22 additions and 29 deletions

View File

@@ -59,31 +59,6 @@ BuildingsHelper::Install (Ptr<Node> node)
}
void
BuildingsHelper::Install (NodeContainer c, Ptr<Building> building)
{
for (NodeContainer::Iterator i = c.Begin (); i != c.End (); ++i)
{
Install (*i, building);
}
}
void
BuildingsHelper::Install (Ptr<Node> node, Ptr<Building> building)
{
Ptr<Object> object = node;
Ptr<MobilityModel> model = object->GetObject<MobilityModel> ();
if (model == 0)
{
NS_ABORT_MSG_UNLESS (0 != model, "node " << node->GetId () << " does not have a MobilityModel");
}
Ptr<MobilityBuildingInfo> buildingInfo = CreateObject<MobilityBuildingInfo> (building);
model->AggregateObject (buildingInfo);
}
void
BuildingsHelper::MakeMobilityModelConsistent ()
{

View File

@@ -36,11 +36,29 @@ class Building;
class BuildingsHelper
{
public:
static void Install (Ptr<Node> node); // for outdoor nodes
static void Install (NodeContainer c); // for outdoor nodes
static void Install (Ptr<Node> node, Ptr<Building> building);
static void Install (NodeContainer c, Ptr<Building> building);
/**
* Install the MobilityBuildingInfo to a node
*
* \param node the mobility model of the node to be updated
*/
static void Install (Ptr<Node> 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<MobilityModel> bmm);
};