diff --git a/examples/csma-multicast.cc b/examples/csma-multicast.cc index a1f783d72..a8b5e5fcd 100644 --- a/examples/csma-multicast.cc +++ b/examples/csma-multicast.cc @@ -211,7 +211,7 @@ main (int argc, char *argv[]) // a fine time to find the interface indices on node two. // Ptr ipv4; - ipv4 = n2->QueryInterface (); + ipv4 = n2->GetObject (); uint32_t ifIndexLan0 = ipv4->FindInterfaceForAddr (n2Lan0Addr); uint32_t ifIndexLan1 = ipv4->FindInterfaceForAddr (n2Lan1Addr); @@ -261,7 +261,7 @@ main (int argc, char *argv[]) // interface to find the output interface index, and tell node zero to send // its multicast traffic out that interface. // - ipv4 = n0->QueryInterface (); + ipv4 = n0->GetObject (); uint32_t ifIndexSrc = ipv4->FindInterfaceForAddr (multicastSource); ipv4->SetDefaultMulticastRoute (ifIndexSrc); // @@ -269,7 +269,7 @@ main (int argc, char *argv[]) // multicast data. To enable forwarding bits up the protocol stack, we need // to tell the stack to join the multicast group. // - ipv4 = n4->QueryInterface (); + ipv4 = n4->GetObject (); ipv4->JoinMulticastGroup (multicastSource, multicastGroup); // // Create an OnOff application to send UDP datagrams from node zero to the diff --git a/examples/simple-error-model.cc b/examples/simple-error-model.cc index 7f767644d..dac014ca3 100644 --- a/examples/simple-error-model.cc +++ b/examples/simple-error-model.cc @@ -185,9 +185,9 @@ main (int argc, char *argv[]) // This will likely set by some global StaticRouting object in the future NS_LOG_INFO ("Set Default Routes."); Ptr ipv4; - ipv4 = n0->QueryInterface (); + ipv4 = n0->GetObject (); ipv4->SetDefaultRoute (Ipv4Address ("10.1.1.2"), 1); - ipv4 = n3->QueryInterface (); + ipv4 = n3->GetObject (); ipv4->SetDefaultRoute (Ipv4Address ("10.1.3.1"), 1); // @@ -204,7 +204,7 @@ main (int argc, char *argv[]) NS_ASSERT (em != 0); // Now, query interface on the resulting em pointer to see if a // RateErrorModel interface exists. If so, set the packet error rate - Ptr bem = em->QueryInterface (); + Ptr bem = em->GetObject (); if (bem) { bem->SetRandomVariable (UniformVariable ()); diff --git a/examples/simple-point-to-point-olsr.cc b/examples/simple-point-to-point-olsr.cc index 877ca8269..d6ee23fb3 100644 --- a/examples/simple-point-to-point-olsr.cc +++ b/examples/simple-point-to-point-olsr.cc @@ -205,9 +205,9 @@ main (int argc, char *argv[]) // This will likely set by some global StaticRouting object in the future NS_LOG_INFO ("Set Default Routes."); Ptr ipv4; - ipv4 = n0->QueryInterface (); + ipv4 = n0->GetObject (); ipv4->SetDefaultRoute (Ipv4Address ("10.1.1.2"), 1); - ipv4 = n3->QueryInterface (); + ipv4 = n3->GetObject (); ipv4->SetDefaultRoute (Ipv4Address ("10.1.3.1"), 1); // Configure tracing of all enqueue, dequeue, and NetDevice receive events diff --git a/examples/simple-point-to-point.cc b/examples/simple-point-to-point.cc index cff6e2d53..8b04fedfd 100644 --- a/examples/simple-point-to-point.cc +++ b/examples/simple-point-to-point.cc @@ -206,9 +206,9 @@ main (int argc, char *argv[]) // This will likely set by some global StaticRouting object in the future NS_LOG_INFO ("Set Default Routes."); Ptr ipv4; - ipv4 = n0->QueryInterface (); + ipv4 = n0->GetObject (); ipv4->SetDefaultRoute (Ipv4Address ("10.1.1.2"), 1); - ipv4 = n3->QueryInterface (); + ipv4 = n3->GetObject (); ipv4->SetDefaultRoute (Ipv4Address ("10.1.3.1"), 1); // Configure tracing of all enqueue, dequeue, and NetDevice receive events diff --git a/examples/tcp-large-transfer-errors.cc b/examples/tcp-large-transfer-errors.cc index 3fee1d2ff..c7a355778 100644 --- a/examples/tcp-large-transfer-errors.cc +++ b/examples/tcp-large-transfer-errors.cc @@ -173,9 +173,9 @@ int main (int argc, char *argv[]) PointToPointTopology::AddIpv4Routes(n0, n1, channel0); PointToPointTopology::AddIpv4Routes(n1, n2, channel1); Ptr ipv4; - ipv4 = n0->QueryInterface (); + ipv4 = n0->GetObject (); ipv4->SetDefaultRoute (Ipv4Address ("10.1.3.2"), 1); - ipv4 = n2->QueryInterface (); + ipv4 = n2->GetObject (); ipv4->SetDefaultRoute (Ipv4Address ("10.1.2.1"), 1); @@ -191,7 +191,7 @@ int main (int argc, char *argv[]) uint16_t servPort = 50000; Ptr socketFactory = - n0->QueryInterface (); + n0->GetObject (); Ptr localSocket = socketFactory->CreateSocket (); localSocket->Bind (); diff --git a/examples/tcp-large-transfer.cc b/examples/tcp-large-transfer.cc index c203bc920..e2c7487be 100644 --- a/examples/tcp-large-transfer.cc +++ b/examples/tcp-large-transfer.cc @@ -173,9 +173,9 @@ int main (int argc, char *argv[]) PointToPointTopology::AddIpv4Routes(n0, n1, channel0); PointToPointTopology::AddIpv4Routes(n1, n2, channel1); Ptr ipv4; - ipv4 = n0->QueryInterface (); + ipv4 = n0->GetObject (); ipv4->SetDefaultRoute (Ipv4Address ("10.1.3.2"), 1); - ipv4 = n2->QueryInterface (); + ipv4 = n2->GetObject (); ipv4->SetDefaultRoute (Ipv4Address ("10.1.2.1"), 1); @@ -191,7 +191,7 @@ int main (int argc, char *argv[]) uint16_t servPort = 50000; Ptr socketFactory = - n0->QueryInterface (); + n0->GetObject (); Ptr localSocket = socketFactory->CreateSocket (); localSocket->Bind (); diff --git a/examples/tcp-nonlistening-server.cc b/examples/tcp-nonlistening-server.cc index 07077e5ec..645e35be3 100644 --- a/examples/tcp-nonlistening-server.cc +++ b/examples/tcp-nonlistening-server.cc @@ -136,9 +136,9 @@ int main (int argc, char *argv[]) PointToPointTopology::AddIpv4Routes(n0, n1, channel0); PointToPointTopology::AddIpv4Routes(n1, n2, channel1); Ptr ipv4; - ipv4 = n0->QueryInterface (); + ipv4 = n0->GetObject (); ipv4->SetDefaultRoute (Ipv4Address ("10.1.3.2"), 1); - ipv4 = n2->QueryInterface (); + ipv4 = n2->GetObject (); ipv4->SetDefaultRoute (Ipv4Address ("10.1.2.1"), 1); @@ -153,7 +153,7 @@ int main (int argc, char *argv[]) uint16_t servPort = 500; Ptr socketFactory = - n0->QueryInterface (); + n0->GetObject (); Ptr localSocket = socketFactory->CreateSocket (); localSocket->Bind (); diff --git a/examples/tcp-small-transfer-oneloss.cc b/examples/tcp-small-transfer-oneloss.cc index e0dd3800c..ea015e3ec 100644 --- a/examples/tcp-small-transfer-oneloss.cc +++ b/examples/tcp-small-transfer-oneloss.cc @@ -154,9 +154,9 @@ int main (int argc, char *argv[]) PointToPointTopology::AddIpv4Routes(n0, n1, channel0); PointToPointTopology::AddIpv4Routes(n1, n2, channel1); Ptr ipv4; - ipv4 = n0->QueryInterface (); + ipv4 = n0->GetObject (); ipv4->SetDefaultRoute (Ipv4Address ("10.1.3.2"), 1); - ipv4 = n2->QueryInterface (); + ipv4 = n2->GetObject (); ipv4->SetDefaultRoute (Ipv4Address ("10.1.2.1"), 1); @@ -173,7 +173,7 @@ int main (int argc, char *argv[]) uint16_t servPort = 500; Ptr socketFactory = - n0->QueryInterface (); + n0->GetObject (); Ptr localSocket = socketFactory->CreateSocket (); localSocket->Bind (); diff --git a/examples/tcp-small-transfer.cc b/examples/tcp-small-transfer.cc index 4fa2cd3b7..303a9a3bb 100644 --- a/examples/tcp-small-transfer.cc +++ b/examples/tcp-small-transfer.cc @@ -165,9 +165,9 @@ int main (int argc, char *argv[]) PointToPointTopology::AddIpv4Routes(n0, n1, channel0); PointToPointTopology::AddIpv4Routes(n1, n2, channel1); Ptr ipv4; - ipv4 = n0->QueryInterface (); + ipv4 = n0->GetObject (); ipv4->SetDefaultRoute (Ipv4Address ("10.1.3.2"), 1); - ipv4 = n2->QueryInterface (); + ipv4 = n2->GetObject (); ipv4->SetDefaultRoute (Ipv4Address ("10.1.2.1"), 1); @@ -183,7 +183,7 @@ int main (int argc, char *argv[]) uint16_t servPort = 500; Ptr socketFactory = - n0->QueryInterface (); + n0->GetObject (); Ptr localSocket = socketFactory->CreateSocket (); localSocket->Bind (); diff --git a/samples/main-adhoc-wifi.cc b/samples/main-adhoc-wifi.cc index 5370f3a20..a2fac76e4 100644 --- a/samples/main-adhoc-wifi.cc +++ b/samples/main-adhoc-wifi.cc @@ -58,14 +58,14 @@ CreateAdhocNode (Ptr channel, static void SetPosition (Ptr node, Vector position) { - Ptr mobility = node->QueryInterface (); + Ptr mobility = node->GetObject (); mobility->SetPosition (position); } static Vector GetPosition (Ptr node) { - Ptr mobility = node->QueryInterface (); + Ptr mobility = node->GetObject (); return mobility->GetPosition (); } @@ -96,7 +96,7 @@ static Ptr SetupPacketReceive (Ptr node, uint16_t port) { TypeId tid = TypeId::LookupByName ("Packet"); - Ptr socketFactory = node->QueryInterface (tid); + Ptr socketFactory = node->GetObject (tid); Ptr sink = socketFactory->CreateSocket (); sink->Bind (); sink->SetRecvCallback (MakeCallback (&ReceivePacket)); diff --git a/samples/main-ap-wifi.cc b/samples/main-ap-wifi.cc index 917887d08..a4d9359b7 100644 --- a/samples/main-ap-wifi.cc +++ b/samples/main-ap-wifi.cc @@ -102,14 +102,14 @@ CreateStaNode (Ptr channel, static void SetPosition (Ptr node, Vector position) { - Ptr mobility = node->QueryInterface (); + Ptr mobility = node->GetObject (); mobility->SetPosition (position); } static Vector GetPosition (Ptr node) { - Ptr mobility = node->QueryInterface (); + Ptr mobility = node->GetObject (); return mobility->GetPosition (); } diff --git a/samples/main-grid-topology.cc b/samples/main-grid-topology.cc index 7dc850e4d..d3d685fc4 100644 --- a/samples/main-grid-topology.cc +++ b/samples/main-grid-topology.cc @@ -39,7 +39,7 @@ int main (int argc, char *argv[]) j != nodes.end (); j++) { Ptr object = *j; - Ptr position = object->QueryInterface (); + Ptr position = object->GetObject (); NS_ASSERT (position != 0); Vector pos = position->GetPosition (); std::cout << "x=" << pos.x << ", y=" << pos.y << ", z=" << pos.z << std::endl; diff --git a/samples/main-simple.cc b/samples/main-simple.cc index f70486ab7..fedd173b3 100644 --- a/samples/main-simple.cc +++ b/samples/main-simple.cc @@ -43,7 +43,7 @@ RunSimulation (void) Ptr a = CreateObject (); TypeId tid = TypeId::LookupByName ("Udp"); - Ptr socketFactory = a->QueryInterface (tid); + Ptr socketFactory = a->GetObject (tid); Ptr sink = socketFactory->CreateSocket (); InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), 80); diff --git a/src/applications/onoff/onoff-application.cc b/src/applications/onoff/onoff-application.cc index af5409893..00f1fa9df 100644 --- a/src/applications/onoff/onoff-application.cc +++ b/src/applications/onoff/onoff-application.cc @@ -155,7 +155,7 @@ void OnOffApplication::StartApplication() // Called at time specified by Start if (!m_socket) { TypeId tid = TypeId::LookupByName (m_tid); - Ptr socketFactory = GetNode ()->QueryInterface (tid); + Ptr socketFactory = GetNode ()->GetObject (tid); m_socket = socketFactory->CreateSocket (); m_socket->Bind (); m_socket->Connect (m_peer); diff --git a/src/applications/packet-sink/packet-sink.cc b/src/applications/packet-sink/packet-sink.cc index bfea432dc..c97bd8596 100644 --- a/src/applications/packet-sink/packet-sink.cc +++ b/src/applications/packet-sink/packet-sink.cc @@ -75,7 +75,7 @@ void PacketSink::StartApplication() // Called at time specified by Start { TypeId tid = TypeId::LookupByName (m_tid); Ptr socketFactory = - GetNode ()->QueryInterface (tid); + GetNode ()->GetObject (tid); m_socket = socketFactory->CreateSocket (); m_socket->Bind (m_local); m_socket->Listen (0); diff --git a/src/applications/udp-echo/udp-echo-client.cc b/src/applications/udp-echo/udp-echo-client.cc index d25c19fb0..80496f7ae 100644 --- a/src/applications/udp-echo/udp-echo-client.cc +++ b/src/applications/udp-echo/udp-echo-client.cc @@ -93,7 +93,7 @@ UdpEchoClient::StartApplication (void) { TypeId tid = TypeId::LookupByName ("Udp"); Ptr socketFactory = - GetNode ()->QueryInterface (tid); + GetNode ()->GetObject (tid); m_socket = socketFactory->CreateSocket (); m_socket->Bind (); m_socket->Connect (m_peer); diff --git a/src/applications/udp-echo/udp-echo-server.cc b/src/applications/udp-echo/udp-echo-server.cc index 8dbfaf330..4af808897 100644 --- a/src/applications/udp-echo/udp-echo-server.cc +++ b/src/applications/udp-echo/udp-echo-server.cc @@ -79,7 +79,7 @@ UdpEchoServer::StartApplication (void) { TypeId tid = TypeId::LookupByName ("Udp"); Ptr socketFactory = - GetNode ()->QueryInterface (tid); + GetNode ()->GetObject (tid); m_socket = socketFactory->CreateSocket (); m_socket->Bind (m_local); } diff --git a/src/common/error-model.cc b/src/common/error-model.cc index c512aefb2..09cb22db7 100644 --- a/src/common/error-model.cc +++ b/src/common/error-model.cc @@ -64,7 +64,7 @@ ErrorModel::CreateDefault (void) { NS_LOG_FUNCTION; TypeId interfaceId = g_interfaceIdErrorModelDefaultValue.GetValue (); - Ptr em = interfaceId.CreateObject ()->QueryInterface (); + Ptr em = interfaceId.CreateObject ()->GetObject (); return em; } diff --git a/src/core/object.cc b/src/core/object.cc index ee2581ce9..1b8b456a8 100644 --- a/src/core/object.cc +++ b/src/core/object.cc @@ -216,7 +216,7 @@ TypeIdTraceResolver::ParseForInterface (std::string path) } std::string interfaceName = element.substr (1, std::string::npos); TypeId interfaceId = TypeId::LookupByName (interfaceName); - Ptr interface = m_aggregate->QueryInterface (interfaceId); + Ptr interface = m_aggregate->GetObject (interfaceId); return interface; } void @@ -377,7 +377,7 @@ Object::~Object () m_next = 0; } Ptr -Object::DoQueryInterface (TypeId tid) const +Object::DoGetObject (TypeId tid) const { NS_ASSERT (CheckLoose ()); const Object *currentObject = this; @@ -751,46 +751,46 @@ ObjectTest::RunTests (void) bool result = true; Ptr baseA = CreateObject (); - NS_TEST_ASSERT_EQUAL (baseA->QueryInterface (), baseA); - NS_TEST_ASSERT_EQUAL (baseA->QueryInterface (DerivedA::GetTypeId ()), 0); - NS_TEST_ASSERT_EQUAL (baseA->QueryInterface (), 0); + NS_TEST_ASSERT_EQUAL (baseA->GetObject (), baseA); + NS_TEST_ASSERT_EQUAL (baseA->GetObject (DerivedA::GetTypeId ()), 0); + NS_TEST_ASSERT_EQUAL (baseA->GetObject (), 0); baseA = CreateObject (10); - NS_TEST_ASSERT_EQUAL (baseA->QueryInterface (), baseA); - NS_TEST_ASSERT_EQUAL (baseA->QueryInterface (DerivedA::GetTypeId ()), baseA); - NS_TEST_ASSERT_UNEQUAL (baseA->QueryInterface (), 0); + NS_TEST_ASSERT_EQUAL (baseA->GetObject (), baseA); + NS_TEST_ASSERT_EQUAL (baseA->GetObject (DerivedA::GetTypeId ()), baseA); + NS_TEST_ASSERT_UNEQUAL (baseA->GetObject (), 0); baseA = CreateObject (); Ptr baseB = CreateObject (); Ptr baseBCopy = baseB; baseA->AddInterface (baseB); - NS_TEST_ASSERT_UNEQUAL (baseA->QueryInterface (), 0); - NS_TEST_ASSERT_EQUAL (baseA->QueryInterface (), 0); - NS_TEST_ASSERT_UNEQUAL (baseA->QueryInterface (), 0); - NS_TEST_ASSERT_EQUAL (baseA->QueryInterface (), 0); - NS_TEST_ASSERT_UNEQUAL (baseB->QueryInterface (), 0); - NS_TEST_ASSERT_EQUAL (baseB->QueryInterface (), 0); - NS_TEST_ASSERT_UNEQUAL (baseB->QueryInterface (), 0); - NS_TEST_ASSERT_EQUAL (baseB->QueryInterface (), 0); - NS_TEST_ASSERT_UNEQUAL (baseBCopy->QueryInterface (), 0); + NS_TEST_ASSERT_UNEQUAL (baseA->GetObject (), 0); + NS_TEST_ASSERT_EQUAL (baseA->GetObject (), 0); + NS_TEST_ASSERT_UNEQUAL (baseA->GetObject (), 0); + NS_TEST_ASSERT_EQUAL (baseA->GetObject (), 0); + NS_TEST_ASSERT_UNEQUAL (baseB->GetObject (), 0); + NS_TEST_ASSERT_EQUAL (baseB->GetObject (), 0); + NS_TEST_ASSERT_UNEQUAL (baseB->GetObject (), 0); + NS_TEST_ASSERT_EQUAL (baseB->GetObject (), 0); + NS_TEST_ASSERT_UNEQUAL (baseBCopy->GetObject (), 0); baseA = CreateObject (1); baseB = CreateObject (1); baseBCopy = baseB; baseA->AddInterface (baseB); - NS_TEST_ASSERT_UNEQUAL (baseA->QueryInterface (), 0); - NS_TEST_ASSERT_UNEQUAL (baseA->QueryInterface (), 0); - NS_TEST_ASSERT_UNEQUAL (baseB->QueryInterface (), 0); - NS_TEST_ASSERT_UNEQUAL (baseB->QueryInterface (), 0); - NS_TEST_ASSERT_UNEQUAL (baseBCopy->QueryInterface (), 0); - NS_TEST_ASSERT_UNEQUAL (baseBCopy->QueryInterface (), 0); - NS_TEST_ASSERT_UNEQUAL (baseB->QueryInterface (), 0); - NS_TEST_ASSERT_UNEQUAL (baseB->QueryInterface (), 0) + NS_TEST_ASSERT_UNEQUAL (baseA->GetObject (), 0); + NS_TEST_ASSERT_UNEQUAL (baseA->GetObject (), 0); + NS_TEST_ASSERT_UNEQUAL (baseB->GetObject (), 0); + NS_TEST_ASSERT_UNEQUAL (baseB->GetObject (), 0); + NS_TEST_ASSERT_UNEQUAL (baseBCopy->GetObject (), 0); + NS_TEST_ASSERT_UNEQUAL (baseBCopy->GetObject (), 0); + NS_TEST_ASSERT_UNEQUAL (baseB->GetObject (), 0); + NS_TEST_ASSERT_UNEQUAL (baseB->GetObject (), 0) baseA = CreateObject (); baseB = CreateObject (); baseA->AddInterface (baseB); baseA = 0; - baseA = baseB->QueryInterface (); + baseA = baseB->GetObject (); baseA = CreateObject (); baseA->TraceConnect ("/basea-x", MakeCallback (&ObjectTest::BaseATrace, this)); @@ -863,13 +863,13 @@ ObjectTest::RunTests (void) // Test the object creation code of TypeId Ptr a = BaseA::GetTypeId ().CreateObject (); - NS_TEST_ASSERT_EQUAL (a->QueryInterface (), a); - NS_TEST_ASSERT_EQUAL (a->QueryInterface (DerivedA::GetTypeId ()), 0); - NS_TEST_ASSERT_EQUAL (a->QueryInterface (), 0); + NS_TEST_ASSERT_EQUAL (a->GetObject (), a); + NS_TEST_ASSERT_EQUAL (a->GetObject (DerivedA::GetTypeId ()), 0); + NS_TEST_ASSERT_EQUAL (a->GetObject (), 0); a = DerivedA::GetTypeId ().CreateObject (10); - NS_TEST_ASSERT_EQUAL (a->QueryInterface (), a); - NS_TEST_ASSERT_EQUAL (a->QueryInterface (DerivedA::GetTypeId ()), a); - NS_TEST_ASSERT_UNEQUAL (a->QueryInterface (), 0); + NS_TEST_ASSERT_EQUAL (a->GetObject (), a); + NS_TEST_ASSERT_EQUAL (a->GetObject (DerivedA::GetTypeId ()), a); + NS_TEST_ASSERT_UNEQUAL (a->GetObject (), 0); return result; diff --git a/src/core/object.h b/src/core/object.h index 952a1f7ab..40b0b50df 100644 --- a/src/core/object.h +++ b/src/core/object.h @@ -130,7 +130,7 @@ private: * * Note: This base class is quite similar in spirit to IUnknown in COM or * BonoboObject in Bonobo: it provides three main methods: Ref, Unref and - * QueryInterface. + * GetObject. */ class Object { @@ -157,13 +157,13 @@ public: * \returns a pointer to the requested interface or zero if it could not be found. */ template - Ptr QueryInterface (void) const; + Ptr GetObject (void) const; /** * \param tid the interface id of the requested interface * \returns a pointer to the requested interface or zero if it could not be found. */ template - Ptr QueryInterface (TypeId tid) const; + Ptr GetObject (TypeId tid) const; /** * Run the DoDispose methods of this object and all the * objects aggregated to it. @@ -177,7 +177,7 @@ public: * \param other another object pointer * * This method aggregates the two objects together: after this - * method returns, it becomes possible to call QueryInterface + * method returns, it becomes possible to call GetObject * on one to get the other, and vice-versa. */ void AddInterface (Ptr other); @@ -231,7 +231,7 @@ private: template friend Ptr CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7); - Ptr DoQueryInterface (TypeId tid) const; + Ptr DoGetObject (TypeId tid) const; void DoCollectSources (std::string path, const TraceContext &context, TraceResolver::SourceCollection *collection) const; void DoTraceAll (std::ostream &os, const TraceContext &context) const; @@ -439,9 +439,9 @@ Object::Unref (void) const template Ptr -Object::QueryInterface () const +Object::GetObject () const { - Ptr found = DoQueryInterface (T::GetTypeId ()); + Ptr found = DoGetObject (T::GetTypeId ()); if (found != 0) { return Ptr (dynamic_cast (PeekPointer (found))); @@ -451,9 +451,9 @@ Object::QueryInterface () const template Ptr -Object::QueryInterface (TypeId tid) const +Object::GetObject (TypeId tid) const { - Ptr found = DoQueryInterface (tid); + Ptr found = DoGetObject (tid); if (found != 0) { return Ptr (dynamic_cast (PeekPointer (found))); diff --git a/src/devices/csma/csma-ipv4-topology.cc b/src/devices/csma/csma-ipv4-topology.cc index ce49f16e5..c069a90a4 100644 --- a/src/devices/csma/csma-ipv4-topology.cc +++ b/src/devices/csma/csma-ipv4-topology.cc @@ -101,7 +101,7 @@ CsmaIpv4Topology::AddIpv4Address( { Ptr nd = node->GetDevice(netDeviceNumber); - Ptr ipv4 = node->QueryInterface (); + Ptr ipv4 = node->GetObject (); uint32_t ifIndex = ipv4->AddInterface (nd); ipv4->SetAddress (ifIndex, address); @@ -116,8 +116,8 @@ CsmaIpv4Topology::AddIpv4Routes ( Ptr nd1, Ptr nd2) { // Assert that both are Ipv4 nodes - Ptr ip1 = nd1->GetNode ()->QueryInterface (); - Ptr ip2 = nd2->GetNode ()->QueryInterface (); + Ptr ip1 = nd1->GetNode ()->GetObject (); + Ptr ip2 = nd2->GetNode ()->GetObject (); NS_ASSERT(ip1 != 0 && ip2 != 0); // Get interface indexes for both nodes corresponding to the right channel diff --git a/src/devices/csma/csma-topology.cc b/src/devices/csma/csma-topology.cc index e5277d7cd..208c69ec3 100644 --- a/src/devices/csma/csma-topology.cc +++ b/src/devices/csma/csma-topology.cc @@ -90,7 +90,7 @@ CsmaTopology::CreatePacketSocket(Ptr n1, std::string tid_name) TypeId tid = TypeId::LookupByName (tid_name); Ptr socketFactory = - n1->QueryInterface (tid); + n1->GetObject (tid); Ptr socket = socketFactory->CreateSocket (); diff --git a/src/devices/point-to-point/point-to-point-topology.cc b/src/devices/point-to-point/point-to-point-topology.cc index b5a08bf9c..d492fec8a 100644 --- a/src/devices/point-to-point/point-to-point-topology.cc +++ b/src/devices/point-to-point/point-to-point-topology.cc @@ -111,14 +111,14 @@ PointToPointTopology::AddIpv4Addresses( NS_ASSERT (nd1->GetNode ()->GetId () == n1->GetId ()); NS_ASSERT (nd2->GetNode ()->GetId () == n2->GetId ()); - Ptr ip1 = n1->QueryInterface (); + Ptr ip1 = n1->GetObject (); uint32_t index1 = ip1->AddInterface (nd1); ip1->SetAddress (index1, addr1); ip1->SetNetworkMask (index1, netmask); ip1->SetUp (index1); - Ptr ip2 = n2->QueryInterface (); + Ptr ip2 = n2->GetObject (); uint32_t index2 = ip2->AddInterface (nd2); ip2->SetAddress (index2, addr2); @@ -153,7 +153,7 @@ PointToPointTopology::SetIpv4Metric( // Get interface indexes for both nodes corresponding to the right channel uint32_t index = 0; bool found = false; - Ptr ip1 = n1->QueryInterface (); + Ptr ip1 = n1->GetObject (); for (uint32_t i = 0; i < ip1->GetNInterfaces (); i++) { if (ip1 ->GetNetDevice (i) == nd1) @@ -167,7 +167,7 @@ PointToPointTopology::SetIpv4Metric( index = 0; found = false; - Ptr ip2 = n2->QueryInterface (); + Ptr ip2 = n2->GetObject (); for (uint32_t i = 0; i < ip2->GetNInterfaces (); i++) { if (ip2 ->GetNetDevice (i) == nd2) @@ -212,8 +212,8 @@ PointToPointTopology::AddIpv4Routes ( } // Assert that both are Ipv4 nodes - Ptr ip1 = nd1->GetNode ()->QueryInterface (); - Ptr ip2 = nd2->GetNode ()->QueryInterface (); + Ptr ip1 = nd1->GetNode ()->GetObject (); + Ptr ip2 = nd2->GetNode ()->GetObject (); NS_ASSERT(ip1 != 0 && ip2 != 0); // Get interface indexes for both nodes corresponding to the right channel diff --git a/src/devices/wifi/wifi-channel.cc b/src/devices/wifi/wifi-channel.cc index c32182216..76e678e3e 100644 --- a/src/devices/wifi/wifi-channel.cc +++ b/src/devices/wifi/wifi-channel.cc @@ -60,13 +60,13 @@ void WifiChannel::Send (Ptr sender, Ptr packet, double txPowerDbm, WifiMode wifiMode, WifiPreamble preamble) const { - Ptr senderMobility = sender->GetNode ()->QueryInterface (); + Ptr senderMobility = sender->GetNode ()->GetObject (); uint32_t j = 0; for (DeviceList::const_iterator i = m_deviceList.begin (); i != m_deviceList.end (); i++) { if (sender != i->first) { - Ptr receiverMobility = i->first->GetNode ()->QueryInterface (); + Ptr receiverMobility = i->first->GetNode ()->GetObject (); Time delay = m_delay->GetDelay (senderMobility, receiverMobility); double rxPowerDbm = m_loss->GetRxPower (txPowerDbm, senderMobility, receiverMobility); NS_LOG_DEBUG ("propagation: txPower="< p, Ipv4Address dest) { NS_LOG_LOGIC ("Needs ARP"); Ptr arp = - m_node->QueryInterface (); + m_node->GetObject (); Address hardwareDestination; bool found; diff --git a/src/internet-node/arp-l3-protocol.cc b/src/internet-node/arp-l3-protocol.cc index 2fb34c50a..d49d2cc0e 100644 --- a/src/internet-node/arp-l3-protocol.cc +++ b/src/internet-node/arp-l3-protocol.cc @@ -80,7 +80,7 @@ ArpL3Protocol::FindCache (Ptr device) return *i; } } - Ptr ipv4 = m_node->QueryInterface (); + Ptr ipv4 = m_node->GetObject (); Ptr interface = ipv4->FindInterfaceForDevice (device); ArpCache * cache = new ArpCache (device, interface); NS_ASSERT (device->IsBroadcast ()); diff --git a/src/internet-node/internet-node.cc b/src/internet-node/internet-node.cc index c99c92252..5a3b40c53 100644 --- a/src/internet-node/internet-node.cc +++ b/src/internet-node/internet-node.cc @@ -85,7 +85,7 @@ Ptr InternetNode::GetTraceResolver () const { Ptr resolver = Create (); - Ptr ipv4 = QueryInterface (); + Ptr ipv4 = GetObject (); resolver->AddComposite ("ipv4", ipv4); resolver->SetParentResolver (Node::GetTraceResolver ()); return resolver; diff --git a/src/internet-node/ipv4-l3-protocol.cc b/src/internet-node/ipv4-l3-protocol.cc index 4bcec3f85..22a86c06b 100644 --- a/src/internet-node/ipv4-l3-protocol.cc +++ b/src/internet-node/ipv4-l3-protocol.cc @@ -751,7 +751,7 @@ Ipv4L3Protocol::ForwardUp (Ptr p, Ipv4Header const&ip, NS_LOG_FUNCTION; NS_LOG_PARAMS (this << p << &ip); - Ptr demux = m_node->QueryInterface (); + Ptr demux = m_node->GetObject (); Ptr protocol = demux->GetProtocol (ip.GetProtocol ()); protocol->Receive (p, ip.GetSource (), ip.GetDestination (), incomingInterface); } diff --git a/src/internet-node/ipv4-loopback-interface.cc b/src/internet-node/ipv4-loopback-interface.cc index 53e0c96d9..9f1f82360 100644 --- a/src/internet-node/ipv4-loopback-interface.cc +++ b/src/internet-node/ipv4-loopback-interface.cc @@ -51,7 +51,7 @@ Ipv4LoopbackInterface::SendTo (Ptr packet, Ipv4Address dest) NS_LOG_PARAMS (this << packet << dest); Ptr ipv4 = - m_node->QueryInterface (); + m_node->GetObject (); ipv4->Receive (0, packet, Ipv4L3Protocol::PROT_NUMBER, Mac48Address ("ff:ff:ff:ff:ff:ff")); diff --git a/src/internet-node/rtt-estimator.cc b/src/internet-node/rtt-estimator.cc index 02f3c72cb..8a6d07a20 100644 --- a/src/internet-node/rtt-estimator.cc +++ b/src/internet-node/rtt-estimator.cc @@ -168,7 +168,7 @@ void RttEstimator::InitialEstimate (Time e) Ptr RttEstimator::CreateDefault () { TypeId tid = defaultTid.GetValue (); - Ptr rtte = tid.CreateObject (0.1, initialEstimate)->QueryInterface (); + Ptr rtte = tid.CreateObject (0.1, initialEstimate)->GetObject (); return rtte; } diff --git a/src/internet-node/tcp-l4-protocol.cc b/src/internet-node/tcp-l4-protocol.cc index 10006fe28..0e42a095d 100644 --- a/src/internet-node/tcp-l4-protocol.cc +++ b/src/internet-node/tcp-l4-protocol.cc @@ -450,7 +450,7 @@ TcpL4Protocol::Send (Ptr packet, packet->AddHeader (tcpHeader); Ptr ipv4 = - m_node->QueryInterface (); + m_node->GetObject (); if (ipv4 != 0) { ipv4->Send (packet, saddr, daddr, PROT_NUMBER); @@ -472,7 +472,7 @@ TcpL4Protocol::SendPacket (Ptr packet, TcpHeader outgoingHeader, packet->AddHeader (outgoingHeader); Ptr ipv4 = - m_node->QueryInterface (); + m_node->GetObject (); if (ipv4 != 0) { ipv4->Send (packet, saddr, daddr, PROT_NUMBER); diff --git a/src/internet-node/tcp-socket.cc b/src/internet-node/tcp-socket.cc index 627a81c9d..821bf0839 100644 --- a/src/internet-node/tcp-socket.cc +++ b/src/internet-node/tcp-socket.cc @@ -234,7 +234,7 @@ TcpSocket::Connect (const Address & address) m_defaultPort = transport.GetPort (); uint32_t localIfIndex; - Ptr ipv4 = m_node->QueryInterface (); + Ptr ipv4 = m_node->GetObject (); if (ipv4->GetIfIndexForDestination (m_defaultAddress, localIfIndex)) { @@ -557,7 +557,7 @@ bool TcpSocket::ProcessPacketAction (Actions_t a, Ptr p, NS_LOG_FUNCTION; NS_LOG_PARAMS (this << p << "tcpHeader " << fromAddress); uint32_t localIfIndex; - Ptr ipv4 = m_node->QueryInterface (); + Ptr ipv4 = m_node->GetObject (); switch (a) { case SYN_ACK_TX: diff --git a/src/internet-node/udp-l4-protocol.cc b/src/internet-node/udp-l4-protocol.cc index 3a0584d22..f990c769b 100644 --- a/src/internet-node/udp-l4-protocol.cc +++ b/src/internet-node/udp-l4-protocol.cc @@ -159,7 +159,7 @@ UdpL4Protocol::Send (Ptr packet, packet->AddHeader (udpHeader); - Ptr ipv4 = m_node->QueryInterface (); + Ptr ipv4 = m_node->GetObject (); if (ipv4 != 0) { NS_LOG_LOGIC ("Sending to IP"); diff --git a/src/internet-node/udp-socket.cc b/src/internet-node/udp-socket.cc index ce51b648f..587f72a64 100644 --- a/src/internet-node/udp-socket.cc +++ b/src/internet-node/udp-socket.cc @@ -268,7 +268,7 @@ UdpSocket::DoSendTo (Ptr p, Ipv4Address dest, uint16_t port) } uint32_t localIfIndex; - Ptr ipv4 = m_node->QueryInterface (); + Ptr ipv4 = m_node->GetObject (); // // If dest is sent to the limited broadcast address (all ones), @@ -386,7 +386,7 @@ UdpSocketTest::RunTests (void) Ptr rxNode = CreateObject (); Ptr rxDev = CreateObject (rxNode); rxDev->AddQueue(CreateObject ()); - Ptr ipv4 = rxNode->QueryInterface (); + Ptr ipv4 = rxNode->GetObject (); uint32_t netdev_idx = ipv4->AddInterface (rxDev); ipv4->SetAddress (netdev_idx, Ipv4Address ("10.0.0.1")); ipv4->SetNetworkMask (netdev_idx, Ipv4Mask (0xffff0000U)); @@ -396,7 +396,7 @@ UdpSocketTest::RunTests (void) Ptr txNode = CreateObject (); Ptr txDev = CreateObject (txNode); txDev->AddQueue(CreateObject ()); - ipv4 = txNode->QueryInterface (); + ipv4 = txNode->GetObject (); netdev_idx = ipv4->AddInterface (txDev); ipv4->SetAddress (netdev_idx, Ipv4Address ("10.0.0.2")); ipv4->SetNetworkMask (netdev_idx, Ipv4Mask (0xffff0000U)); @@ -409,12 +409,12 @@ UdpSocketTest::RunTests (void) // Create the UDP sockets - Ptr rxSocketFactory = rxNode->QueryInterface (); + Ptr rxSocketFactory = rxNode->GetObject (); Ptr rxSocket = rxSocketFactory->CreateSocket (); NS_TEST_ASSERT_EQUAL (rxSocket->Bind (InetSocketAddress (Ipv4Address ("10.0.0.2"), 1234)), 0); rxSocket->SetRecvCallback (MakeCallback (&UdpSocketTest::ReceivePacket, this)); - Ptr txSocketFactory = txNode->QueryInterface (); + Ptr txSocketFactory = txNode->GetObject (); Ptr txSocket = txSocketFactory->CreateSocket (); // ------ Now the tests ------------ diff --git a/src/mobility/grid-topology.cc b/src/mobility/grid-topology.cc index e83946f66..729c016a6 100644 --- a/src/mobility/grid-topology.cc +++ b/src/mobility/grid-topology.cc @@ -43,7 +43,7 @@ GridTopology::LayoutOneRowFirst (Ptr object, uint32_t i) double x, y; x = m_xMin + m_deltaX * (i % m_n); y = m_yMin + m_deltaY * (i / m_n); - Ptr mobility = m_positionTypeId.CreateObject ()->QueryInterface (); + Ptr mobility = m_positionTypeId.CreateObject ()->GetObject (); object->AddInterface (mobility); mobility->SetPosition (Vector (x, y, 0.0)); } @@ -54,7 +54,7 @@ GridTopology::LayoutOneColumnFirst (Ptr object, uint32_t i) double x, y; x = m_xMin + m_deltaX * (i / m_n); y = m_yMin + m_deltaY * (i % m_n); - Ptr mobility = m_positionTypeId.CreateObject ()->QueryInterface (); + Ptr mobility = m_positionTypeId.CreateObject ()->GetObject (); object->AddInterface (mobility); mobility->SetPosition (Vector (x, y, 0.0)); } diff --git a/src/mobility/hierarchical-mobility-model.cc b/src/mobility/hierarchical-mobility-model.cc index 46f0150b3..0f35d6d16 100644 --- a/src/mobility/hierarchical-mobility-model.cc +++ b/src/mobility/hierarchical-mobility-model.cc @@ -37,9 +37,9 @@ HierarchicalMobilityModel::HierarchicalMobilityModel (Ptr child, m_parent (parent) { Ptr childNotifier = - m_child->QueryInterface (); + m_child->GetObject (); Ptr parentNotifier = - m_parent->QueryInterface (); + m_parent->GetObject (); if (childNotifier == 0) { childNotifier = CreateObject (); diff --git a/src/mobility/mobility-model.cc b/src/mobility/mobility-model.cc index a27a230ac..cb18f2d86 100644 --- a/src/mobility/mobility-model.cc +++ b/src/mobility/mobility-model.cc @@ -65,7 +65,7 @@ MobilityModel::GetDistanceFrom (Ptr other) const void MobilityModel::NotifyCourseChange (void) const { - Ptr notifier = QueryInterface (); + Ptr notifier = GetObject (); if (notifier != 0) { notifier->Notify (this); diff --git a/src/mobility/ns2-mobility-file-topology.cc b/src/mobility/ns2-mobility-file-topology.cc index 5f804f769..b321734da 100644 --- a/src/mobility/ns2-mobility-file-topology.cc +++ b/src/mobility/ns2-mobility-file-topology.cc @@ -49,7 +49,7 @@ Ns2MobilityFileTopology::GetMobilityModel (std::string idString, const ObjectSto { return 0; } - Ptr model = object->QueryInterface (); + Ptr model = object->GetObject (); if (model == 0) { model = CreateObject (); diff --git a/src/mobility/random-topology.cc b/src/mobility/random-topology.cc index 7547b9886..5610ee3e9 100644 --- a/src/mobility/random-topology.cc +++ b/src/mobility/random-topology.cc @@ -41,7 +41,7 @@ g_mobility ("RandomTopologyMobilityType", RandomTopology::RandomTopology () : m_mobilityModel (g_mobility.GetValue ()) { - m_positionModel = g_position.GetValue ().CreateObject ()->QueryInterface (); + m_positionModel = g_position.GetValue ().CreateObject ()->GetObject (); } RandomTopology::RandomTopology (Ptr positionModel, TypeId mobilityModel) : m_positionModel (positionModel), @@ -67,7 +67,7 @@ RandomTopology::SetPositionModel (Ptr positionModel) void RandomTopology::LayoutOne (Ptr object) { - Ptr mobility = m_mobilityModel.CreateObject ()->QueryInterface (); + Ptr mobility = m_mobilityModel.CreateObject ()->GetObject (); object->AddInterface (mobility); Vector position = m_positionModel->Get (); mobility->SetPosition (position); diff --git a/src/mobility/random-waypoint-mobility-model.cc b/src/mobility/random-waypoint-mobility-model.cc index 408a6f38d..4677edcf6 100644 --- a/src/mobility/random-waypoint-mobility-model.cc +++ b/src/mobility/random-waypoint-mobility-model.cc @@ -50,7 +50,7 @@ RandomWaypointMobilityModelParameters::RandomWaypointMobilityModelParameters () : m_speed (g_speed.GetCopy ()), m_pause (g_pause.GetCopy ()) { - m_position = g_position.GetValue ().CreateObject ()->QueryInterface (); + m_position = g_position.GetValue ().CreateObject ()->GetObject (); } RandomWaypointMobilityModelParameters::RandomWaypointMobilityModelParameters (Ptr randomPosition, const RandomVariable &speed, diff --git a/src/node/packet-socket-factory.cc b/src/node/packet-socket-factory.cc index f396393fe..41f51afdc 100644 --- a/src/node/packet-socket-factory.cc +++ b/src/node/packet-socket-factory.cc @@ -39,7 +39,7 @@ PacketSocketFactory::PacketSocketFactory () Ptr PacketSocketFactory::CreateSocket (void) { - Ptr node = QueryInterface (); + Ptr node = GetObject (); Ptr socket = CreateObject (node); return socket; } diff --git a/src/node/queue.cc b/src/node/queue.cc index fb157b0a0..b2e0ffbc9 100644 --- a/src/node/queue.cc +++ b/src/node/queue.cc @@ -284,7 +284,7 @@ Queue::CreateDefault (void) { NS_LOG_FUNCTION; TypeId interfaceId = g_interfaceIdDefaultValue.GetValue (); - Ptr queue = interfaceId.CreateObject ()->QueryInterface (); + Ptr queue = interfaceId.CreateObject ()->GetObject (); return queue; } diff --git a/src/routing/global-routing/global-route-manager-impl.cc b/src/routing/global-routing/global-route-manager-impl.cc index 95ea3a51a..73eddc9db 100644 --- a/src/routing/global-routing/global-route-manager-impl.cc +++ b/src/routing/global-routing/global-route-manager-impl.cc @@ -392,7 +392,7 @@ GlobalRouteManagerImpl::BuildGlobalRoutingDatabase () Ptr node = *i; Ptr rtr = - node->QueryInterface (); + node->GetObject (); // // Ignore nodes that aren't participating in routing. // @@ -476,7 +476,7 @@ GlobalRouteManagerImpl::InitializeRoutes () // participating in routing. // Ptr rtr = - node->QueryInterface (); + node->GetObject (); // // if the node has a global router interface, then run the global routing // algorithms. @@ -1145,7 +1145,7 @@ GlobalRouteManagerImpl::FindOutgoingTypeId (Ipv4Address a, Ipv4Mask amask) Ptr node = *i; Ptr rtr = - node->QueryInterface (); + node->GetObject (); // // If the node doesn't have a GlobalRouter interface it can't be the one // we're interested in. @@ -1163,7 +1163,7 @@ GlobalRouteManagerImpl::FindOutgoingTypeId (Ipv4Address a, Ipv4Mask amask) // is participating in routing IP version 4 packets, it certainly must have // an Ipv4 interface. // - Ptr ipv4 = node->QueryInterface (); + Ptr ipv4 = node->GetObject (); NS_ASSERT_MSG (ipv4, "GlobalRouteManagerImpl::FindOutgoingTypeId (): " "QI for interface failed"); @@ -1229,7 +1229,7 @@ GlobalRouteManagerImpl::SPFIntraAddRouter (SPFVertex* v) // in question cannot be the router we want, so we continue. // Ptr rtr = - node->QueryInterface (); + node->GetObject (); if (rtr == 0) { @@ -1252,7 +1252,7 @@ GlobalRouteManagerImpl::SPFIntraAddRouter (SPFVertex* v) // for that interface. If the node is acting as an IP version 4 router, it // should absolutely have an Ipv4 interface. // - Ptr ipv4 = node->QueryInterface (); + Ptr ipv4 = node->GetObject (); NS_ASSERT_MSG (ipv4, "GlobalRouteManagerImpl::SPFIntraAddRouter (): " "QI for interface failed"); @@ -1346,7 +1346,7 @@ GlobalRouteManagerImpl::SPFIntraAddTransit (SPFVertex* v) // in question cannot be the router we want, so we continue. // Ptr rtr = - node->QueryInterface (); + node->GetObject (); if (rtr == 0) { @@ -1369,7 +1369,7 @@ GlobalRouteManagerImpl::SPFIntraAddTransit (SPFVertex* v) // for that interface. If the node is acting as an IP version 4 router, it // should absolutely have an Ipv4 interface. // - Ptr ipv4 = node->QueryInterface (); + Ptr ipv4 = node->GetObject (); NS_ASSERT_MSG (ipv4, "GlobalRouteManagerImpl::SPFIntraAddTransit (): " "QI for interface failed"); diff --git a/src/routing/global-routing/global-router-interface.cc b/src/routing/global-routing/global-router-interface.cc index 76ad24190..c7fc4996b 100644 --- a/src/routing/global-routing/global-router-interface.cc +++ b/src/routing/global-routing/global-router-interface.cc @@ -496,7 +496,7 @@ GlobalRouter::GetRouterId (void) const GlobalRouter::DiscoverLSAs (void) { NS_LOG_FUNCTION; - Ptr node = QueryInterface (); + Ptr node = GetObject (); NS_LOG_LOGIC("For node " << node->GetId () ); NS_ASSERT_MSG(node, "GlobalRouter::DiscoverLSAs (): interface not set"); @@ -512,7 +512,7 @@ GlobalRouter::DiscoverLSAs (void) // Ipv4 interface. This is where the information regarding the attached // interfaces lives. // - Ptr ipv4Local = node->QueryInterface (); + Ptr ipv4Local = node->GetObject (); NS_ASSERT_MSG(ipv4Local, "GlobalRouter::DiscoverLSAs (): QI for interface failed"); // @@ -631,7 +631,7 @@ GlobalRouter::DiscoverLSAs (void) // device for its node, then ask that node for its Ipv4 interface. // Ptr nodeRemote = ndRemote->GetNode(); - Ptr ipv4Remote = nodeRemote->QueryInterface (); + Ptr ipv4Remote = nodeRemote->GetObject (); NS_ASSERT_MSG(ipv4Remote, "GlobalRouter::DiscoverLSAs (): QI for remote failed"); // @@ -639,7 +639,7 @@ GlobalRouter::DiscoverLSAs (void) // well get it now. // Ptr srRemote = - nodeRemote->QueryInterface (); + nodeRemote->GetObject (); NS_ASSERT_MSG(srRemote, "GlobalRouter::DiscoverLSAs():QI for remote failed"); Ipv4Address rtrIdRemote = srRemote->GetRouterId(); @@ -717,7 +717,7 @@ GlobalRouter::DiscoverLSAs (void) NS_ASSERT (tempNd); Ptr tempNode = tempNd->GetNode (); uint32_t tempIfIndex = FindIfIndexForDevice (tempNode, tempNd); - Ptr tempIpv4 = tempNode->QueryInterface (); + Ptr tempIpv4 = tempNode->GetObject (); NS_ASSERT (tempIpv4); Ipv4Address tempAddr = tempIpv4->GetAddress(tempIfIndex); pLSA->AddAttachedRouter (tempAddr); @@ -735,7 +735,7 @@ GlobalRouter::FindDesignatedRouterForLink (Ptr node, Ptr ndLocal) const { uint32_t ifIndexLocal = FindIfIndexForDevice(node, ndLocal); - Ptr ipv4Local = QueryInterface (); + Ptr ipv4Local = GetObject (); NS_ASSERT (ipv4Local); Ipv4Address addrLocal = ipv4Local->GetAddress(ifIndexLocal); Ipv4Mask maskLocal = ipv4Local->GetNetworkMask(ifIndexLocal); @@ -751,7 +751,7 @@ GlobalRouter::FindDesignatedRouterForLink (Ptr node, NS_ASSERT (tempNd); Ptr tempNode = tempNd->GetNode (); uint32_t tempIfIndex = FindIfIndexForDevice (tempNode, tempNd); - Ptr tempIpv4 = tempNode->QueryInterface (); + Ptr tempIpv4 = tempNode->GetObject (); NS_ASSERT (tempIpv4); Ipv4Address tempAddr = tempIpv4->GetAddress(tempIfIndex); if (tempAddr < addrLocal) @@ -842,7 +842,7 @@ GlobalRouter::GetAdjacent(Ptr nd, Ptr ch) const GlobalRouter::FindIfIndexForDevice(Ptr node, Ptr nd) const { NS_LOG_FUNCTION; - Ptr ipv4 = node->QueryInterface (); + Ptr ipv4 = node->GetObject (); NS_ASSERT_MSG(ipv4, "QI for interface failed"); for (uint32_t i = 0; i < ipv4->GetNInterfaces(); ++i ) { diff --git a/src/routing/global-routing/global-router-interface.h b/src/routing/global-routing/global-router-interface.h index 1870370c1..bd5dddfda 100644 --- a/src/routing/global-routing/global-router-interface.h +++ b/src/routing/global-routing/global-router-interface.h @@ -558,7 +558,7 @@ public: /** * @brief The Interface ID of the Global Router interface. * - * @see Object::QueryInterface () + * @see Object::GetObject () */ static TypeId GetTypeId (void); diff --git a/src/routing/olsr/olsr-agent-impl.cc b/src/routing/olsr/olsr-agent-impl.cc index 4c9e6d5cd..96d0450f9 100644 --- a/src/routing/olsr/olsr-agent-impl.cc +++ b/src/routing/olsr/olsr-agent-impl.cc @@ -186,10 +186,10 @@ AgentImpl::AgentImpl (Ptr node) m_linkTupleTimerFirstTime = true; - m_ipv4 = node->QueryInterface (); + m_ipv4 = node->GetObject (); NS_ASSERT (m_ipv4); - Ptr socketFactory = node->QueryInterface (Udp::GetTypeId ()); + Ptr socketFactory = node->GetObject (Udp::GetTypeId ()); m_receiveSocket = socketFactory->CreateSocket (); if (m_receiveSocket->Bind (InetSocketAddress (OLSR_PORT_NUMBER))) diff --git a/src/routing/olsr/olsr-agent.cc b/src/routing/olsr/olsr-agent.cc index a02d96607..5d0bfd94b 100644 --- a/src/routing/olsr/olsr-agent.cc +++ b/src/routing/olsr/olsr-agent.cc @@ -44,7 +44,7 @@ Ptr Agent::CreateDefault (Ptr node) { TypeId tid = g_defaultImpl.GetValue (); - Ptr agent = tid.CreateObject (node)->QueryInterface (); + Ptr agent = tid.CreateObject (node)->GetObject (); return agent; } diff --git a/tutorial/point-to-point-ipv4-topology.cc b/tutorial/point-to-point-ipv4-topology.cc index 09787d810..5365f93f2 100644 --- a/tutorial/point-to-point-ipv4-topology.cc +++ b/tutorial/point-to-point-ipv4-topology.cc @@ -60,7 +60,7 @@ PointToPointIpv4Topology::AddAddress ( Ipv4Mask mask) { Ptr nd = node->GetDevice(netDeviceNumber); - Ptr ipv4 = node->QueryInterface (); + Ptr ipv4 = node->GetObject (); uint32_t ifIndex = ipv4->AddInterface (nd); ipv4->SetAddress (ifIndex, address); diff --git a/utils/mobility-visualizer-model.cc b/utils/mobility-visualizer-model.cc index 2abec2202..630e87f5f 100644 --- a/utils/mobility-visualizer-model.cc +++ b/utils/mobility-visualizer-model.cc @@ -48,7 +48,7 @@ Sample () for (NodeList::Iterator nodeIter = NodeList::Begin (); nodeIter != NodeList::End (); nodeIter++) { Ptr node = *nodeIter; - Ptr mobility = node->QueryInterface (); + Ptr mobility = node->GetObject (); Vector pos = mobility->GetPosition (); Vector vel = mobility->GetVelocity ();