From 666e00b0979e4c49e68cac3adf2681b339cee889 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Fri, 11 May 2007 18:57:45 +0200 Subject: [PATCH] rename Iid to InterfaceId --- src/applications/application-list.cc | 2 +- src/applications/application-list.h | 2 +- src/core/component-manager.cc | 8 ++--- src/core/component-manager.h | 12 +++---- src/core/interface.cc | 48 ++++++++++++++-------------- src/core/interface.h | 16 +++++----- src/internet-node/i-arp-private.cc | 2 +- src/internet-node/i-arp-private.h | 2 +- src/internet-node/i-ipv4-private.cc | 2 +- src/internet-node/i-ipv4-private.h | 2 +- src/internet-node/ipv4-l4-demux.cc | 2 +- src/internet-node/ipv4-l4-demux.h | 2 +- src/internet-node/l3-demux.cc | 2 +- src/internet-node/l3-demux.h | 2 +- src/node/i-ipv4.cc | 2 +- src/node/i-ipv4.h | 2 +- src/node/i-udp.cc | 2 +- src/node/i-udp.h | 2 +- src/node/node.cc | 2 +- src/node/node.h | 2 +- 20 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/applications/application-list.cc b/src/applications/application-list.cc index d860290b6..576f1fc4a 100644 --- a/src/applications/application-list.cc +++ b/src/applications/application-list.cc @@ -26,7 +26,7 @@ namespace ns3{ -const Iid ApplicationList::iid ("ApplicationList"); +const InterfaceId ApplicationList::iid ("ApplicationList"); ApplicationList::ApplicationList(Ptr n) : Interface (ApplicationList::iid) diff --git a/src/applications/application-list.h b/src/applications/application-list.h index 689c4325b..2f4d0226a 100644 --- a/src/applications/application-list.h +++ b/src/applications/application-list.h @@ -34,7 +34,7 @@ namespace ns3 { class ApplicationList : public Interface { public: - static const Iid iid; + static const InterfaceId iid; ApplicationList(Ptr); // Copy constructor not needed, default one is correct virtual ~ApplicationList(); diff --git a/src/core/component-manager.cc b/src/core/component-manager.cc index 54cc60afb..497a39264 100644 --- a/src/core/component-manager.cc +++ b/src/core/component-manager.cc @@ -99,11 +99,11 @@ namespace { class B : public ns3::Interface { public: - static const ns3::Iid iid; + static const ns3::InterfaceId iid; B (); }; -const ns3::Iid B::iid ("IB"); +const ns3::InterfaceId B::iid ("IB"); B::B () : Interface (B::iid) @@ -116,7 +116,7 @@ public: static const ns3::ClassId cidZero; static const ns3::ClassId cidOneBool; static const ns3::ClassId cidOneUi32; - static const ns3::Iid iid; + static const ns3::InterfaceId iid; A (); A (bool); @@ -133,7 +133,7 @@ public: const ns3::ClassId A::cidZero = ns3::ComponentManager::RegisterConstructor ("A"); const ns3::ClassId A::cidOneBool = ns3::ComponentManager::RegisterConstructor ("ABool"); const ns3::ClassId A::cidOneUi32 = ns3::ComponentManager::RegisterConstructor ("AUi32"); -const ns3::Iid A::iid ("IA"); +const ns3::InterfaceId A::iid ("IA"); A::A () : Interface (A::iid), diff --git a/src/core/component-manager.h b/src/core/component-manager.h index 135b8faac..13d42fa57 100644 --- a/src/core/component-manager.h +++ b/src/core/component-manager.h @@ -121,13 +121,13 @@ public: * result. */ template - static Ptr Create (ClassId classId, Iid iid); + static Ptr Create (ClassId classId, InterfaceId iid); template - static Ptr Create (ClassId classId, Iid iid, T1 a1); + static Ptr Create (ClassId classId, InterfaceId iid, T1 a1); template - static Ptr Create (ClassId classId, Iid iid, T1 a1, T2 a2); + static Ptr Create (ClassId classId, InterfaceId iid, T1 a1, T2 a2); /** * \param name the symbolic name to associate to this @@ -229,7 +229,7 @@ ComponentManager::Create (ClassId classId, T1 a1, T2 a2) template Ptr -ComponentManager::Create (ClassId classId, Iid iid) +ComponentManager::Create (ClassId classId, InterfaceId iid) { Ptr obj = Create (classId); Ptr i = obj->QueryInterface (iid); @@ -238,7 +238,7 @@ ComponentManager::Create (ClassId classId, Iid iid) template Ptr -ComponentManager::Create (ClassId classId, Iid iid, T1 a1) +ComponentManager::Create (ClassId classId, InterfaceId iid, T1 a1) { Ptr obj = Create (classId, a1); Ptr i = obj->QueryInterface (iid); @@ -247,7 +247,7 @@ ComponentManager::Create (ClassId classId, Iid iid, T1 a1) template Ptr -ComponentManager::Create (ClassId classId, Iid iid, T1 a1, T2 a2) +ComponentManager::Create (ClassId classId, InterfaceId iid, T1 a1, T2 a2) { Ptr obj = Create (classId, a1, a2); Ptr i = obj->QueryInterface (iid); diff --git a/src/core/interface.cc b/src/core/interface.cc index ac7413e2b..030c5a031 100644 --- a/src/core/interface.cc +++ b/src/core/interface.cc @@ -34,11 +34,11 @@ namespace ns3 { class IidManager : public UidManager {}; -Iid::Iid (std::string name) +InterfaceId::InterfaceId (std::string name) : m_iid (Singleton::Get ()->Allocate (name)) {} -bool operator == (const Iid &a, const Iid &b) +bool operator == (const InterfaceId &a, const InterfaceId &b) { return a.m_iid == b.m_iid; } @@ -47,24 +47,24 @@ bool operator == (const Iid &a, const Iid &b) class InterfaceImpl { public: - InterfaceImpl (Iid iid, Interface *interface); + InterfaceImpl (InterfaceId iid, Interface *interface); ~InterfaceImpl (); void Ref (void); void RefAll (InterfaceImpl *other); void Unref (void); void UnrefAll (void); - Interface *PeekQueryInterface (Iid iid) const; + Interface *PeekQueryInterface (InterfaceId iid) const; void DoDisposeAll (void); void AddInterface (Interface * interface); - void AddSelfInterface (Iid iid, Interface *interface); + void AddSelfInterface (InterfaceId iid, Interface *interface); private: - typedef std::list > List; + typedef std::list > List; uint32_t m_ref; List m_list; bool m_disposed; }; -InterfaceImpl::InterfaceImpl (Iid iid, Interface * interface) +InterfaceImpl::InterfaceImpl (InterfaceId iid, Interface * interface) : m_ref (1), m_disposed (false) { @@ -124,7 +124,7 @@ InterfaceImpl::DoDisposeAll (void) m_disposed = true; } Interface * -InterfaceImpl::PeekQueryInterface (Iid iid) const +InterfaceImpl::PeekQueryInterface (InterfaceId iid) const { for (List::const_iterator i = m_list.begin (); i != m_list.end (); i++) @@ -149,14 +149,14 @@ InterfaceImpl::AddInterface (Interface *interface) } } void -InterfaceImpl::AddSelfInterface (Iid iid, Interface *interface) +InterfaceImpl::AddSelfInterface (InterfaceId iid, Interface *interface) { interface->RefInternal (); m_list.push_back (std::make_pair (iid, interface)); } -Interface::Interface (Iid iid) +Interface::Interface (InterfaceId iid) : m_impl (new InterfaceImpl (iid, this)), m_ref (1) {} @@ -206,7 +206,7 @@ Interface::UnrefInternal (void) } Ptr -Interface::DoQueryInterface (Iid iid) const +Interface::DoQueryInterface (InterfaceId iid) const { return m_impl->PeekQueryInterface (iid); } @@ -222,7 +222,7 @@ Interface::AddInterface (Ptr interface) } void -Interface::AddSelfInterface (Iid iid, Ptr interface) +Interface::AddSelfInterface (InterfaceId iid, Ptr interface) { m_impl->AddSelfInterface (iid, PeekPointer (interface)); } @@ -239,7 +239,7 @@ namespace { class A : public ns3::Interface { public: - static const ns3::Iid iid; + static const ns3::InterfaceId iid; A () : Interface (A::iid) {} @@ -247,7 +247,7 @@ public: class B : public ns3::Interface { public: - static const ns3::Iid iid; + static const ns3::InterfaceId iid; B () : Interface (B::iid) {} @@ -255,7 +255,7 @@ public: class BaseA : public ns3::Interface { public: - static const ns3::Iid iid; + static const ns3::InterfaceId iid; BaseA () : Interface (BaseA::iid) {} @@ -263,7 +263,7 @@ public: class BaseB : public ns3::Interface { public: - static const ns3::Iid iid; + static const ns3::InterfaceId iid; BaseB () : Interface (BaseB::iid) {} @@ -271,7 +271,7 @@ public: class Base : public ns3::Interface { public: - static const ns3::Iid iid; + static const ns3::InterfaceId iid; Base () : Interface (Base::iid) {} @@ -279,19 +279,19 @@ public: class Derived : public Base { public: - static const ns3::Iid iid; + static const ns3::InterfaceId iid; Derived () { AddSelfInterface (Derived::iid, this); } }; -const ns3::Iid A::iid ("A"); -const ns3::Iid B::iid ("B"); -const ns3::Iid BaseA::iid ("BaseA"); -const ns3::Iid BaseB::iid ("BaseB"); -const ns3::Iid Base::iid ("Base"); -const ns3::Iid Derived::iid ("Derived"); +const ns3::InterfaceId A::iid ("A"); +const ns3::InterfaceId B::iid ("B"); +const ns3::InterfaceId BaseA::iid ("BaseA"); +const ns3::InterfaceId BaseB::iid ("BaseB"); +const ns3::InterfaceId Base::iid ("Base"); +const ns3::InterfaceId Derived::iid ("Derived"); }//namespace diff --git a/src/core/interface.h b/src/core/interface.h index 7e8e6573d..be5ace7a9 100644 --- a/src/core/interface.h +++ b/src/core/interface.h @@ -28,12 +28,12 @@ namespace ns3 { class InterfaceImpl; -class Iid +class InterfaceId { public: - Iid (std::string name); + InterfaceId (std::string name); private: - friend bool operator == (const Iid &a, const Iid &b); + friend bool operator == (const InterfaceId &a, const InterfaceId &b); uint32_t m_iid; }; @@ -56,7 +56,7 @@ public: * \param iid the Interface id of the requested interface */ template - Ptr QueryInterface (Iid iid) const; + Ptr QueryInterface (InterfaceId iid) const; /** * \param interface another interface @@ -77,7 +77,7 @@ protected: * If you are a direct subclass of this class, you _must_ register * the name of your interface with this constructor. */ - Interface (Iid iid); + Interface (InterfaceId iid); /** * \param iid the Interface id of the interface * \param a pointer to the interface object @@ -87,7 +87,7 @@ protected: * (typically, your subclass has added API), you need to call * this method to associate an interface id to your interface. */ - void AddSelfInterface (Iid iid, Ptr interface); + void AddSelfInterface (InterfaceId iid, Ptr interface); protected: /** * Subclasses who want to handle the "dispose" event should @@ -99,7 +99,7 @@ protected: private: friend class InterfaceImpl; Interface (); - Ptr DoQueryInterface (Iid iid) const; + Ptr DoQueryInterface (InterfaceId iid) const; void RefInternal (void); void UnrefInternal (void); InterfaceImpl *m_impl; @@ -112,7 +112,7 @@ namespace ns3 { template Ptr -Interface::QueryInterface (Iid iid) const +Interface::QueryInterface (InterfaceId iid) const { Ptr found = DoQueryInterface (iid); if (found != 0) diff --git a/src/internet-node/i-arp-private.cc b/src/internet-node/i-arp-private.cc index 815bd9cec..0071b86bd 100644 --- a/src/internet-node/i-arp-private.cc +++ b/src/internet-node/i-arp-private.cc @@ -25,7 +25,7 @@ namespace ns3 { -const Iid IArpPrivate::iid ("IArpPrivate"); +const InterfaceId IArpPrivate::iid ("IArpPrivate"); IArpPrivate::IArpPrivate (Ptr arp) : Interface (IArpPrivate::iid), diff --git a/src/internet-node/i-arp-private.h b/src/internet-node/i-arp-private.h index 5e87b214c..1d78b07fb 100644 --- a/src/internet-node/i-arp-private.h +++ b/src/internet-node/i-arp-private.h @@ -34,7 +34,7 @@ class Arp; class IArpPrivate : public Interface { public: - static const Iid iid; + static const InterfaceId iid; IArpPrivate (Ptr arp); virtual ~IArpPrivate (); bool Lookup (Packet &p, Ipv4Address destination, diff --git a/src/internet-node/i-ipv4-private.cc b/src/internet-node/i-ipv4-private.cc index 22d853877..8928a363b 100644 --- a/src/internet-node/i-ipv4-private.cc +++ b/src/internet-node/i-ipv4-private.cc @@ -25,7 +25,7 @@ namespace ns3 { -const Iid IIpv4Private::iid ("IIpv4Private"); +const InterfaceId IIpv4Private::iid ("IIpv4Private"); IIpv4Private::IIpv4Private (Ptr ipv4) : Interface (IIpv4Private::iid), diff --git a/src/internet-node/i-ipv4-private.h b/src/internet-node/i-ipv4-private.h index d1c2d8bd9..70695f150 100644 --- a/src/internet-node/i-ipv4-private.h +++ b/src/internet-node/i-ipv4-private.h @@ -38,7 +38,7 @@ class NetDevice; class IIpv4Private : public Interface { public: - static const Iid iid; + static const InterfaceId iid; IIpv4Private (Ptr ipv4); virtual ~IIpv4Private (); diff --git a/src/internet-node/ipv4-l4-demux.cc b/src/internet-node/ipv4-l4-demux.cc index 3e01cb4d7..a60ed9629 100644 --- a/src/internet-node/ipv4-l4-demux.cc +++ b/src/internet-node/ipv4-l4-demux.cc @@ -30,7 +30,7 @@ namespace ns3 { -const Iid Ipv4L4Demux::iid ("Ipv4L4Demux"); +const InterfaceId Ipv4L4Demux::iid ("Ipv4L4Demux"); Ipv4L4Demux::Ipv4L4Demux (Ptr node) : Interface (Ipv4L4Demux::iid), diff --git a/src/internet-node/ipv4-l4-demux.h b/src/internet-node/ipv4-l4-demux.h index 645309abc..f6b199be9 100644 --- a/src/internet-node/ipv4-l4-demux.h +++ b/src/internet-node/ipv4-l4-demux.h @@ -42,7 +42,7 @@ class TraceContext; class Ipv4L4Demux : public Interface { public: - static const Iid iid; + static const InterfaceId iid; typedef int Ipv4L4ProtocolTraceType; Ipv4L4Demux (Ptr node); virtual ~Ipv4L4Demux(); diff --git a/src/internet-node/l3-demux.cc b/src/internet-node/l3-demux.cc index 6b58d6c43..e5912c64c 100644 --- a/src/internet-node/l3-demux.cc +++ b/src/internet-node/l3-demux.cc @@ -29,7 +29,7 @@ namespace ns3 { -const Iid L3Demux::iid ("L3Demux"); +const InterfaceId L3Demux::iid ("L3Demux"); L3Demux::L3Demux (Ptr node) : Interface (L3Demux::iid), diff --git a/src/internet-node/l3-demux.h b/src/internet-node/l3-demux.h index a0c9713b1..477a43e92 100644 --- a/src/internet-node/l3-demux.h +++ b/src/internet-node/l3-demux.h @@ -44,7 +44,7 @@ class TraceContext; class L3Demux : public Interface { public: - static const Iid iid; + static const InterfaceId iid; typedef int ProtocolTraceType; L3Demux(Ptr node); virtual ~L3Demux(); diff --git a/src/node/i-ipv4.cc b/src/node/i-ipv4.cc index bfb6e2c0b..c0fea96a8 100644 --- a/src/node/i-ipv4.cc +++ b/src/node/i-ipv4.cc @@ -22,7 +22,7 @@ namespace ns3 { -const Iid IIpv4::iid ("IIpv4"); +const InterfaceId IIpv4::iid ("IIpv4"); IIpv4::IIpv4 () : Interface (IIpv4::iid) diff --git a/src/node/i-ipv4.h b/src/node/i-ipv4.h index 121a6e6ea..2f064b2d3 100644 --- a/src/node/i-ipv4.h +++ b/src/node/i-ipv4.h @@ -34,7 +34,7 @@ class Ipv4Route; class IIpv4 : public Interface { public: - static const Iid iid; + static const InterfaceId iid; IIpv4 (); virtual ~IIpv4 (); diff --git a/src/node/i-udp.cc b/src/node/i-udp.cc index 92263ce34..5bf31aa0d 100644 --- a/src/node/i-udp.cc +++ b/src/node/i-udp.cc @@ -22,7 +22,7 @@ namespace ns3 { -const Iid IUdp::iid ("IUdp"); +const InterfaceId IUdp::iid ("IUdp"); IUdp::IUdp () : Interface (IUdp::iid) diff --git a/src/node/i-udp.h b/src/node/i-udp.h index 0e7c08b00..8fc071371 100644 --- a/src/node/i-udp.h +++ b/src/node/i-udp.h @@ -31,7 +31,7 @@ class Socket; class IUdp : public Interface { public: - static const Iid iid; + static const InterfaceId iid; IUdp (); diff --git a/src/node/node.cc b/src/node/node.cc index ea57ddb2c..7d57305ab 100644 --- a/src/node/node.cc +++ b/src/node/node.cc @@ -29,7 +29,7 @@ namespace ns3{ -const Iid Node::iid ("Node"); +const InterfaceId Node::iid ("Node"); Node::Node() : Interface (Node::iid), diff --git a/src/node/node.h b/src/node/node.h index 0ea49fcfd..42fa0b4fe 100644 --- a/src/node/node.h +++ b/src/node/node.h @@ -38,7 +38,7 @@ class NetDevice; class Node : public Interface { public: - static const Iid iid; + static const InterfaceId iid; Node(); Node(uint32_t); // Specify which system for a distributed simulation