# HG changeset patch # User Mathieu Lacage # Date 1207848236 25200 # Node ID 3cff8627a284f6e586db45aa639b4a9523e82747 # Parent 621b23d5be5bf51a76a9e190392dacf4ccc343f1 make IsChildOf not return true for test against self. Add operator < for TypeId. diff -r 621b23d5be5b -r 3cff8627a284 src/core/type-id.cc --- a/src/core/type-id.cc Thu Apr 10 09:23:24 2008 -0700 +++ b/src/core/type-id.cc Thu Apr 10 10:23:56 2008 -0700 @@ -480,7 +480,7 @@ { tmp = tmp.GetParent (); } - return tmp == other; + return tmp == other && *this != other; } std::string TypeId::GetGroupName (void) const @@ -696,4 +696,9 @@ return a.m_tid != b.m_tid; } +bool operator < (TypeId a, TypeId b) +{ + return a.m_tid < b.m_tid; +} + } // namespace ns3 diff -r 621b23d5be5b -r 3cff8627a284 src/core/type-id.h --- a/src/core/type-id.h Thu Apr 10 09:23:24 2008 -0700 +++ b/src/core/type-id.h Thu Apr 10 10:23:56 2008 -0700 @@ -357,6 +357,7 @@ friend class AttributeList; friend bool operator == (TypeId a, TypeId b); friend bool operator != (TypeId a, TypeId b); + friend bool operator < (TypeId a, TypeId b); /** @@ -375,6 +376,10 @@ std::ostream & operator << (std::ostream &os, TypeId tid); std::istream & operator >> (std::istream &is, TypeId &tid); +bool operator == (TypeId a, TypeId b); +bool operator != (TypeId a, TypeId b); +bool operator < (TypeId a, TypeId b); + ATTRIBUTE_HELPER_HEADER_2 (TypeId);