AddInterface -> AggregateObject
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu, 31 Jan 2008 22:23:46 +0100
changeset 2258666099a753e0
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
     1.1 --- a/samples/main-adhoc-wifi.cc	Thu Jan 31 22:11:03 2008 +0100
     1.2 +++ b/samples/main-adhoc-wifi.cc	Thu Jan 31 22:23:46 2008 +0100
     1.3 @@ -50,7 +50,7 @@
     1.4    device->Attach (channel);
     1.5    Ptr<MobilityModel> mobility = CreateObject<StaticMobilityModel> ();
     1.6    mobility->SetPosition (position);
     1.7 -  node->AddInterface (mobility);
     1.8 +  node->AggregateObject (mobility);
     1.9    
    1.10    return node;
    1.11  }
     2.1 --- a/samples/main-ap-wifi.cc	Thu Jan 31 22:11:03 2008 +0100
     2.2 +++ b/samples/main-ap-wifi.cc	Thu Jan 31 22:23:46 2008 +0100
     2.3 @@ -78,7 +78,7 @@
     2.4    device->Attach (channel);
     2.5    Ptr<MobilityModel> mobility = CreateObject<StaticMobilityModel> ();
     2.6    mobility->SetPosition (position);
     2.7 -  node->AddInterface (mobility);
     2.8 +  node->AggregateObject (mobility);
     2.9    return node;
    2.10  }
    2.11  
    2.12 @@ -95,7 +95,7 @@
    2.13    device->Attach (channel);
    2.14    Ptr<MobilityModel> mobility = CreateObject<StaticMobilityModel> ();
    2.15    mobility->SetPosition (position);
    2.16 -  node->AddInterface (mobility);
    2.17 +  node->AggregateObject (mobility);
    2.18    return node;
    2.19  }
    2.20  
     3.1 --- a/samples/main-random-walk.cc	Thu Jan 31 22:11:03 2008 +0100
     3.2 +++ b/samples/main-random-walk.cc	Thu Jan 31 22:23:46 2008 +0100
     3.3 @@ -46,7 +46,7 @@
     3.4    for (uint32_t i = 0; i < 100; i++)
     3.5      {
     3.6        Ptr<Node> node = CreateObject<Node> ();
     3.7 -      node->AddInterface (CreateObject<MobilityModelNotifier> ());
     3.8 +      node->AggregateObject (CreateObject<MobilityModelNotifier> ());
     3.9      }
    3.10  
    3.11    topology.Layout (NodeList::Begin (), NodeList::End ());
     4.1 --- a/src/core/object.cc	Thu Jan 31 22:11:03 2008 +0100
     4.2 +++ b/src/core/object.cc	Thu Jan 31 22:23:46 2008 +0100
     4.3 @@ -410,7 +410,7 @@
     4.4  }
     4.5  
     4.6  void 
     4.7 -Object::AddInterface (Ptr<Object> o)
     4.8 +Object::AggregateObject (Ptr<Object> o)
     4.9  {
    4.10    NS_ASSERT (!m_disposed);
    4.11    NS_ASSERT (!o->m_disposed);
    4.12 @@ -762,7 +762,7 @@
    4.13    baseA = CreateObject<BaseA> ();
    4.14    Ptr<BaseB> baseB = CreateObject<BaseB> ();
    4.15    Ptr<BaseB> baseBCopy = baseB;
    4.16 -  baseA->AddInterface (baseB);
    4.17 +  baseA->AggregateObject (baseB);
    4.18    NS_TEST_ASSERT_UNEQUAL (baseA->GetObject<BaseA> (), 0);
    4.19    NS_TEST_ASSERT_EQUAL (baseA->GetObject<DerivedA> (), 0);
    4.20    NS_TEST_ASSERT_UNEQUAL (baseA->GetObject<BaseB> (), 0);
    4.21 @@ -776,7 +776,7 @@
    4.22    baseA = CreateObject<DerivedA> (1);
    4.23    baseB = CreateObject<DerivedB> (1);
    4.24    baseBCopy = baseB;
    4.25 -  baseA->AddInterface (baseB);
    4.26 +  baseA->AggregateObject (baseB);
    4.27    NS_TEST_ASSERT_UNEQUAL (baseA->GetObject<DerivedB> (), 0);
    4.28    NS_TEST_ASSERT_UNEQUAL (baseA->GetObject<BaseB> (), 0);
    4.29    NS_TEST_ASSERT_UNEQUAL (baseB->GetObject<DerivedA> (), 0);
    4.30 @@ -788,7 +788,7 @@
    4.31  
    4.32    baseA = CreateObject<BaseA> ();
    4.33    baseB = CreateObject<BaseB> ();
    4.34 -  baseA->AddInterface (baseB);
    4.35 +  baseA->AggregateObject (baseB);
    4.36    baseA = 0;
    4.37    baseA = baseB->GetObject<BaseA> ();
    4.38  
    4.39 @@ -806,7 +806,7 @@
    4.40    NS_TEST_ASSERT (m_baseBTrace);
    4.41    baseB->TraceDisconnect ("/baseb-x",  MakeCallback (&ObjectTest::BaseBTrace, this));
    4.42  
    4.43 -  baseA->AddInterface (baseB);
    4.44 +  baseA->AggregateObject (baseB);
    4.45  
    4.46    baseA->TraceConnect ("/basea-x", MakeCallback (&ObjectTest::BaseATrace, this));
    4.47    m_baseATrace = false;
    4.48 @@ -838,7 +838,7 @@
    4.49    Ptr<DerivedA> derivedA;
    4.50    derivedA = CreateObject<DerivedA> (1);
    4.51    baseB = CreateObject<BaseB> ();
    4.52 -  derivedA->AddInterface (baseB);
    4.53 +  derivedA->AggregateObject (baseB);
    4.54    baseB->TraceConnect ("/$DerivedA/deriveda-x", MakeCallback (&ObjectTest::DerivedATrace, this));
    4.55    baseB->TraceConnect ("/$DerivedA/basea-x", MakeCallback (&ObjectTest::BaseATrace, this));
    4.56    m_derivedATrace = false;
     5.1 --- a/src/core/object.h	Thu Jan 31 22:11:03 2008 +0100
     5.2 +++ b/src/core/object.h	Thu Jan 31 22:23:46 2008 +0100
     5.3 @@ -180,7 +180,7 @@
     5.4     * method returns, it becomes possible to call GetObject
     5.5     * on one to get the other, and vice-versa. 
     5.6     */
     5.7 -  void AddInterface (Ptr<Object> other);
     5.8 +  void AggregateObject (Ptr<Object> other);
     5.9  
    5.10    /**
    5.11     * \param path the path to match for the callback
     6.1 --- a/src/devices/csma/csma-net-device.cc	Thu Jan 31 22:11:03 2008 +0100
     6.2 +++ b/src/devices/csma/csma-net-device.cc	Thu Jan 31 22:23:46 2008 +0100
     6.3 @@ -540,7 +540,7 @@
     6.4    NS_LOG_PARAM ("(" << em << ")");
     6.5    
     6.6    m_receiveErrorModel = em; 
     6.7 -  AddInterface (em);
     6.8 +  AggregateObject (em);
     6.9  }
    6.10  
    6.11  void
     7.1 --- a/src/devices/point-to-point/point-to-point-net-device.cc	Thu Jan 31 22:11:03 2008 +0100
     7.2 +++ b/src/devices/point-to-point/point-to-point-net-device.cc	Thu Jan 31 22:23:46 2008 +0100
     7.3 @@ -302,7 +302,7 @@
     7.4    NS_LOG_PARAMS ("(" << em << ")");
     7.5  
     7.6    m_receiveErrorModel = em;
     7.7 -  AddInterface (em);
     7.8 +  AggregateObject (em);
     7.9  }
    7.10  
    7.11  void PointToPointNetDevice::Receive (Ptr<Packet> packet)
     8.1 --- a/src/internet-node/arp-ipv4-interface.h	Thu Jan 31 22:11:03 2008 +0100
     8.2 +++ b/src/internet-node/arp-ipv4-interface.h	Thu Jan 31 22:23:46 2008 +0100
     8.3 @@ -34,7 +34,7 @@
     8.4   *
     8.5   * If you need to use ARP on top of a specific NetDevice, you
     8.6   * can use this Ipv4Interface subclass to wrap it for the Ipv4 class
     8.7 - * when calling Ipv4::AddInterface.
     8.8 + * when calling Ipv4::AggregateObject.
     8.9   */
    8.10  class ArpIpv4Interface : public Ipv4Interface
    8.11  {
     9.1 --- a/src/internet-node/internet-node.cc	Thu Jan 31 22:11:03 2008 +0100
     9.2 +++ b/src/internet-node/internet-node.cc	Thu Jan 31 22:23:46 2008 +0100
     9.3 @@ -73,12 +73,12 @@
     9.4    Ptr<TcpImpl> tcpImpl = CreateObject<TcpImpl> (tcp);
     9.5    Ptr<Ipv4Impl> ipv4Impl = CreateObject<Ipv4Impl> (ipv4);
     9.6  
     9.7 -  Object::AddInterface (ipv4);
     9.8 -  Object::AddInterface (arp);
     9.9 -  Object::AddInterface (ipv4Impl);
    9.10 -  Object::AddInterface (udpImpl);
    9.11 -  Object::AddInterface (tcpImpl);
    9.12 -  Object::AddInterface (ipv4L4Demux);
    9.13 +  Object::AggregateObject (ipv4);
    9.14 +  Object::AggregateObject (arp);
    9.15 +  Object::AggregateObject (ipv4Impl);
    9.16 +  Object::AggregateObject (udpImpl);
    9.17 +  Object::AggregateObject (tcpImpl);
    9.18 +  Object::AggregateObject (ipv4L4Demux);
    9.19  }
    9.20  
    9.21  Ptr<TraceResolver>
    10.1 --- a/src/mobility/grid-topology.cc	Thu Jan 31 22:11:03 2008 +0100
    10.2 +++ b/src/mobility/grid-topology.cc	Thu Jan 31 22:23:46 2008 +0100
    10.3 @@ -44,7 +44,7 @@
    10.4    x = m_xMin + m_deltaX * (i % m_n);
    10.5    y = m_yMin + m_deltaY * (i / m_n);
    10.6    Ptr<MobilityModel> mobility = m_positionTypeId.CreateObject ()->GetObject<MobilityModel> ();
    10.7 -  object->AddInterface (mobility);
    10.8 +  object->AggregateObject (mobility);
    10.9    mobility->SetPosition (Vector (x, y, 0.0));
   10.10  }
   10.11  
   10.12 @@ -55,7 +55,7 @@
   10.13    x = m_xMin + m_deltaX * (i / m_n);
   10.14    y = m_yMin + m_deltaY * (i % m_n);
   10.15    Ptr<MobilityModel> mobility = m_positionTypeId.CreateObject ()->GetObject<MobilityModel> ();
   10.16 -  object->AddInterface (mobility);
   10.17 +  object->AggregateObject (mobility);
   10.18    mobility->SetPosition (Vector (x, y, 0.0));
   10.19  }
   10.20  
    11.1 --- a/src/mobility/hierarchical-mobility-model.cc	Thu Jan 31 22:11:03 2008 +0100
    11.2 +++ b/src/mobility/hierarchical-mobility-model.cc	Thu Jan 31 22:23:46 2008 +0100
    11.3 @@ -43,12 +43,12 @@
    11.4    if (childNotifier == 0)
    11.5      {
    11.6        childNotifier = CreateObject<MobilityModelNotifier> ();
    11.7 -      child->AddInterface (childNotifier);
    11.8 +      child->AggregateObject (childNotifier);
    11.9      }
   11.10    if (parentNotifier == 0)
   11.11      {
   11.12        parentNotifier = CreateObject<MobilityModelNotifier> ();
   11.13 -      parent->AddInterface (parentNotifier);
   11.14 +      parent->AggregateObject (parentNotifier);
   11.15      }
   11.16    childNotifier->TraceConnect ("/course-changed", MakeCallback (&HierarchicalMobilityModel::ChildChanged, this));
   11.17    parentNotifier->TraceConnect ("/course-changed", MakeCallback (&HierarchicalMobilityModel::ParentChanged, this));
    12.1 --- a/src/mobility/ns2-mobility-file-topology.cc	Thu Jan 31 22:11:03 2008 +0100
    12.2 +++ b/src/mobility/ns2-mobility-file-topology.cc	Thu Jan 31 22:23:46 2008 +0100
    12.3 @@ -53,7 +53,7 @@
    12.4    if (model == 0)
    12.5      {
    12.6        model = CreateObject<StaticSpeedMobilityModel> ();
    12.7 -      object->AddInterface (model);
    12.8 +      object->AggregateObject (model);
    12.9      }
   12.10    return model;
   12.11  }
    13.1 --- a/src/mobility/random-topology.cc	Thu Jan 31 22:11:03 2008 +0100
    13.2 +++ b/src/mobility/random-topology.cc	Thu Jan 31 22:23:46 2008 +0100
    13.3 @@ -68,7 +68,7 @@
    13.4  RandomTopology::LayoutOne (Ptr<Object> object)
    13.5  {
    13.6    Ptr<MobilityModel> mobility = m_mobilityModel.CreateObject ()->GetObject<MobilityModel> ();
    13.7 -  object->AddInterface (mobility);
    13.8 +  object->AggregateObject (mobility);
    13.9    Vector position = m_positionModel->Get ();
   13.10    mobility->SetPosition (position);
   13.11  }
    14.1 --- a/src/node/node.cc	Thu Jan 31 22:11:03 2008 +0100
    14.2 +++ b/src/node/node.cc	Thu Jan 31 22:23:46 2008 +0100
    14.3 @@ -116,7 +116,7 @@
    14.4  {
    14.5    m_id = NodeList::Add (this);
    14.6    Ptr<PacketSocketFactory> socketFactory = CreateObject<PacketSocketFactory> ();
    14.7 -  AddInterface (socketFactory);
    14.8 +  AggregateObject (socketFactory);
    14.9  }
   14.10    
   14.11  Node::~Node ()
    15.1 --- a/src/routing/global-routing/global-route-manager-impl.cc	Thu Jan 31 22:11:03 2008 +0100
    15.2 +++ b/src/routing/global-routing/global-route-manager-impl.cc	Thu Jan 31 22:23:46 2008 +0100
    15.3 @@ -367,7 +367,7 @@
    15.4          node->GetId ());
    15.5  
    15.6        Ptr<GlobalRouter> globalRouter = CreateObject<GlobalRouter> ();
    15.7 -      node->AddInterface (globalRouter);
    15.8 +      node->AggregateObject (globalRouter);
    15.9      }
   15.10  }
   15.11  
    16.1 --- a/src/routing/olsr/olsr-agent-impl.cc	Thu Jan 31 22:11:03 2008 +0100
    16.2 +++ b/src/routing/olsr/olsr-agent-impl.cc	Thu Jan 31 22:23:46 2008 +0100
    16.3 @@ -173,7 +173,7 @@
    16.4    m_queuedMessagesTimer.SetFunction (&AgentImpl::SendQueuedMessages, this);
    16.5  
    16.6    // Aggregate with the Node, so that OLSR dies when the node is destroyed.
    16.7 -  node->AddInterface (this);
    16.8 +  node->AggregateObject (this);
    16.9  
   16.10    m_packetSequenceNumber = OLSR_MAX_SEQ_NUM;
   16.11    m_messageSequenceNumber = OLSR_MAX_SEQ_NUM;
    17.1 --- a/utils/mobility-visualizer-model.cc	Thu Jan 31 22:11:03 2008 +0100
    17.2 +++ b/utils/mobility-visualizer-model.cc	Thu Jan 31 22:23:46 2008 +0100
    17.3 @@ -94,7 +94,7 @@
    17.4    for (uint32_t i = 0; i < g_numNodes; i++)
    17.5      {
    17.6        Ptr<Node> node = CreateObject<Node> ();
    17.7 -      node->AddInterface (CreateObject<MobilityModelNotifier> ());
    17.8 +      node->AggregateObject (CreateObject<MobilityModelNotifier> ());
    17.9      }
   17.10  
   17.11    topology.Layout (NodeList::Begin (), NodeList::End ());
    18.1 --- a/utils/print-introspected-doxygen.cc	Thu Jan 31 22:11:03 2008 +0100
    18.2 +++ b/utils/print-introspected-doxygen.cc	Thu Jan 31 22:23:46 2008 +0100
    18.3 @@ -117,7 +117,7 @@
    18.4  int main (int argc, char *argv[])
    18.5  {
    18.6    Ptr<Node> node = CreateObject<InternetNode> ();
    18.7 -  node->AddInterface (CreateObject<MobilityModelNotifier> ());
    18.8 +  node->AggregateObject (CreateObject<MobilityModelNotifier> ());
    18.9  
   18.10    Ptr<PointToPointNetDevice> p2p = CreateObject<PointToPointNetDevice> (node);
   18.11    p2p->AddQueue (Queue::CreateDefault ());