AddInterface -> AggregateObject
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu, 31 Jan 2008 22:23:46 +0100
changeset 2258 666099a753e0
parent 2257 71a58e70c671
child 2292 5d82197dc451
AddInterface -> AggregateObject
samples/main-adhoc-wifi.cc
samples/main-ap-wifi.cc
samples/main-random-walk.cc
src/core/object.cc
src/core/object.h
src/devices/csma/csma-net-device.cc
src/devices/point-to-point/point-to-point-net-device.cc
src/internet-node/arp-ipv4-interface.h
src/internet-node/internet-node.cc
src/mobility/grid-topology.cc
src/mobility/hierarchical-mobility-model.cc
src/mobility/ns2-mobility-file-topology.cc
src/mobility/random-topology.cc
src/node/node.cc
src/routing/global-routing/global-route-manager-impl.cc
src/routing/olsr/olsr-agent-impl.cc
utils/mobility-visualizer-model.cc
utils/print-introspected-doxygen.cc
--- a/samples/main-adhoc-wifi.cc	Thu Jan 31 22:11:03 2008 +0100
+++ b/samples/main-adhoc-wifi.cc	Thu Jan 31 22:23:46 2008 +0100
@@ -50,7 +50,7 @@
   device->Attach (channel);
   Ptr<MobilityModel> mobility = CreateObject<StaticMobilityModel> ();
   mobility->SetPosition (position);
-  node->AddInterface (mobility);
+  node->AggregateObject (mobility);
   
   return node;
 }
--- a/samples/main-ap-wifi.cc	Thu Jan 31 22:11:03 2008 +0100
+++ b/samples/main-ap-wifi.cc	Thu Jan 31 22:23:46 2008 +0100
@@ -78,7 +78,7 @@
   device->Attach (channel);
   Ptr<MobilityModel> mobility = CreateObject<StaticMobilityModel> ();
   mobility->SetPosition (position);
-  node->AddInterface (mobility);
+  node->AggregateObject (mobility);
   return node;
 }
 
@@ -95,7 +95,7 @@
   device->Attach (channel);
   Ptr<MobilityModel> mobility = CreateObject<StaticMobilityModel> ();
   mobility->SetPosition (position);
-  node->AddInterface (mobility);
+  node->AggregateObject (mobility);
   return node;
 }
 
--- a/samples/main-random-walk.cc	Thu Jan 31 22:11:03 2008 +0100
+++ b/samples/main-random-walk.cc	Thu Jan 31 22:23:46 2008 +0100
@@ -46,7 +46,7 @@
   for (uint32_t i = 0; i < 100; i++)
     {
       Ptr<Node> node = CreateObject<Node> ();
-      node->AddInterface (CreateObject<MobilityModelNotifier> ());
+      node->AggregateObject (CreateObject<MobilityModelNotifier> ());
     }
 
   topology.Layout (NodeList::Begin (), NodeList::End ());
--- a/src/core/object.cc	Thu Jan 31 22:11:03 2008 +0100
+++ b/src/core/object.cc	Thu Jan 31 22:23:46 2008 +0100
@@ -410,7 +410,7 @@
 }
 
 void 
-Object::AddInterface (Ptr<Object> o)
+Object::AggregateObject (Ptr<Object> o)
 {
   NS_ASSERT (!m_disposed);
   NS_ASSERT (!o->m_disposed);
@@ -762,7 +762,7 @@
   baseA = CreateObject<BaseA> ();
   Ptr<BaseB> baseB = CreateObject<BaseB> ();
   Ptr<BaseB> baseBCopy = baseB;
-  baseA->AddInterface (baseB);
+  baseA->AggregateObject (baseB);
   NS_TEST_ASSERT_UNEQUAL (baseA->GetObject<BaseA> (), 0);
   NS_TEST_ASSERT_EQUAL (baseA->GetObject<DerivedA> (), 0);
   NS_TEST_ASSERT_UNEQUAL (baseA->GetObject<BaseB> (), 0);
@@ -776,7 +776,7 @@
   baseA = CreateObject<DerivedA> (1);
   baseB = CreateObject<DerivedB> (1);
   baseBCopy = baseB;
-  baseA->AddInterface (baseB);
+  baseA->AggregateObject (baseB);
   NS_TEST_ASSERT_UNEQUAL (baseA->GetObject<DerivedB> (), 0);
   NS_TEST_ASSERT_UNEQUAL (baseA->GetObject<BaseB> (), 0);
   NS_TEST_ASSERT_UNEQUAL (baseB->GetObject<DerivedA> (), 0);
@@ -788,7 +788,7 @@
 
   baseA = CreateObject<BaseA> ();
   baseB = CreateObject<BaseB> ();
-  baseA->AddInterface (baseB);
+  baseA->AggregateObject (baseB);
   baseA = 0;
   baseA = baseB->GetObject<BaseA> ();
 
@@ -806,7 +806,7 @@
   NS_TEST_ASSERT (m_baseBTrace);
   baseB->TraceDisconnect ("/baseb-x",  MakeCallback (&ObjectTest::BaseBTrace, this));
 
-  baseA->AddInterface (baseB);
+  baseA->AggregateObject (baseB);
 
   baseA->TraceConnect ("/basea-x", MakeCallback (&ObjectTest::BaseATrace, this));
   m_baseATrace = false;
@@ -838,7 +838,7 @@
   Ptr<DerivedA> derivedA;
   derivedA = CreateObject<DerivedA> (1);
   baseB = CreateObject<BaseB> ();
-  derivedA->AddInterface (baseB);
+  derivedA->AggregateObject (baseB);
   baseB->TraceConnect ("/$DerivedA/deriveda-x", MakeCallback (&ObjectTest::DerivedATrace, this));
   baseB->TraceConnect ("/$DerivedA/basea-x", MakeCallback (&ObjectTest::BaseATrace, this));
   m_derivedATrace = false;
--- a/src/core/object.h	Thu Jan 31 22:11:03 2008 +0100
+++ b/src/core/object.h	Thu Jan 31 22:23:46 2008 +0100
@@ -180,7 +180,7 @@
    * method returns, it becomes possible to call GetObject
    * on one to get the other, and vice-versa. 
    */
-  void AddInterface (Ptr<Object> other);
+  void AggregateObject (Ptr<Object> other);
 
   /**
    * \param path the path to match for the callback
--- a/src/devices/csma/csma-net-device.cc	Thu Jan 31 22:11:03 2008 +0100
+++ b/src/devices/csma/csma-net-device.cc	Thu Jan 31 22:23:46 2008 +0100
@@ -540,7 +540,7 @@
   NS_LOG_PARAM ("(" << em << ")");
   
   m_receiveErrorModel = em; 
-  AddInterface (em);
+  AggregateObject (em);
 }
 
 void
--- a/src/devices/point-to-point/point-to-point-net-device.cc	Thu Jan 31 22:11:03 2008 +0100
+++ b/src/devices/point-to-point/point-to-point-net-device.cc	Thu Jan 31 22:23:46 2008 +0100
@@ -302,7 +302,7 @@
   NS_LOG_PARAMS ("(" << em << ")");
 
   m_receiveErrorModel = em;
-  AddInterface (em);
+  AggregateObject (em);
 }
 
 void PointToPointNetDevice::Receive (Ptr<Packet> packet)
--- a/src/internet-node/arp-ipv4-interface.h	Thu Jan 31 22:11:03 2008 +0100
+++ b/src/internet-node/arp-ipv4-interface.h	Thu Jan 31 22:23:46 2008 +0100
@@ -34,7 +34,7 @@
  *
  * If you need to use ARP on top of a specific NetDevice, you
  * can use this Ipv4Interface subclass to wrap it for the Ipv4 class
- * when calling Ipv4::AddInterface.
+ * when calling Ipv4::AggregateObject.
  */
 class ArpIpv4Interface : public Ipv4Interface
 {
--- a/src/internet-node/internet-node.cc	Thu Jan 31 22:11:03 2008 +0100
+++ b/src/internet-node/internet-node.cc	Thu Jan 31 22:23:46 2008 +0100
@@ -73,12 +73,12 @@
   Ptr<TcpImpl> tcpImpl = CreateObject<TcpImpl> (tcp);
   Ptr<Ipv4Impl> ipv4Impl = CreateObject<Ipv4Impl> (ipv4);
 
-  Object::AddInterface (ipv4);
-  Object::AddInterface (arp);
-  Object::AddInterface (ipv4Impl);
-  Object::AddInterface (udpImpl);
-  Object::AddInterface (tcpImpl);
-  Object::AddInterface (ipv4L4Demux);
+  Object::AggregateObject (ipv4);
+  Object::AggregateObject (arp);
+  Object::AggregateObject (ipv4Impl);
+  Object::AggregateObject (udpImpl);
+  Object::AggregateObject (tcpImpl);
+  Object::AggregateObject (ipv4L4Demux);
 }
 
 Ptr<TraceResolver>
--- a/src/mobility/grid-topology.cc	Thu Jan 31 22:11:03 2008 +0100
+++ b/src/mobility/grid-topology.cc	Thu Jan 31 22:23:46 2008 +0100
@@ -44,7 +44,7 @@
   x = m_xMin + m_deltaX * (i % m_n);
   y = m_yMin + m_deltaY * (i / m_n);
   Ptr<MobilityModel> mobility = m_positionTypeId.CreateObject ()->GetObject<MobilityModel> ();
-  object->AddInterface (mobility);
+  object->AggregateObject (mobility);
   mobility->SetPosition (Vector (x, y, 0.0));
 }
 
@@ -55,7 +55,7 @@
   x = m_xMin + m_deltaX * (i / m_n);
   y = m_yMin + m_deltaY * (i % m_n);
   Ptr<MobilityModel> mobility = m_positionTypeId.CreateObject ()->GetObject<MobilityModel> ();
-  object->AddInterface (mobility);
+  object->AggregateObject (mobility);
   mobility->SetPosition (Vector (x, y, 0.0));
 }
 
--- a/src/mobility/hierarchical-mobility-model.cc	Thu Jan 31 22:11:03 2008 +0100
+++ b/src/mobility/hierarchical-mobility-model.cc	Thu Jan 31 22:23:46 2008 +0100
@@ -43,12 +43,12 @@
   if (childNotifier == 0)
     {
       childNotifier = CreateObject<MobilityModelNotifier> ();
-      child->AddInterface (childNotifier);
+      child->AggregateObject (childNotifier);
     }
   if (parentNotifier == 0)
     {
       parentNotifier = CreateObject<MobilityModelNotifier> ();
-      parent->AddInterface (parentNotifier);
+      parent->AggregateObject (parentNotifier);
     }
   childNotifier->TraceConnect ("/course-changed", MakeCallback (&HierarchicalMobilityModel::ChildChanged, this));
   parentNotifier->TraceConnect ("/course-changed", MakeCallback (&HierarchicalMobilityModel::ParentChanged, this));
--- a/src/mobility/ns2-mobility-file-topology.cc	Thu Jan 31 22:11:03 2008 +0100
+++ b/src/mobility/ns2-mobility-file-topology.cc	Thu Jan 31 22:23:46 2008 +0100
@@ -53,7 +53,7 @@
   if (model == 0)
     {
       model = CreateObject<StaticSpeedMobilityModel> ();
-      object->AddInterface (model);
+      object->AggregateObject (model);
     }
   return model;
 }
--- a/src/mobility/random-topology.cc	Thu Jan 31 22:11:03 2008 +0100
+++ b/src/mobility/random-topology.cc	Thu Jan 31 22:23:46 2008 +0100
@@ -68,7 +68,7 @@
 RandomTopology::LayoutOne (Ptr<Object> object)
 {
   Ptr<MobilityModel> mobility = m_mobilityModel.CreateObject ()->GetObject<MobilityModel> ();
-  object->AddInterface (mobility);
+  object->AggregateObject (mobility);
   Vector position = m_positionModel->Get ();
   mobility->SetPosition (position);
 }
--- a/src/node/node.cc	Thu Jan 31 22:11:03 2008 +0100
+++ b/src/node/node.cc	Thu Jan 31 22:23:46 2008 +0100
@@ -116,7 +116,7 @@
 {
   m_id = NodeList::Add (this);
   Ptr<PacketSocketFactory> socketFactory = CreateObject<PacketSocketFactory> ();
-  AddInterface (socketFactory);
+  AggregateObject (socketFactory);
 }
   
 Node::~Node ()
--- a/src/routing/global-routing/global-route-manager-impl.cc	Thu Jan 31 22:11:03 2008 +0100
+++ b/src/routing/global-routing/global-route-manager-impl.cc	Thu Jan 31 22:23:46 2008 +0100
@@ -367,7 +367,7 @@
         node->GetId ());
 
       Ptr<GlobalRouter> globalRouter = CreateObject<GlobalRouter> ();
-      node->AddInterface (globalRouter);
+      node->AggregateObject (globalRouter);
     }
 }
 
--- a/src/routing/olsr/olsr-agent-impl.cc	Thu Jan 31 22:11:03 2008 +0100
+++ b/src/routing/olsr/olsr-agent-impl.cc	Thu Jan 31 22:23:46 2008 +0100
@@ -173,7 +173,7 @@
   m_queuedMessagesTimer.SetFunction (&AgentImpl::SendQueuedMessages, this);
 
   // Aggregate with the Node, so that OLSR dies when the node is destroyed.
-  node->AddInterface (this);
+  node->AggregateObject (this);
 
   m_packetSequenceNumber = OLSR_MAX_SEQ_NUM;
   m_messageSequenceNumber = OLSR_MAX_SEQ_NUM;
--- a/utils/mobility-visualizer-model.cc	Thu Jan 31 22:11:03 2008 +0100
+++ b/utils/mobility-visualizer-model.cc	Thu Jan 31 22:23:46 2008 +0100
@@ -94,7 +94,7 @@
   for (uint32_t i = 0; i < g_numNodes; i++)
     {
       Ptr<Node> node = CreateObject<Node> ();
-      node->AddInterface (CreateObject<MobilityModelNotifier> ());
+      node->AggregateObject (CreateObject<MobilityModelNotifier> ());
     }
 
   topology.Layout (NodeList::Begin (), NodeList::End ());
--- a/utils/print-introspected-doxygen.cc	Thu Jan 31 22:11:03 2008 +0100
+++ b/utils/print-introspected-doxygen.cc	Thu Jan 31 22:23:46 2008 +0100
@@ -117,7 +117,7 @@
 int main (int argc, char *argv[])
 {
   Ptr<Node> node = CreateObject<InternetNode> ();
-  node->AddInterface (CreateObject<MobilityModelNotifier> ());
+  node->AggregateObject (CreateObject<MobilityModelNotifier> ());
 
   Ptr<PointToPointNetDevice> p2p = CreateObject<PointToPointNetDevice> (node);
   p2p->AddQueue (Queue::CreateDefault ());