diff --git a/samples/main-adhoc-wifi.cc b/samples/main-adhoc-wifi.cc index 5ca07dbad..08823b155 100644 --- a/samples/main-adhoc-wifi.cc +++ b/samples/main-adhoc-wifi.cc @@ -95,7 +95,7 @@ ReceivePacket (Ptr socket, Ptr packet, const Address &address) static Ptr SetupPacketReceive (Ptr node, uint16_t port) { - InterfaceId iid = InterfaceId::LookupByName ("Packet"); + TypeId iid = TypeId::LookupByName ("Packet"); Ptr socketFactory = node->QueryInterface (iid); Ptr sink = socketFactory->CreateSocket (); sink->Bind (); diff --git a/samples/main-simple.cc b/samples/main-simple.cc index 68147ae4a..69e0313f6 100644 --- a/samples/main-simple.cc +++ b/samples/main-simple.cc @@ -42,7 +42,7 @@ RunSimulation (void) { Ptr a = CreateObject (); - InterfaceId iid = InterfaceId::LookupByName ("Udp"); + TypeId iid = TypeId::LookupByName ("Udp"); Ptr socketFactory = a->QueryInterface (iid); Ptr sink = socketFactory->CreateSocket (); diff --git a/src/applications/onoff/onoff-application.cc b/src/applications/onoff/onoff-application.cc index eb49558d0..4e1a5f7b4 100644 --- a/src/applications/onoff/onoff-application.cc +++ b/src/applications/onoff/onoff-application.cc @@ -154,7 +154,7 @@ void OnOffApplication::StartApplication() // Called at time specified by Start // Create the socket if not already if (!m_socket) { - InterfaceId iid = InterfaceId::LookupByName (m_iid); + TypeId iid = TypeId::LookupByName (m_iid); Ptr socketFactory = GetNode ()->QueryInterface (iid); m_socket = socketFactory->CreateSocket (); m_socket->Bind (); diff --git a/src/applications/packet-sink/packet-sink.cc b/src/applications/packet-sink/packet-sink.cc index 12a5515b9..44e245baf 100644 --- a/src/applications/packet-sink/packet-sink.cc +++ b/src/applications/packet-sink/packet-sink.cc @@ -73,7 +73,7 @@ void PacketSink::StartApplication() // Called at time specified by Start // Create the socket if not already if (!m_socket) { - InterfaceId iid = InterfaceId::LookupByName (m_iid); + TypeId iid = TypeId::LookupByName (m_iid); Ptr socketFactory = GetNode ()->QueryInterface (iid); m_socket = socketFactory->CreateSocket (); diff --git a/src/applications/udp-echo/udp-echo-client.cc b/src/applications/udp-echo/udp-echo-client.cc index 93450d467..9ee4dfbc0 100644 --- a/src/applications/udp-echo/udp-echo-client.cc +++ b/src/applications/udp-echo/udp-echo-client.cc @@ -91,7 +91,7 @@ UdpEchoClient::StartApplication (void) if (!m_socket) { - InterfaceId iid = InterfaceId::LookupByName ("Udp"); + TypeId iid = TypeId::LookupByName ("Udp"); Ptr socketFactory = GetNode ()->QueryInterface (iid); m_socket = socketFactory->CreateSocket (); diff --git a/src/applications/udp-echo/udp-echo-server.cc b/src/applications/udp-echo/udp-echo-server.cc index e7a812eae..2220bf68f 100644 --- a/src/applications/udp-echo/udp-echo-server.cc +++ b/src/applications/udp-echo/udp-echo-server.cc @@ -77,7 +77,7 @@ UdpEchoServer::StartApplication (void) if (!m_socket) { - InterfaceId iid = InterfaceId::LookupByName ("Udp"); + TypeId iid = TypeId::LookupByName ("Udp"); Ptr socketFactory = GetNode ()->QueryInterface (iid); m_socket = socketFactory->CreateSocket (); diff --git a/src/common/error-model.cc b/src/common/error-model.cc index 9d727d5f2..db726d133 100644 --- a/src/common/error-model.cc +++ b/src/common/error-model.cc @@ -34,16 +34,16 @@ NS_LOG_COMPONENT_DEFINE ("ErrorModel"); namespace ns3 { -static InterfaceIdDefaultValue g_interfaceIdErrorModelDefaultValue ("ErrorModel", +static TypeIdDefaultValue g_interfaceIdErrorModelDefaultValue ("ErrorModel", "Error Model", ErrorModel::iid (), "RateErrorModel"); NS_OBJECT_ENSURE_REGISTERED (ErrorModel); -InterfaceId ErrorModel::iid (void) +TypeId ErrorModel::iid (void) { - static InterfaceId iid = InterfaceId ("ErrorModel") + static TypeId iid = TypeId ("ErrorModel") .SetParent (); return iid; } @@ -63,7 +63,7 @@ Ptr ErrorModel::CreateDefault (void) { NS_LOG_FUNCTION; - InterfaceId interfaceId = g_interfaceIdErrorModelDefaultValue.GetValue (); + TypeId interfaceId = g_interfaceIdErrorModelDefaultValue.GetValue (); Ptr em = interfaceId.CreateObject ()->QueryInterface (); return em; } @@ -125,9 +125,9 @@ static EnumDefaultValue NS_OBJECT_ENSURE_REGISTERED (RateErrorModel); -InterfaceId RateErrorModel::iid (void) +TypeId RateErrorModel::iid (void) { - static InterfaceId iid = InterfaceId ("RateErrorModel") + static TypeId iid = TypeId ("RateErrorModel") .SetParent () .AddConstructor (); return iid; @@ -246,9 +246,9 @@ RateErrorModel::DoReset (void) NS_OBJECT_ENSURE_REGISTERED (ListErrorModel); -InterfaceId ListErrorModel::iid (void) +TypeId ListErrorModel::iid (void) { - static InterfaceId iid = InterfaceId ("ListErrorModel") + static TypeId iid = TypeId ("ListErrorModel") .SetParent () .AddConstructor (); return iid; diff --git a/src/common/error-model.h b/src/common/error-model.h index 2d1b24ea0..0128da77e 100644 --- a/src/common/error-model.h +++ b/src/common/error-model.h @@ -66,7 +66,7 @@ class RandomVariable; class ErrorModel : public Object { public: - static InterfaceId iid (void); + static TypeId iid (void); /** * A factory method to generate a preconfigured default ErrorModel for use * \return an ErrorModel smart pointer that is the default ErrorModel @@ -136,7 +136,7 @@ enum ErrorUnit class RateErrorModel : public ErrorModel { public: - static InterfaceId iid (void); + static TypeId iid (void); RateErrorModel (); virtual ~RateErrorModel (); @@ -202,7 +202,7 @@ private: class ListErrorModel : public ErrorModel { public: - static InterfaceId iid (void); + static TypeId iid (void); ListErrorModel (); virtual ~ListErrorModel (); diff --git a/src/core/interface-id-default-value.cc b/src/core/interface-id-default-value.cc index 295a45592..a74826f7a 100644 --- a/src/core/interface-id-default-value.cc +++ b/src/core/interface-id-default-value.cc @@ -2,9 +2,9 @@ namespace ns3 { -InterfaceIdDefaultValue::InterfaceIdDefaultValue (std::string name, +TypeIdDefaultValue::TypeIdDefaultValue (std::string name, std::string help, - InterfaceId iid, + TypeId iid, std::string defaultValue) : DefaultValueBase (name, help), m_defaultName (defaultValue), @@ -13,33 +13,33 @@ InterfaceIdDefaultValue::InterfaceIdDefaultValue (std::string name, { DefaultValueList::Add (this); } -InterfaceId -InterfaceIdDefaultValue::GetValue (void) const +TypeId +TypeIdDefaultValue::GetValue (void) const { - return InterfaceId::LookupByName (m_name); + return TypeId::LookupByName (m_name); } void -InterfaceIdDefaultValue::SetValue (InterfaceId interfaceId) +TypeIdDefaultValue::SetValue (TypeId interfaceId) { m_name = interfaceId.GetName (); } void -InterfaceIdDefaultValue::SetValue (std::string name) +TypeIdDefaultValue::SetValue (std::string name) { m_name = name; } bool -InterfaceIdDefaultValue::DoParseValue (const std::string &value) +TypeIdDefaultValue::DoParseValue (const std::string &value) { - for (uint32_t i = 0; i < InterfaceId::GetRegisteredN (); i++) + for (uint32_t i = 0; i < TypeId::GetRegisteredN (); i++) { - InterfaceId iid = InterfaceId::GetRegistered (i); + TypeId iid = TypeId::GetRegistered (i); do { if (iid.GetName () == value && iid.HasConstructor ()) { // check that it really supports the requested interface. - InterfaceId tmp = iid; + TypeId tmp = iid; do { if (tmp == m_interfaceId) { @@ -56,18 +56,18 @@ InterfaceIdDefaultValue::DoParseValue (const std::string &value) } std::string -InterfaceIdDefaultValue::DoGetType (void) const +TypeIdDefaultValue::DoGetType (void) const { std::ostringstream oss; oss << "("; bool first = true; - for (uint32_t i = 0; i < InterfaceId::GetRegisteredN (); i++) + for (uint32_t i = 0; i < TypeId::GetRegisteredN (); i++) { - InterfaceId iid = InterfaceId::GetRegistered (i); + TypeId iid = TypeId::GetRegistered (i); // can this interface id be used to create objects ? if (iid.HasConstructor ()) { - InterfaceId tmp = iid; + TypeId tmp = iid; // does this interface id supports the requested interface id ? do { if (tmp == m_interfaceId) @@ -88,7 +88,7 @@ InterfaceIdDefaultValue::DoGetType (void) const } std::string -InterfaceIdDefaultValue::DoGetDefaultValue (void) const +TypeIdDefaultValue::DoGetDefaultValue (void) const { return m_name; } diff --git a/src/core/interface-id-default-value.h b/src/core/interface-id-default-value.h index 1825ca5a8..561459ba3 100644 --- a/src/core/interface-id-default-value.h +++ b/src/core/interface-id-default-value.h @@ -6,7 +6,7 @@ namespace ns3 { -class InterfaceIdDefaultValue : public DefaultValueBase +class TypeIdDefaultValue : public DefaultValueBase { public: /** @@ -17,20 +17,20 @@ public: * \param defaultValue the name of the object to create * by default. */ - InterfaceIdDefaultValue (std::string name, + TypeIdDefaultValue (std::string name, std::string help, - InterfaceId iid, + TypeId iid, std::string defaultValue); /** - * \returns the InterfaceId of the object selected by the user. + * \returns the TypeId of the object selected by the user. */ - InterfaceId GetValue (void) const; + TypeId GetValue (void) const; /** * \param interfaceId the new ClassId selected. * * Override the currently-selected value. */ - void SetValue (InterfaceId interfaceId); + void SetValue (TypeId interfaceId); /** * \param name the new object selected. * @@ -43,7 +43,7 @@ private: virtual std::string DoGetDefaultValue (void) const; std::string m_defaultName; std::string m_name; - InterfaceId m_interfaceId; + TypeId m_interfaceId; }; } // namespace ns3 diff --git a/src/core/object.cc b/src/core/object.cc index ee147cf5f..8c06e90b9 100644 --- a/src/core/object.cc +++ b/src/core/object.cc @@ -183,15 +183,15 @@ IidManager::GetRegistered (uint32_t i) } // anonymous namespace /********************************************************************* - * The InterfaceId TraceResolver + * The TypeId TraceResolver *********************************************************************/ namespace ns3 { -class InterfaceIdTraceResolver : public TraceResolver +class TypeIdTraceResolver : public TraceResolver { public: - InterfaceIdTraceResolver (Ptr aggregate); + TypeIdTraceResolver (Ptr aggregate); virtual void Connect (std::string path, CallbackBase const &cb, const TraceContext &context); virtual void Disconnect (std::string path, CallbackBase const &cb); virtual void CollectSources (std::string path, const TraceContext &context, @@ -202,11 +202,11 @@ private: Ptr m_aggregate; }; -InterfaceIdTraceResolver::InterfaceIdTraceResolver (Ptr aggregate) +TypeIdTraceResolver::TypeIdTraceResolver (Ptr aggregate) : m_aggregate (aggregate) {} Ptr -InterfaceIdTraceResolver::ParseForInterface (std::string path) +TypeIdTraceResolver::ParseForInterface (std::string path) { std::string element = GetElement (path); std::string::size_type dollar_pos = element.find ("$"); @@ -215,12 +215,12 @@ InterfaceIdTraceResolver::ParseForInterface (std::string path) return 0; } std::string interfaceName = element.substr (1, std::string::npos); - InterfaceId interfaceId = InterfaceId::LookupByName (interfaceName); + TypeId interfaceId = TypeId::LookupByName (interfaceName); Ptr interface = m_aggregate->QueryInterface (interfaceId); return interface; } void -InterfaceIdTraceResolver::Connect (std::string path, CallbackBase const &cb, const TraceContext &context) +TypeIdTraceResolver::Connect (std::string path, CallbackBase const &cb, const TraceContext &context) { Ptr interface = ParseForInterface (path); if (interface != 0) @@ -229,7 +229,7 @@ InterfaceIdTraceResolver::Connect (std::string path, CallbackBase const &cb, con } } void -InterfaceIdTraceResolver::Disconnect (std::string path, CallbackBase const &cb) +TypeIdTraceResolver::Disconnect (std::string path, CallbackBase const &cb) { Ptr interface = ParseForInterface (path); if (interface != 0) @@ -238,22 +238,22 @@ InterfaceIdTraceResolver::Disconnect (std::string path, CallbackBase const &cb) } } void -InterfaceIdTraceResolver::CollectSources (std::string path, const TraceContext &context, +TypeIdTraceResolver::CollectSources (std::string path, const TraceContext &context, SourceCollection *collection) { m_aggregate->DoCollectSources (path, context, collection); } void -InterfaceIdTraceResolver::TraceAll (std::ostream &os, const TraceContext &context) +TypeIdTraceResolver::TraceAll (std::ostream &os, const TraceContext &context) { m_aggregate->DoTraceAll (os, context); } /********************************************************************* - * The InterfaceId class + * The TypeId class *********************************************************************/ -InterfaceId::InterfaceId (std::string name) +TypeId::TypeId (std::string name) { uint16_t uid = Singleton::Get ()->AllocateUid (name); NS_ASSERT (uid != 0); @@ -261,70 +261,70 @@ InterfaceId::InterfaceId (std::string name) } -InterfaceId::InterfaceId (uint16_t iid) +TypeId::TypeId (uint16_t iid) : m_iid (iid) {} -InterfaceId::~InterfaceId () +TypeId::~TypeId () {} -InterfaceId -InterfaceId::LookupByName (std::string name) +TypeId +TypeId::LookupByName (std::string name) { uint16_t uid = Singleton::Get ()->GetUid (name); NS_ASSERT (uid != 0); - return InterfaceId (uid); + return TypeId (uid); } uint32_t -InterfaceId::GetRegisteredN (void) +TypeId::GetRegisteredN (void) { return Singleton::Get ()->GetRegisteredN (); } -InterfaceId -InterfaceId::GetRegistered (uint32_t i) +TypeId +TypeId::GetRegistered (uint32_t i) { - return InterfaceId (Singleton::Get ()->GetRegistered (i)); + return TypeId (Singleton::Get ()->GetRegistered (i)); } -InterfaceId -InterfaceId::SetParent (InterfaceId iid) +TypeId +TypeId::SetParent (TypeId iid) { Singleton::Get ()->SetParent (m_iid, iid.m_iid); return *this; } -InterfaceId -InterfaceId::GetParent (void) const +TypeId +TypeId::GetParent (void) const { uint16_t parent = Singleton::Get ()->GetParent (m_iid); - return InterfaceId (parent); + return TypeId (parent); } std::string -InterfaceId::GetName (void) const +TypeId::GetName (void) const { std::string name = Singleton::Get ()->GetName (m_iid); return name; } bool -InterfaceId::HasConstructor (void) const +TypeId::HasConstructor (void) const { bool hasConstructor = Singleton::Get ()->HasConstructor (m_iid); return hasConstructor; } void -InterfaceId::DoAddConstructor (CallbackBase cb, uint32_t nArguments) +TypeId::DoAddConstructor (CallbackBase cb, uint32_t nArguments) { Singleton::Get ()->AddConstructor (m_iid, cb, nArguments); } CallbackBase -InterfaceId::LookupConstructor (uint32_t nArguments) +TypeId::LookupConstructor (uint32_t nArguments) { CallbackBase constructor = Singleton::Get ()->GetConstructor (m_iid, nArguments); return constructor; } Ptr -InterfaceId::CreateObject (void) +TypeId::CreateObject (void) { CallbackBase cb = LookupConstructor (0); Callback > realCb; @@ -333,12 +333,12 @@ InterfaceId::CreateObject (void) return object; } -bool operator == (InterfaceId a, InterfaceId b) +bool operator == (TypeId a, TypeId b) { return a.m_iid == b.m_iid; } -bool operator != (InterfaceId a, InterfaceId b) +bool operator != (TypeId a, TypeId b) { return a.m_iid != b.m_iid; } @@ -349,18 +349,18 @@ bool operator != (InterfaceId a, InterfaceId b) NS_OBJECT_ENSURE_REGISTERED (Object); -static InterfaceId +static TypeId GetObjectIid (void) { - InterfaceId iid = InterfaceId ("Object"); + TypeId iid = TypeId ("Object"); iid.SetParent (iid); return iid; } -InterfaceId +TypeId Object::iid (void) { - static InterfaceId iid = GetObjectIid (); + static TypeId iid = GetObjectIid (); return iid; } @@ -377,13 +377,13 @@ Object::~Object () m_next = 0; } Ptr -Object::DoQueryInterface (InterfaceId iid) const +Object::DoQueryInterface (TypeId iid) const { NS_ASSERT (CheckLoose ()); const Object *currentObject = this; do { NS_ASSERT (currentObject != 0); - InterfaceId cur = currentObject->m_iid; + TypeId cur = currentObject->m_iid; while (cur != iid && cur != Object::iid ()) { cur = cur.GetParent (); @@ -438,7 +438,7 @@ Object::TraceDisconnect (std::string path, const CallbackBase &cb) const } void -Object::SetInterfaceId (InterfaceId iid) +Object::SetTypeId (TypeId iid) { NS_ASSERT (Check ()); m_iid = iid; @@ -454,8 +454,8 @@ Ptr Object::GetTraceResolver (void) const { NS_ASSERT (CheckLoose ()); - Ptr resolver = - Create (this); + Ptr resolver = + Create (this); return resolver; } @@ -535,7 +535,7 @@ Object::DoCollectSources (std::string path, const TraceContext &context, { NS_ASSERT (current != 0); NS_LOG_LOGIC ("collect current=" << current); - InterfaceId cur = current->m_iid; + TypeId cur = current->m_iid; while (cur != Object::iid ()) { std::string name = cur.GetName (); @@ -591,8 +591,8 @@ namespace { class BaseA : public ns3::Object { public: - static ns3::InterfaceId iid (void) { - static ns3::InterfaceId iid = ns3::InterfaceId ("BaseA") + static ns3::TypeId iid (void) { + static ns3::TypeId iid = ns3::TypeId ("BaseA") .SetParent (Object::iid ()) .AddConstructor (); return iid; @@ -616,8 +616,8 @@ public: class DerivedA : public BaseA { public: - static ns3::InterfaceId iid (void) { - static ns3::InterfaceId iid = ns3::InterfaceId ("DerivedA") + static ns3::TypeId iid (void) { + static ns3::TypeId iid = ns3::TypeId ("DerivedA") .SetParent (BaseA::iid ()) .AddConstructor (); return iid; @@ -643,8 +643,8 @@ public: class BaseB : public ns3::Object { public: - static ns3::InterfaceId iid (void) { - static ns3::InterfaceId iid = ns3::InterfaceId ("BaseB") + static ns3::TypeId iid (void) { + static ns3::TypeId iid = ns3::TypeId ("BaseB") .SetParent (Object::iid ()) .AddConstructor (); return iid; @@ -668,8 +668,8 @@ public: class DerivedB : public BaseB { public: - static ns3::InterfaceId iid (void) { - static ns3::InterfaceId iid = ns3::InterfaceId ("DerivedB") + static ns3::TypeId iid (void) { + static ns3::TypeId iid = ns3::TypeId ("DerivedB") .SetParent (BaseB::iid ()) .AddConstructor () .AddConstructor (); @@ -861,7 +861,7 @@ ObjectTest::RunTests (void) NS_TEST_ASSERT (m_derivedATrace); baseB->TraceDisconnect ("/$DerivedA/*", MakeCallback (&ObjectTest::BaseATrace, this)); - // Test the object creation code of InterfaceId + // Test the object creation code of TypeId Ptr a = BaseA::iid ().CreateObject (); NS_TEST_ASSERT_EQUAL (a->QueryInterface (), a); NS_TEST_ASSERT_EQUAL (a->QueryInterface (DerivedA::iid ()), 0); diff --git a/src/core/object.h b/src/core/object.h index 56654fe67..4c375108c 100644 --- a/src/core/object.h +++ b/src/core/object.h @@ -32,7 +32,7 @@ static struct X##type##RegistrationClass \ { \ X##type##RegistrationClass () { \ - ns3::InterfaceId iid = type::iid (); \ + ns3::TypeId iid = type::iid (); \ iid.GetParent (); \ } \ } x_##type##RegistrationVariable @@ -48,7 +48,7 @@ class Object; * \brief a unique identifier for an interface. * */ -class InterfaceId +class TypeId { public: /** @@ -59,9 +59,9 @@ public: * This method cannot fail: it will crash if the input * name is not a valid interface name. */ - static InterfaceId LookupByName (std::string name); + static TypeId LookupByName (std::string name); static uint32_t GetRegisteredN (void); - static InterfaceId GetRegistered (uint32_t i); + static TypeId GetRegistered (uint32_t i); /** * \param iid a unique id * \returns the parent of the requested id @@ -69,7 +69,7 @@ public: * This method cannot fail: it will crash if the input * id is not a valid interface id. */ - InterfaceId GetParent (void) const; + TypeId GetParent (void) const; /** * \returns the name of this interface. @@ -77,28 +77,28 @@ public: std::string GetName (void) const; /** - * \returns true if this InterfaceId has a constructor + * \returns true if this TypeId has a constructor */ bool HasConstructor (void) const; - InterfaceId (std::string); + TypeId (std::string); - InterfaceId SetParent (InterfaceId iid); + TypeId SetParent (TypeId iid); template - InterfaceId SetParent (void); + TypeId SetParent (void); template - InterfaceId AddConstructor (void); + TypeId AddConstructor (void); template - InterfaceId AddConstructor (void); + TypeId AddConstructor (void); template - InterfaceId AddConstructor (void); + TypeId AddConstructor (void); template - InterfaceId AddConstructor (void); + TypeId AddConstructor (void); template - InterfaceId AddConstructor (void); + TypeId AddConstructor (void); template - InterfaceId AddConstructor (void); + TypeId AddConstructor (void); Ptr CreateObject (void); @@ -113,12 +113,12 @@ public: template Ptr CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5); - ~InterfaceId (); + ~TypeId (); private: - friend bool operator == (InterfaceId a, InterfaceId b); - friend bool operator != (InterfaceId a, InterfaceId b); + friend bool operator == (TypeId a, TypeId b); + friend bool operator != (TypeId a, TypeId b); - explicit InterfaceId (uint16_t iid); + explicit TypeId (uint16_t iid); void DoAddConstructor (CallbackBase callback, uint32_t nArguments); CallbackBase LookupConstructor (uint32_t nArguments); @@ -135,7 +135,7 @@ private: class Object { public: - static InterfaceId iid (void); + static TypeId iid (void); Object (); virtual ~Object (); @@ -163,7 +163,7 @@ public: * \returns a pointer to the requested interface or zero if it could not be found. */ template - Ptr QueryInterface (InterfaceId iid) const; + Ptr QueryInterface (TypeId iid) const; /** * Run the DoDispose methods of this object and all the * objects aggregated to it. @@ -213,7 +213,7 @@ protected: */ virtual void DoDispose (void); private: - friend class InterfaceIdTraceResolver; + friend class TypeIdTraceResolver; template friend Ptr CreateObject (void); template @@ -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 (InterfaceId iid) const; + Ptr DoQueryInterface (TypeId iid) const; void DoCollectSources (std::string path, const TraceContext &context, TraceResolver::SourceCollection *collection) const; void DoTraceAll (std::ostream &os, const TraceContext &context) const; @@ -239,16 +239,16 @@ private: bool CheckLoose (void) const; void MaybeDelete (void) const; /** - * \param iid an InterfaceId + * \param iid an TypeId * - * Every subclass which defines a new InterfaceId for itself - * should register this InterfaceId by calling this method + * Every subclass which defines a new TypeId for itself + * should register this TypeId by calling this method * from its constructor. */ - void SetInterfaceId (InterfaceId iid); + void SetTypeId (TypeId iid); mutable uint32_t m_count; - InterfaceId m_iid; + TypeId m_iid; bool m_disposed; mutable bool m_collecting; Object *m_next; @@ -283,15 +283,15 @@ Ptr CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7); namespace ns3 { template -InterfaceId -InterfaceId::SetParent (void) +TypeId +TypeId::SetParent (void) { return SetParent (T::iid ()); } template -InterfaceId -InterfaceId::AddConstructor (void) +TypeId +TypeId::AddConstructor (void) { struct Maker { static Ptr Create (void) { @@ -303,8 +303,8 @@ InterfaceId::AddConstructor (void) return *this; } template -InterfaceId -InterfaceId::AddConstructor (void) +TypeId +TypeId::AddConstructor (void) { struct Maker { static Ptr Create (T1 a1) { @@ -316,8 +316,8 @@ InterfaceId::AddConstructor (void) return *this; } template -InterfaceId -InterfaceId::AddConstructor (void) +TypeId +TypeId::AddConstructor (void) { struct Maker { static Ptr Create (T1 a1, T2 a2) { @@ -329,8 +329,8 @@ InterfaceId::AddConstructor (void) return *this; } template -InterfaceId -InterfaceId::AddConstructor (void) +TypeId +TypeId::AddConstructor (void) { struct Maker { static Ptr Create (T1 a1, T2 a2, T3 a3) { @@ -342,8 +342,8 @@ InterfaceId::AddConstructor (void) return *this; } template -InterfaceId -InterfaceId::AddConstructor (void) +TypeId +TypeId::AddConstructor (void) { struct Maker { static Ptr Create (T1 a1, T2 a2, T3 a3, T4 a4) { @@ -355,8 +355,8 @@ InterfaceId::AddConstructor (void) return *this; } template -InterfaceId -InterfaceId::AddConstructor (void) +TypeId +TypeId::AddConstructor (void) { struct Maker { static Ptr Create (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) { @@ -370,7 +370,7 @@ InterfaceId::AddConstructor (void) template Ptr -InterfaceId::CreateObject (T1 a1) +TypeId::CreateObject (T1 a1) { CallbackBase cb = LookupConstructor (1); Callback,T1> realCb; @@ -380,7 +380,7 @@ InterfaceId::CreateObject (T1 a1) } template Ptr -InterfaceId::CreateObject (T1 a1, T2 a2) +TypeId::CreateObject (T1 a1, T2 a2) { CallbackBase cb = LookupConstructor (2); Callback,T1,T2> realCb; @@ -390,7 +390,7 @@ InterfaceId::CreateObject (T1 a1, T2 a2) } template Ptr -InterfaceId::CreateObject (T1 a1, T2 a2, T3 a3) +TypeId::CreateObject (T1 a1, T2 a2, T3 a3) { CallbackBase cb = LookupConstructor (3); Callback,T1,T2,T3> realCb; @@ -400,7 +400,7 @@ InterfaceId::CreateObject (T1 a1, T2 a2, T3 a3) } template Ptr -InterfaceId::CreateObject (T1 a1, T2 a2, T3 a3, T4 a4) +TypeId::CreateObject (T1 a1, T2 a2, T3 a3, T4 a4) { CallbackBase cb = LookupConstructor (4); Callback,T1,T2,T3,T4> realCb; @@ -410,7 +410,7 @@ InterfaceId::CreateObject (T1 a1, T2 a2, T3 a3, T4 a4) } template Ptr -InterfaceId::CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) +TypeId::CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) { CallbackBase cb = LookupConstructor (5); Callback,T1,T2,T3,T4,T5> realCb; @@ -451,7 +451,7 @@ Object::QueryInterface () const template Ptr -Object::QueryInterface (InterfaceId iid) const +Object::QueryInterface (TypeId iid) const { Ptr found = DoQueryInterface (iid); if (found != 0) @@ -465,7 +465,7 @@ template Ptr CreateObject (void) { Ptr p = Ptr (new T (), false); - p->SetInterfaceId (T::iid ()); + p->SetTypeId (T::iid ()); return p; } @@ -473,7 +473,7 @@ template Ptr CreateObject (T1 a1) { Ptr p = Ptr (new T (a1), false); - p->SetInterfaceId (T::iid ()); + p->SetTypeId (T::iid ()); return p; } @@ -481,7 +481,7 @@ template Ptr CreateObject (T1 a1, T2 a2) { Ptr p = Ptr (new T (a1, a2), false); - p->SetInterfaceId (T::iid ()); + p->SetTypeId (T::iid ()); return p; } @@ -489,7 +489,7 @@ template Ptr CreateObject (T1 a1, T2 a2, T3 a3) { Ptr p = Ptr (new T (a1, a2, a3), false); - p->SetInterfaceId (T::iid ()); + p->SetTypeId (T::iid ()); return p; } @@ -497,7 +497,7 @@ template Ptr CreateObject (T1 a1, T2 a2, T3 a3, T4 a4) { Ptr p = Ptr (new T (a1, a2, a3, a4), false); - p->SetInterfaceId (T::iid ()); + p->SetTypeId (T::iid ()); return p; } @@ -505,7 +505,7 @@ template CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) { Ptr p = Ptr (new T (a1, a2, a3, a4, a5), false); - p->SetInterfaceId (T::iid ()); + p->SetTypeId (T::iid ()); return p; } @@ -513,7 +513,7 @@ template CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6) { Ptr p = Ptr (new T (a1, a2, a3, a4, a5, a6), false); - p->SetInterfaceId (T::iid ()); + p->SetTypeId (T::iid ()); return p; } @@ -521,7 +521,7 @@ template CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7) { Ptr p = Ptr (new T (a1, a2, a3, a4, a5, a6, a7), false); - p->SetInterfaceId (T::iid ()); + p->SetTypeId (T::iid ()); return p; } diff --git a/src/devices/csma/csma-topology.cc b/src/devices/csma/csma-topology.cc index 67071c0ae..b44cc5011 100644 --- a/src/devices/csma/csma-topology.cc +++ b/src/devices/csma/csma-topology.cc @@ -87,7 +87,7 @@ CsmaTopology::ConnectPacketSocket(Ptr app, Ptr CsmaTopology::CreatePacketSocket(Ptr n1, std::string iid_name) { - InterfaceId iid = InterfaceId::LookupByName (iid_name); + TypeId iid = TypeId::LookupByName (iid_name); Ptr socketFactory = n1->QueryInterface (iid); diff --git a/src/internet-node/arp-l3-protocol.cc b/src/internet-node/arp-l3-protocol.cc index 913c4b30c..7b5369535 100644 --- a/src/internet-node/arp-l3-protocol.cc +++ b/src/internet-node/arp-l3-protocol.cc @@ -37,10 +37,10 @@ const uint16_t ArpL3Protocol::PROT_NUMBER = 0x0806; NS_OBJECT_ENSURE_REGISTERED (ArpL3Protocol); -InterfaceId +TypeId ArpL3Protocol::iid (void) { - static InterfaceId iid = InterfaceId ("ArpL3Protocol") + static TypeId iid = TypeId ("ArpL3Protocol") .SetParent (); return iid; } diff --git a/src/internet-node/arp-l3-protocol.h b/src/internet-node/arp-l3-protocol.h index 6bb26181e..a31a99ae8 100644 --- a/src/internet-node/arp-l3-protocol.h +++ b/src/internet-node/arp-l3-protocol.h @@ -40,7 +40,7 @@ class TraceContext; class ArpL3Protocol : public Object { public: - static InterfaceId iid (void); + static TypeId iid (void); static const uint16_t PROT_NUMBER; /** * \brief Constructor diff --git a/src/internet-node/ipv4-l3-protocol.cc b/src/internet-node/ipv4-l3-protocol.cc index eff0d651f..041013089 100644 --- a/src/internet-node/ipv4-l3-protocol.cc +++ b/src/internet-node/ipv4-l3-protocol.cc @@ -44,10 +44,10 @@ const uint16_t Ipv4L3Protocol::PROT_NUMBER = 0x0800; NS_OBJECT_ENSURE_REGISTERED (Ipv4L3Protocol); -InterfaceId +TypeId Ipv4L3Protocol::iid (void) { - static InterfaceId iid = InterfaceId ("Ipv4L3Protocol") + static TypeId iid = TypeId ("Ipv4L3Protocol") .SetParent (); return iid; } diff --git a/src/internet-node/ipv4-l3-protocol.h b/src/internet-node/ipv4-l3-protocol.h index 5ed445110..ad5e2584c 100644 --- a/src/internet-node/ipv4-l3-protocol.h +++ b/src/internet-node/ipv4-l3-protocol.h @@ -99,7 +99,7 @@ private: class Ipv4L3Protocol : public Object { public: - static InterfaceId iid (void); + static TypeId iid (void); static const uint16_t PROT_NUMBER; Ipv4L3Protocol(Ptr node); diff --git a/src/internet-node/ipv4-l4-demux.cc b/src/internet-node/ipv4-l4-demux.cc index 5441bdbc5..59e8a7fee 100644 --- a/src/internet-node/ipv4-l4-demux.cc +++ b/src/internet-node/ipv4-l4-demux.cc @@ -60,10 +60,10 @@ Ipv4L4ProtocolTraceContextElement::GetTypeName (void) const return "ns3::Ipv4L4ProtocolTraceContextElement"; } -InterfaceId +TypeId Ipv4L4Demux::iid (void) { - static InterfaceId iid = InterfaceId ("Ipv4L4Demux") + static TypeId iid = TypeId ("Ipv4L4Demux") .SetParent (); return iid; } diff --git a/src/internet-node/ipv4-l4-demux.h b/src/internet-node/ipv4-l4-demux.h index b740b55d7..417db350d 100644 --- a/src/internet-node/ipv4-l4-demux.h +++ b/src/internet-node/ipv4-l4-demux.h @@ -62,7 +62,7 @@ private: class Ipv4L4Demux : public Object { public: - static InterfaceId iid (void); + static TypeId iid (void); Ipv4L4Demux (Ptr node); virtual ~Ipv4L4Demux(); diff --git a/src/mobility/grid-topology.cc b/src/mobility/grid-topology.cc index 6c7e66119..62891c615 100644 --- a/src/mobility/grid-topology.cc +++ b/src/mobility/grid-topology.cc @@ -28,13 +28,13 @@ GridTopology::GridTopology (double xMin, double yMin, uint32_t n, double deltaX, m_n (n), m_deltaX (deltaX), m_deltaY (deltaY), - m_positionInterfaceId (StaticMobilityModel::iid ()) + m_positionTypeId (StaticMobilityModel::iid ()) {} void -GridTopology::SetMobilityModel (InterfaceId interfaceId) +GridTopology::SetMobilityModel (TypeId interfaceId) { - m_positionInterfaceId = interfaceId; + m_positionTypeId = interfaceId; } void @@ -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_positionInterfaceId.CreateObject ()->QueryInterface (); + Ptr mobility = m_positionTypeId.CreateObject ()->QueryInterface (); 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_positionInterfaceId.CreateObject ()->QueryInterface (); + Ptr mobility = m_positionTypeId.CreateObject ()->QueryInterface (); object->AddInterface (mobility); mobility->SetPosition (Vector (x, y, 0.0)); } diff --git a/src/mobility/grid-topology.h b/src/mobility/grid-topology.h index b9cb012d9..ff9cbe425 100644 --- a/src/mobility/grid-topology.h +++ b/src/mobility/grid-topology.h @@ -47,14 +47,14 @@ class GridTopology * \param interfaceId the interfaceId of the position object to attach to each * input object. */ - void SetMobilityModel (InterfaceId interfaceId); + void SetMobilityModel (TypeId interfaceId); /** * \param begin an iterator to the first object to layout. * \param end an iterator to the last object to layout. * * Attach a position (the type of position is specified through - * the InterfaceId given to SetMobilityModelModel) to each input object + * the TypeId given to SetMobilityModelModel) to each input object * and configure its initial location with a set * of coordinates arranged according to a regular rectangular grid, * one row after the other. @@ -67,7 +67,7 @@ class GridTopology * \param end an iterator to the last object to layout. * * Attach a position (the type of position is specified through - * the InterfaceId given to SetMobilityModelModel) to each input object + * the TypeId given to SetMobilityModelModel) to each input object * and configure its initial location with a set * of coordinates arranged according to a regular rectangular grid, * one column after the other. @@ -83,7 +83,7 @@ class GridTopology uint32_t m_n; double m_deltaX; double m_deltaY; - InterfaceId m_positionInterfaceId; + TypeId m_positionTypeId; }; } // namespace ns3 diff --git a/src/mobility/hierarchical-mobility-model.cc b/src/mobility/hierarchical-mobility-model.cc index 5da69f7cb..b830987fa 100644 --- a/src/mobility/hierarchical-mobility-model.cc +++ b/src/mobility/hierarchical-mobility-model.cc @@ -24,10 +24,10 @@ namespace ns3 { NS_OBJECT_ENSURE_REGISTERED (HierarchicalMobilityModel); -InterfaceId +TypeId HierarchicalMobilityModel::iid (void) { - static InterfaceId iid = InterfaceId ("HierarchicalMobilityModel") + static TypeId iid = TypeId ("HierarchicalMobilityModel") .SetParent (); return iid; } diff --git a/src/mobility/hierarchical-mobility-model.h b/src/mobility/hierarchical-mobility-model.h index d719cb6af..8faf29bb5 100644 --- a/src/mobility/hierarchical-mobility-model.h +++ b/src/mobility/hierarchical-mobility-model.h @@ -33,7 +33,7 @@ namespace ns3 { class HierarchicalMobilityModel : public MobilityModel { public: - static InterfaceId iid (void); + static TypeId iid (void); /** * \param child the "relative" mobility model diff --git a/src/mobility/mobility-model-notifier.cc b/src/mobility/mobility-model-notifier.cc index 2d151e203..9a68fda4d 100644 --- a/src/mobility/mobility-model-notifier.cc +++ b/src/mobility/mobility-model-notifier.cc @@ -23,10 +23,10 @@ namespace ns3 { -InterfaceId +TypeId MobilityModelNotifier::iid (void) { - static InterfaceId iid = InterfaceId ("MobilityModelNotifier") + static TypeId iid = TypeId ("MobilityModelNotifier") .SetParent () .AddConstructor (); return iid; diff --git a/src/mobility/mobility-model-notifier.h b/src/mobility/mobility-model-notifier.h index 5ec2b65a6..edebcc999 100644 --- a/src/mobility/mobility-model-notifier.h +++ b/src/mobility/mobility-model-notifier.h @@ -33,7 +33,7 @@ namespace ns3 { class MobilityModelNotifier : public Object { public: - static InterfaceId iid (void); + static TypeId iid (void); /** * Create a new position notifier diff --git a/src/mobility/mobility-model.cc b/src/mobility/mobility-model.cc index acf27bce4..524d8ba77 100644 --- a/src/mobility/mobility-model.cc +++ b/src/mobility/mobility-model.cc @@ -23,10 +23,10 @@ namespace ns3 { -InterfaceId +TypeId MobilityModel::iid (void) { - static InterfaceId iid = InterfaceId ("MobilityModel") + static TypeId iid = TypeId ("MobilityModel") .SetParent (); return iid; } diff --git a/src/mobility/mobility-model.h b/src/mobility/mobility-model.h index 4073641f8..1bf51ff0e 100644 --- a/src/mobility/mobility-model.h +++ b/src/mobility/mobility-model.h @@ -35,7 +35,7 @@ namespace ns3 { class MobilityModel : public Object { public: - static InterfaceId iid (void); + static TypeId iid (void); MobilityModel (); virtual ~MobilityModel () = 0; diff --git a/src/mobility/random-direction-2d-mobility-model.cc b/src/mobility/random-direction-2d-mobility-model.cc index f01a0af65..321077e26 100644 --- a/src/mobility/random-direction-2d-mobility-model.cc +++ b/src/mobility/random-direction-2d-mobility-model.cc @@ -110,10 +110,10 @@ RandomDirection2dMobilityModelParameters::GetCurrent (void) return parameters; } -InterfaceId +TypeId RandomDirection2dMobilityModel::iid (void) { - static InterfaceId iid = InterfaceId ("RandomDirection2dMobilityModel") + static TypeId iid = TypeId ("RandomDirection2dMobilityModel") .SetParent () .AddConstructor () .AddConstructor > (); diff --git a/src/mobility/random-direction-2d-mobility-model.h b/src/mobility/random-direction-2d-mobility-model.h index 56803bb0d..676e5faf0 100644 --- a/src/mobility/random-direction-2d-mobility-model.h +++ b/src/mobility/random-direction-2d-mobility-model.h @@ -89,7 +89,7 @@ class RandomDirection2dMobilityModelParameters : public Object class RandomDirection2dMobilityModel : public MobilityModel { public: - static InterfaceId iid (void); + static TypeId iid (void); /** * Create from \valueref{RandomDirection2dSpeed}, diff --git a/src/mobility/random-position.cc b/src/mobility/random-position.cc index 387cda9bf..85ab94720 100644 --- a/src/mobility/random-position.cc +++ b/src/mobility/random-position.cc @@ -60,10 +60,10 @@ g_discY ("RandomDiscPositionY", NS_OBJECT_ENSURE_REGISTERED (RandomPosition); -InterfaceId +TypeId RandomPosition::iid (void) { - static InterfaceId iid = InterfaceId ("RandomPosition") + static TypeId iid = TypeId ("RandomPosition") .SetParent (); return iid; } @@ -77,10 +77,10 @@ RandomPosition::~RandomPosition () NS_OBJECT_ENSURE_REGISTERED (RandomRectanglePosition); -InterfaceId +TypeId RandomRectanglePosition::iid (void) { - static InterfaceId iid = InterfaceId ("RandomRectanglePosition") + static TypeId iid = TypeId ("RandomRectanglePosition") .SetParent () .AddConstructor () .AddConstructor (); @@ -113,10 +113,10 @@ RandomRectanglePosition::Get (void) const NS_OBJECT_ENSURE_REGISTERED (RandomDiscPosition); -InterfaceId +TypeId RandomDiscPosition::iid (void) { - static InterfaceId iid = InterfaceId ("RandomDiscPosition") + static TypeId iid = TypeId ("RandomDiscPosition") .SetParent () .AddConstructor () .AddConstructor (); diff --git a/src/mobility/random-position.h b/src/mobility/random-position.h index 6950d66f0..44b6d3efa 100644 --- a/src/mobility/random-position.h +++ b/src/mobility/random-position.h @@ -35,7 +35,7 @@ class RandomVariable; class RandomPosition : public Object { public: - static InterfaceId iid (void); + static TypeId iid (void); RandomPosition (); virtual ~RandomPosition (); /** @@ -51,7 +51,7 @@ public: class RandomRectanglePosition : public RandomPosition { public: - static InterfaceId iid (void); + static TypeId iid (void); /** * Create a random position model with construction * values from \valueref{RandomRectanglePositionX}, and @@ -80,7 +80,7 @@ private: class RandomDiscPosition : public RandomPosition { public: - static InterfaceId iid (void); + static TypeId iid (void); /** * Create a random position model with construction * values from \valueref{RandomDiscPositionTheta}, diff --git a/src/mobility/random-topology.cc b/src/mobility/random-topology.cc index 0a41bf78a..ebaffaa1d 100644 --- a/src/mobility/random-topology.cc +++ b/src/mobility/random-topology.cc @@ -26,13 +26,13 @@ namespace ns3 { -static InterfaceIdDefaultValue +static TypeIdDefaultValue g_position ("RandomTopologyPositionType", "The type of initial random position in a 3d topology.", RandomPosition::iid (), "RandomRectanglePosition"); -static InterfaceIdDefaultValue +static TypeIdDefaultValue g_mobility ("RandomTopologyMobilityType", "The type of mobility model attached to an object in a 3d topology.", MobilityModel::iid (), @@ -43,7 +43,7 @@ RandomTopology::RandomTopology () { m_positionModel = g_position.GetValue ().CreateObject ()->QueryInterface (); } -RandomTopology::RandomTopology (Ptr positionModel, InterfaceId mobilityModel) +RandomTopology::RandomTopology (Ptr positionModel, TypeId mobilityModel) : m_positionModel (positionModel), m_mobilityModel (mobilityModel) {} @@ -53,7 +53,7 @@ RandomTopology::~RandomTopology () } void -RandomTopology::SetMobilityModel (InterfaceId interfaceId) +RandomTopology::SetMobilityModel (TypeId interfaceId) { m_mobilityModel = interfaceId; } diff --git a/src/mobility/random-topology.h b/src/mobility/random-topology.h index ac1676d37..4e3e0138e 100644 --- a/src/mobility/random-topology.h +++ b/src/mobility/random-topology.h @@ -54,7 +54,7 @@ class RandomTopology * specified position and mobility models. */ RandomTopology (Ptr positionModel, - InterfaceId mobilityModel); + TypeId mobilityModel); ~RandomTopology (); @@ -62,7 +62,7 @@ class RandomTopology * \param interfaceId the type of mobility model attached to each * input object if it does not have one already. */ - void SetMobilityModel (InterfaceId interfaceId); + void SetMobilityModel (TypeId interfaceId); /** * \param positionModel the position model used to initialize * the position of each object. @@ -90,7 +90,7 @@ class RandomTopology void Layout (const T &begin, const T &end); private: Ptr m_positionModel; - InterfaceId m_mobilityModel; + TypeId m_mobilityModel; }; } // namespace ns3 diff --git a/src/mobility/random-walk-2d-mobility-model.cc b/src/mobility/random-walk-2d-mobility-model.cc index 03c3f3a0f..052e150d9 100644 --- a/src/mobility/random-walk-2d-mobility-model.cc +++ b/src/mobility/random-walk-2d-mobility-model.cc @@ -129,10 +129,10 @@ RandomWalk2dMobilityModelParameters::GetCurrent (void) return parameters; } -InterfaceId +TypeId RandomWalk2dMobilityModel::iid (void) { - static InterfaceId iid = InterfaceId ("RandomWalkMobilityModel") + static TypeId iid = TypeId ("RandomWalkMobilityModel") .SetParent () .AddConstructor () .AddConstructor > (); diff --git a/src/mobility/random-walk-2d-mobility-model.h b/src/mobility/random-walk-2d-mobility-model.h index b0b8271c3..2c596a5fe 100644 --- a/src/mobility/random-walk-2d-mobility-model.h +++ b/src/mobility/random-walk-2d-mobility-model.h @@ -115,7 +115,7 @@ class RandomWalk2dMobilityModelParameters : public Object class RandomWalk2dMobilityModel : public MobilityModel { public: - static InterfaceId iid (void); + static TypeId iid (void); /** * Instantiate a set of RandomWalk parameters initialized * with construction values from \valueref{RandomWalk2dMode}, diff --git a/src/mobility/random-waypoint-mobility-model.cc b/src/mobility/random-waypoint-mobility-model.cc index f31daaf7d..a9644f672 100644 --- a/src/mobility/random-waypoint-mobility-model.cc +++ b/src/mobility/random-waypoint-mobility-model.cc @@ -39,7 +39,7 @@ g_pause ("RandomWaypointPause", "A random variable used to pick the pause of a random waypoint model.", "Constant:2"); -static InterfaceIdDefaultValue +static TypeIdDefaultValue g_position ("RandomWaypointPosition", "A random position model used to pick the next waypoint position.", RandomPosition::iid (), @@ -100,10 +100,10 @@ RandomWaypointMobilityModelParameters::GetCurrent (void) return parameters; } -InterfaceId +TypeId RandomWaypointMobilityModel::iid (void) { - static InterfaceId iid = InterfaceId ("RandomWaypointMobilityModel") + static TypeId iid = TypeId ("RandomWaypointMobilityModel") .SetParent () .AddConstructor () .AddConstructor > (); diff --git a/src/mobility/random-waypoint-mobility-model.h b/src/mobility/random-waypoint-mobility-model.h index 53822258f..0d3530619 100644 --- a/src/mobility/random-waypoint-mobility-model.h +++ b/src/mobility/random-waypoint-mobility-model.h @@ -86,7 +86,7 @@ private: class RandomWaypointMobilityModel : public MobilityModel { public: - static InterfaceId iid (void); + static TypeId iid (void); /** * Default parameters from \valueref{RandomWaypointPause}, * and, \valueref{RandomWaypointPosition}. diff --git a/src/mobility/static-mobility-model.cc b/src/mobility/static-mobility-model.cc index 11ed4ed84..333d016cc 100644 --- a/src/mobility/static-mobility-model.cc +++ b/src/mobility/static-mobility-model.cc @@ -23,10 +23,10 @@ namespace ns3 { NS_OBJECT_ENSURE_REGISTERED (StaticMobilityModel); -InterfaceId +TypeId StaticMobilityModel::iid (void) { - static InterfaceId iid = InterfaceId ("StaticMobilityModel") + static TypeId iid = TypeId ("StaticMobilityModel") .SetParent () .AddConstructor () .AddConstructor (); diff --git a/src/mobility/static-mobility-model.h b/src/mobility/static-mobility-model.h index 764d37d29..ea675b4c3 100644 --- a/src/mobility/static-mobility-model.h +++ b/src/mobility/static-mobility-model.h @@ -32,7 +32,7 @@ namespace ns3 { class StaticMobilityModel : public MobilityModel { public: - static InterfaceId iid (void); + static TypeId iid (void); /** * Create a position located at coordinates (0,0,0) */ diff --git a/src/mobility/static-speed-mobility-model.cc b/src/mobility/static-speed-mobility-model.cc index 42f94e085..8e7414478 100644 --- a/src/mobility/static-speed-mobility-model.cc +++ b/src/mobility/static-speed-mobility-model.cc @@ -24,9 +24,9 @@ namespace ns3 { NS_OBJECT_ENSURE_REGISTERED (StaticSpeedMobilityModel); -InterfaceId StaticSpeedMobilityModel::iid (void) +TypeId StaticSpeedMobilityModel::iid (void) { - static InterfaceId iid = InterfaceId ("StaticSpeedMobilityModel") + static TypeId iid = TypeId ("StaticSpeedMobilityModel") .SetParent () .AddConstructor () .AddConstructor () diff --git a/src/mobility/static-speed-mobility-model.h b/src/mobility/static-speed-mobility-model.h index 6ba020107..be7c11e79 100644 --- a/src/mobility/static-speed-mobility-model.h +++ b/src/mobility/static-speed-mobility-model.h @@ -35,7 +35,7 @@ namespace ns3 { class StaticSpeedMobilityModel : public MobilityModel { public: - static InterfaceId iid (void); + static TypeId iid (void); /** * Create position located at coordinates (0,0,0) with * speed (0,0,0). diff --git a/src/node/channel.cc b/src/node/channel.cc index cd5202ed7..71cd26e62 100644 --- a/src/node/channel.cc +++ b/src/node/channel.cc @@ -26,10 +26,10 @@ namespace ns3 { NS_OBJECT_ENSURE_REGISTERED (Channel); -InterfaceId +TypeId Channel::iid (void) { - static InterfaceId iid = InterfaceId ("Channel") + static TypeId iid = TypeId ("Channel") .SetParent (); return iid; } diff --git a/src/node/channel.h b/src/node/channel.h index d5d3402bc..ec3ccce53 100644 --- a/src/node/channel.h +++ b/src/node/channel.h @@ -35,7 +35,7 @@ class NetDevice; class Channel : public Object { public: - static InterfaceId iid (void); + static TypeId iid (void); Channel (); Channel (std::string name); diff --git a/src/node/drop-tail-queue.cc b/src/node/drop-tail-queue.cc index 872f0859d..d7a9418ce 100644 --- a/src/node/drop-tail-queue.cc +++ b/src/node/drop-tail-queue.cc @@ -26,9 +26,9 @@ namespace ns3 { NS_OBJECT_ENSURE_REGISTERED (DropTailQueue); -InterfaceId DropTailQueue::iid (void) +TypeId DropTailQueue::iid (void) { - static InterfaceId iid = InterfaceId ("DropTailQueue") + static TypeId iid = TypeId ("DropTailQueue") .SetParent () .AddConstructor (); return iid; diff --git a/src/node/drop-tail-queue.h b/src/node/drop-tail-queue.h index ceed313c4..9d6d0f7ee 100644 --- a/src/node/drop-tail-queue.h +++ b/src/node/drop-tail-queue.h @@ -35,7 +35,7 @@ const int DTQ_NPACKETS_MAX_DEFAULT = 100; */ class DropTailQueue : public Queue { public: - static InterfaceId iid (void); + static TypeId iid (void); /** * \brief DropTailQueue Constructor * diff --git a/src/node/ipv4.cc b/src/node/ipv4.cc index 410766584..791fd0892 100644 --- a/src/node/ipv4.cc +++ b/src/node/ipv4.cc @@ -27,10 +27,10 @@ namespace ns3 { NS_OBJECT_ENSURE_REGISTERED (Ipv4); -InterfaceId +TypeId Ipv4::iid (void) { - static InterfaceId iid = InterfaceId ("Ipv4") + static TypeId iid = TypeId ("Ipv4") .SetParent (); return iid; } diff --git a/src/node/ipv4.h b/src/node/ipv4.h index 856c2fcc8..83759e6a8 100644 --- a/src/node/ipv4.h +++ b/src/node/ipv4.h @@ -157,7 +157,7 @@ public: class Ipv4 : public Object { public: - static InterfaceId iid (void); + static TypeId iid (void); Ipv4 (); virtual ~Ipv4 (); diff --git a/src/node/net-device.cc b/src/node/net-device.cc index 9485ee894..8005d289c 100644 --- a/src/node/net-device.cc +++ b/src/node/net-device.cc @@ -35,9 +35,9 @@ namespace ns3 { NS_OBJECT_ENSURE_REGISTERED (NetDevice); -InterfaceId NetDevice::iid (void) +TypeId NetDevice::iid (void) { - static InterfaceId iid = InterfaceId ("NetDevice") + static TypeId iid = TypeId ("NetDevice") .SetParent (); return iid; } diff --git a/src/node/net-device.h b/src/node/net-device.h index 537c11116..89a2dde49 100644 --- a/src/node/net-device.h +++ b/src/node/net-device.h @@ -60,7 +60,7 @@ class Packet; class NetDevice : public Object { public: - static InterfaceId iid (void); + static TypeId iid (void); virtual ~NetDevice(); diff --git a/src/node/node.cc b/src/node/node.cc index d7a2c3f6c..2847bb369 100644 --- a/src/node/node.cc +++ b/src/node/node.cc @@ -31,10 +31,10 @@ namespace ns3{ NS_OBJECT_ENSURE_REGISTERED (Node); -InterfaceId +TypeId Node::iid (void) { - static InterfaceId iid = InterfaceId ("Node") + static TypeId iid = TypeId ("Node") .SetParent (); return iid; } diff --git a/src/node/node.h b/src/node/node.h index ed0c7aaf9..fa21d1f5b 100644 --- a/src/node/node.h +++ b/src/node/node.h @@ -96,7 +96,7 @@ private: class Node : public Object { public: - static InterfaceId iid (void); + static TypeId iid (void); /** * Must be invoked by subclasses only. diff --git a/src/node/packet-socket-factory.cc b/src/node/packet-socket-factory.cc index 5c82611f6..30855eff1 100644 --- a/src/node/packet-socket-factory.cc +++ b/src/node/packet-socket-factory.cc @@ -26,10 +26,10 @@ namespace ns3 { NS_OBJECT_ENSURE_REGISTERED (PacketSocketFactory); -InterfaceId +TypeId PacketSocketFactory::iid (void) { - static InterfaceId iid = InterfaceId ("Packet") + static TypeId iid = TypeId ("Packet") .SetParent (); return iid; } diff --git a/src/node/packet-socket-factory.h b/src/node/packet-socket-factory.h index 4963cb50c..1f521cfd8 100644 --- a/src/node/packet-socket-factory.h +++ b/src/node/packet-socket-factory.h @@ -34,7 +34,7 @@ class Socket; class PacketSocketFactory : public SocketFactory { public: - static InterfaceId iid (void); + static TypeId iid (void); PacketSocketFactory (); diff --git a/src/node/queue.cc b/src/node/queue.cc index 0f27b514d..f739dd8a3 100644 --- a/src/node/queue.cc +++ b/src/node/queue.cc @@ -27,7 +27,7 @@ NS_LOG_COMPONENT_DEFINE ("Queue"); namespace ns3 { -static InterfaceIdDefaultValue g_interfaceIdDefaultValue ("Queue", "Packet Queue", +static TypeIdDefaultValue g_interfaceIdDefaultValue ("Queue", "Packet Queue", Queue::iid (), "DropTailQueue"); NS_OBJECT_ENSURE_REGISTERED (Queue); @@ -98,10 +98,10 @@ QueueTraceType::Print (std::ostream &os) const } } -InterfaceId +TypeId Queue::iid (void) { - static InterfaceId iid = InterfaceId ("Queue") + static TypeId iid = TypeId ("Queue") .SetParent (); return iid; } @@ -283,7 +283,7 @@ Ptr Queue::CreateDefault (void) { NS_LOG_FUNCTION; - InterfaceId interfaceId = g_interfaceIdDefaultValue.GetValue (); + TypeId interfaceId = g_interfaceIdDefaultValue.GetValue (); Ptr queue = interfaceId.CreateObject ()->QueryInterface (); return queue; } diff --git a/src/node/queue.h b/src/node/queue.h index 781c53f46..e12b9fc09 100644 --- a/src/node/queue.h +++ b/src/node/queue.h @@ -78,7 +78,7 @@ private: class Queue : public Object { public: - static InterfaceId iid (void); + static TypeId iid (void); Queue (); virtual ~Queue (); diff --git a/src/node/socket-factory.cc b/src/node/socket-factory.cc index 4ae3733fe..fa56f89fc 100644 --- a/src/node/socket-factory.cc +++ b/src/node/socket-factory.cc @@ -24,9 +24,9 @@ namespace ns3 { NS_OBJECT_ENSURE_REGISTERED (SocketFactory); -InterfaceId SocketFactory::iid (void) +TypeId SocketFactory::iid (void) { - static InterfaceId iid = InterfaceId ("SocketFactory") + static TypeId iid = TypeId ("SocketFactory") .SetParent (); return iid; } diff --git a/src/node/socket-factory.h b/src/node/socket-factory.h index 6cc96ff5d..b17c3c225 100644 --- a/src/node/socket-factory.h +++ b/src/node/socket-factory.h @@ -47,7 +47,7 @@ class Socket; class SocketFactory : public Object { public: - static InterfaceId iid (void); + static TypeId iid (void); SocketFactory (); diff --git a/src/node/udp.cc b/src/node/udp.cc index 03de61448..50cac9500 100644 --- a/src/node/udp.cc +++ b/src/node/udp.cc @@ -24,9 +24,9 @@ namespace ns3 { NS_OBJECT_ENSURE_REGISTERED (Udp); -InterfaceId Udp::iid (void) +TypeId Udp::iid (void) { - static InterfaceId iid = InterfaceId ("Udp") + static TypeId iid = TypeId ("Udp") .SetParent (); return iid; } diff --git a/src/node/udp.h b/src/node/udp.h index aadcb3eb8..8b31795fd 100644 --- a/src/node/udp.h +++ b/src/node/udp.h @@ -43,7 +43,7 @@ class Socket; class Udp : public SocketFactory { public: - static InterfaceId iid (void); + static TypeId iid (void); Udp (); diff --git a/src/routing/global-routing/global-route-manager-impl.cc b/src/routing/global-routing/global-route-manager-impl.cc index 66530bf2e..95ea3a51a 100644 --- a/src/routing/global-routing/global-route-manager-impl.cc +++ b/src/routing/global-routing/global-route-manager-impl.cc @@ -151,14 +151,14 @@ SPFVertex::GetDistanceFromRoot (void) const } void -SPFVertex::SetOutgoingInterfaceId (uint32_t id) +SPFVertex::SetOutgoingTypeId (uint32_t id) { NS_LOG_FUNCTION; m_rootOif = id; } uint32_t -SPFVertex::GetOutgoingInterfaceId (void) const +SPFVertex::GetOutgoingTypeId (void) const { NS_LOG_FUNCTION; return m_rootOif; @@ -784,14 +784,14 @@ GlobalRouteManagerImpl::SPFNexthopCalculation ( // from the perspective of -- remember that is the link "from" // "to" . // - w->SetOutgoingInterfaceId ( - FindOutgoingInterfaceId (l->GetLinkData ())); + w->SetOutgoingTypeId ( + FindOutgoingTypeId (l->GetLinkData ())); w->SetDistanceFromRoot (distance); w->SetParent (v); NS_LOG_LOGIC ("Next hop from " << v->GetVertexId () << " to " << w->GetVertexId () << " goes through next hop " << w->GetNextHop () << - " via outgoing interface " << w->GetOutgoingInterfaceId () << + " via outgoing interface " << w->GetOutgoingTypeId () << " with distance " << distance); } // end W is a router vertes else @@ -801,14 +801,14 @@ GlobalRouteManagerImpl::SPFNexthopCalculation ( GlobalRoutingLSA* w_lsa = w->GetLSA (); NS_ASSERT (w_lsa->GetLSType () == GlobalRoutingLSA::NetworkLSA); // Find outgoing interface ID for this network - w->SetOutgoingInterfaceId ( - FindOutgoingInterfaceId (w_lsa->GetLinkStateId (), + w->SetOutgoingTypeId ( + FindOutgoingTypeId (w_lsa->GetLinkStateId (), w_lsa->GetNetworkLSANetworkMask () )); w->SetDistanceFromRoot (distance); w->SetParent (v); NS_LOG_LOGIC ("Next hop from " << v->GetVertexId () << " to network " << w->GetVertexId () << - " via outgoing interface " << w->GetOutgoingInterfaceId () << + " via outgoing interface " << w->GetOutgoingTypeId () << " with distance " << distance); return 1; } @@ -833,17 +833,17 @@ GlobalRouteManagerImpl::SPFNexthopCalculation ( * it can be inherited from the parent network). */ w->SetNextHop(linkRemote->GetLinkData ()); - w->SetOutgoingInterfaceId (v->GetOutgoingInterfaceId ()); + w->SetOutgoingTypeId (v->GetOutgoingTypeId ()); NS_LOG_LOGIC ("Next hop from " << v->GetVertexId () << " to " << w->GetVertexId () << " goes through next hop " << w->GetNextHop () << - " via outgoing interface " << w->GetOutgoingInterfaceId ()); + " via outgoing interface " << w->GetOutgoingTypeId ()); } } else { w->SetNextHop (v->GetNextHop ()); - w->SetOutgoingInterfaceId (v->GetOutgoingInterfaceId ()); + w->SetOutgoingTypeId (v->GetOutgoingTypeId ()); } } else @@ -862,7 +862,7 @@ GlobalRouteManagerImpl::SPFNexthopCalculation ( // (are inherited). // w->SetNextHop (v->GetNextHop ()); - w->SetOutgoingInterfaceId (v->GetOutgoingInterfaceId ()); + w->SetOutgoingTypeId (v->GetOutgoingTypeId ()); } // // In all cases, we need valid values for the distance metric and a parent. @@ -1122,7 +1122,7 @@ GlobalRouteManagerImpl::SPFCalculate (Ipv4Address root) // have to find the right node pointer to pass to that function. // uint32_t -GlobalRouteManagerImpl::FindOutgoingInterfaceId (Ipv4Address a, Ipv4Mask amask) +GlobalRouteManagerImpl::FindOutgoingTypeId (Ipv4Address a, Ipv4Mask amask) { NS_LOG_FUNCTION; // @@ -1165,7 +1165,7 @@ GlobalRouteManagerImpl::FindOutgoingInterfaceId (Ipv4Address a, Ipv4Mask amask) // Ptr ipv4 = node->QueryInterface (); NS_ASSERT_MSG (ipv4, - "GlobalRouteManagerImpl::FindOutgoingInterfaceId (): " + "GlobalRouteManagerImpl::FindOutgoingTypeId (): " "QI for interface failed"); // // Look through the interfaces on this node for one that has the IP address @@ -1290,7 +1290,7 @@ GlobalRouteManagerImpl::SPFIntraAddRouter (SPFVertex* v) NS_LOG_LOGIC (" Node " << node->GetId () << " add route to " << lr->GetLinkData () << " using next hop " << v->GetNextHop () << - " via interface " << v->GetOutgoingInterfaceId ()); + " via interface " << v->GetOutgoingTypeId ()); // // Here's why we did all of that work. We're going to add a host route to the // host address found in the m_linkData field of the point-to-point link @@ -1305,7 +1305,7 @@ GlobalRouteManagerImpl::SPFIntraAddRouter (SPFVertex* v) // which the packets should be send for forwarding. // ipv4->AddHostRouteTo (lr->GetLinkData (), v->GetNextHop (), - v->GetOutgoingInterfaceId ()); + v->GetOutgoingTypeId ()); } // // Done adding the routes for the selected node. @@ -1387,11 +1387,11 @@ GlobalRouteManagerImpl::SPFIntraAddTransit (SPFVertex* v) Ipv4Address tempip = lsa->GetLinkStateId (); tempip = tempip.CombineMask (tempmask); ipv4->AddNetworkRouteTo (tempip, tempmask, v->GetNextHop (), - v->GetOutgoingInterfaceId ()); + v->GetOutgoingTypeId ()); NS_LOG_LOGIC ("Node " << node->GetId () << " add network route to " << tempip << " using next hop " << v->GetNextHop () << - " via interface " << v->GetOutgoingInterfaceId ()); + " via interface " << v->GetOutgoingTypeId ()); } } } diff --git a/src/routing/global-routing/global-route-manager-impl.h b/src/routing/global-routing/global-route-manager-impl.h index 55d4099f6..139b25178 100644 --- a/src/routing/global-routing/global-route-manager-impl.h +++ b/src/routing/global-routing/global-route-manager-impl.h @@ -293,7 +293,7 @@ public: * @returns The interface index to use when forwarding packets to the host * or network represented by "this" SPFVertex. */ - uint32_t GetOutgoingInterfaceId (void) const; + uint32_t GetOutgoingTypeId (void) const; /** * @brief Set the interface ID that should be used to begin forwarding packets @@ -335,7 +335,7 @@ public: * @param id The interface index to use when forwarding packets to the host or * network represented by "this" SPFVertex. */ - void SetOutgoingInterfaceId (uint32_t id); + void SetOutgoingTypeId (uint32_t id); /** * @brief Get the IP address that should be used to begin forwarding packets @@ -759,7 +759,7 @@ private: GlobalRoutingLinkRecord* prev_link); void SPFIntraAddRouter (SPFVertex* v); void SPFIntraAddTransit (SPFVertex* v); - uint32_t FindOutgoingInterfaceId (Ipv4Address a, + uint32_t FindOutgoingTypeId (Ipv4Address a, Ipv4Mask amask = Ipv4Mask("255.255.255.255")); }; diff --git a/src/routing/global-routing/global-router-interface.cc b/src/routing/global-routing/global-router-interface.cc index 0cf86ffa7..793f623a6 100644 --- a/src/routing/global-routing/global-router-interface.cc +++ b/src/routing/global-routing/global-router-interface.cc @@ -433,10 +433,10 @@ std::ostream& operator<< (std::ostream& os, GlobalRoutingLSA& lsa) NS_OBJECT_ENSURE_REGISTERED (GlobalRouter); -InterfaceId +TypeId GlobalRouter::iid (void) { - static InterfaceId iid = InterfaceId ("GlobalRouter") + static TypeId iid = TypeId ("GlobalRouter") .SetParent (); return iid; } diff --git a/src/routing/global-routing/global-router-interface.h b/src/routing/global-routing/global-router-interface.h index dd8bf30ef..c1df20ba2 100644 --- a/src/routing/global-routing/global-router-interface.h +++ b/src/routing/global-routing/global-router-interface.h @@ -560,7 +560,7 @@ public: * * @see Object::QueryInterface () */ - static InterfaceId iid (void); + static TypeId iid (void); /** * @brief Create a Global Router class diff --git a/src/routing/olsr/olsr-agent-impl.cc b/src/routing/olsr/olsr-agent-impl.cc index 32f84dcab..81910b3b9 100644 --- a/src/routing/olsr/olsr-agent-impl.cc +++ b/src/routing/olsr/olsr-agent-impl.cc @@ -150,10 +150,10 @@ NS_LOG_COMPONENT_DEFINE ("OlsrAgent"); NS_OBJECT_ENSURE_REGISTERED (AgentImpl); -InterfaceId +TypeId AgentImpl::iid (void) { - static InterfaceId iid = InterfaceId ("OlsrAgentImpl") + static TypeId iid = TypeId ("OlsrAgentImpl") .SetParent () .AddConstructor > (); return iid; diff --git a/src/routing/olsr/olsr-agent-impl.h b/src/routing/olsr/olsr-agent-impl.h index ab67b2039..750f998c6 100644 --- a/src/routing/olsr/olsr-agent-impl.h +++ b/src/routing/olsr/olsr-agent-impl.h @@ -49,7 +49,7 @@ namespace olsr { class AgentImpl : public Agent { public: - static InterfaceId iid (void); + static TypeId iid (void); AgentImpl (Ptr node); diff --git a/src/routing/olsr/olsr-agent.cc b/src/routing/olsr/olsr-agent.cc index 6b736a29e..df73b7c15 100644 --- a/src/routing/olsr/olsr-agent.cc +++ b/src/routing/olsr/olsr-agent.cc @@ -24,18 +24,18 @@ namespace ns3 { namespace olsr { -static InterfaceIdDefaultValue g_defaultImpl = - InterfaceIdDefaultValue ("OlsrAgentType", +static TypeIdDefaultValue g_defaultImpl = + TypeIdDefaultValue ("OlsrAgentType", "The type of OlsrAgent implementation", Agent::iid (), "OlsrAgentImpl"); NS_OBJECT_ENSURE_REGISTERED (Agent); -InterfaceId +TypeId Agent::iid (void) { - static InterfaceId iid = InterfaceId ("OlsrAgent") + static TypeId iid = TypeId ("OlsrAgent") .SetParent (); return iid; } @@ -43,7 +43,7 @@ Agent::iid (void) Ptr Agent::CreateDefault (Ptr node) { - InterfaceId iid = g_defaultImpl.GetValue (); + TypeId iid = g_defaultImpl.GetValue (); Ptr agent = iid.CreateObject (node)->QueryInterface (); return agent; } diff --git a/src/routing/olsr/olsr-agent.h b/src/routing/olsr/olsr-agent.h index a3b0a0d67..3a8a48c21 100644 --- a/src/routing/olsr/olsr-agent.h +++ b/src/routing/olsr/olsr-agent.h @@ -45,7 +45,7 @@ namespace olsr { class Agent : public Object { public: - static InterfaceId iid (void); + static TypeId iid (void); static Ptr CreateDefault (Ptr node);