make IsChildOf not return true for test against self. Add operator < for TypeId.
--- 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
--- 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);