From 328aa2cc452378f38dfd3b506c0fdeab1bed8387 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Wed, 2 Jan 2008 11:08:11 +0100 Subject: [PATCH] remove some remnants from the iid-a-variable era. --- src/core/object.cc | 18 +++++++++--------- src/core/object.h | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/core/object.cc b/src/core/object.cc index b093c9629..287ef0fb5 100644 --- a/src/core/object.cc +++ b/src/core/object.cc @@ -40,15 +40,15 @@ class IidManager : public ns3::UidManager class IidTree { public: - void SetParent (uint16_t child, const uint16_t *parent); + void SetParent (uint16_t child, uint16_t parent); uint16_t LookupParent (uint16_t child); private: - std::vector m_parents; + std::vector m_parents; }; void -IidTree::SetParent (uint16_t child, const uint16_t *parent) +IidTree::SetParent (uint16_t child, uint16_t parent) { m_parents.resize (child+1); m_parents[child] = parent; @@ -57,7 +57,7 @@ uint16_t IidTree::LookupParent (uint16_t child) { NS_ASSERT (child < m_parents.size ()); - return *(m_parents[child]); + return m_parents[child]; } } // anonymous namespace @@ -158,23 +158,23 @@ InterfaceId::GetName (void) const return name; } -bool operator == (const InterfaceId &a, const InterfaceId &b) +bool operator == (InterfaceId a, InterfaceId b) { return a.m_iid == b.m_iid; } -bool operator != (const InterfaceId &a, const InterfaceId &b) +bool operator != (InterfaceId a, InterfaceId b) { return a.m_iid != b.m_iid; } InterfaceId -MakeInterfaceId (std::string name, const InterfaceId &parent) +MakeInterfaceId (std::string name, InterfaceId parent) { uint32_t uid = Singleton::Get ()->Allocate (name); NS_ASSERT (uid <= 0xffff); InterfaceId iid = uid; - Singleton::Get ()->SetParent (iid.m_iid, &parent.m_iid); + Singleton::Get ()->SetParent (iid.m_iid, parent.m_iid); return iid; } @@ -182,7 +182,7 @@ InterfaceId MakeObjectInterfaceId (void) { InterfaceId iid = Singleton::Get ()->Allocate ("Object"); - Singleton::Get ()->SetParent (iid.m_iid, &iid.m_iid); + Singleton::Get ()->SetParent (iid.m_iid, iid.m_iid); return iid; } diff --git a/src/core/object.h b/src/core/object.h index de4bf4eaa..3f5590886 100644 --- a/src/core/object.h +++ b/src/core/object.h @@ -68,10 +68,10 @@ public: ~InterfaceId (); private: InterfaceId (uint16_t iid); - friend InterfaceId MakeInterfaceId (std::string name, const InterfaceId &parent); + friend InterfaceId MakeInterfaceId (std::string name, InterfaceId parent); friend InterfaceId MakeObjectInterfaceId (void); - friend bool operator == (const InterfaceId &a, const InterfaceId &b); - friend bool operator != (const InterfaceId &a, const InterfaceId &b); + friend bool operator == (InterfaceId a, InterfaceId b); + friend bool operator != (InterfaceId a, InterfaceId b); uint16_t m_iid; }; @@ -86,7 +86,7 @@ private: * itself. */ InterfaceId -MakeInterfaceId (std::string name, const InterfaceId &parent); +MakeInterfaceId (std::string name, InterfaceId parent); /** * \brief a base class which provides memory management and object aggregation