From 1b9b93d81933212ef0ee47100be77e01e74b9232 Mon Sep 17 00:00:00 2001 From: Mitch Watrous Date: Tue, 1 May 2012 10:18:37 -0700 Subject: [PATCH] Bug 962 - list of paths to reach objects contains bogus entries --- RELEASE_NOTES | 1 + src/internet/model/ipv6-interface.cc | 2 ++ src/internet/model/udp-socket-impl.cc | 2 ++ src/network/model/socket.cc | 10 ++++++++++ src/network/model/socket.h | 1 + utils/print-introspected-doxygen.cc | 13 +++++++++++++ 6 files changed, 29 insertions(+) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 07903ae70..a3314a1be 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -36,6 +36,7 @@ New user-visible features Bugs fixed ---------- + - bug 962 - list of paths to reach objects contains bogus entries - bug 1313 - Stddev (average.h) returning NaN - bug 1319 - Fix Ipv6RawSocketImpl Icmpv6 filter - bug 1318 - Asserts for IPv6 malformed packets diff --git a/src/internet/model/ipv6-interface.cc b/src/internet/model/ipv6-interface.cc index bb6cebf5f..e7961f30f 100644 --- a/src/internet/model/ipv6-interface.cc +++ b/src/internet/model/ipv6-interface.cc @@ -34,6 +34,8 @@ namespace ns3 NS_LOG_COMPONENT_DEFINE ("Ipv6Interface"); +NS_OBJECT_ENSURE_REGISTERED (Ipv6Interface); + TypeId Ipv6Interface::GetTypeId () { static TypeId tid = TypeId ("ns3::Ipv6Interface") diff --git a/src/internet/model/udp-socket-impl.cc b/src/internet/model/udp-socket-impl.cc index acd93b6a3..284977ba9 100644 --- a/src/internet/model/udp-socket-impl.cc +++ b/src/internet/model/udp-socket-impl.cc @@ -42,6 +42,8 @@ NS_LOG_COMPONENT_DEFINE ("UdpSocketImpl"); namespace ns3 { +NS_OBJECT_ENSURE_REGISTERED (UdpSocketImpl); + static const uint32_t MAX_IPV4_UDP_DATAGRAM_SIZE = 65507; // Add attributes generic to all UdpSockets to base class UdpSocket diff --git a/src/network/model/socket.cc b/src/network/model/socket.cc index 58494265f..02808a6ae 100644 --- a/src/network/model/socket.cc +++ b/src/network/model/socket.cc @@ -31,6 +31,16 @@ NS_LOG_COMPONENT_DEFINE ("Socket"); namespace ns3 { +NS_OBJECT_ENSURE_REGISTERED (Socket); + +TypeId +Socket::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::Socket") + .SetParent (); + return tid; +} + Socket::Socket (void) { m_boundnetdevice = 0; diff --git a/src/network/model/socket.h b/src/network/model/socket.h index 33d300dbc..e6e30d1bb 100644 --- a/src/network/model/socket.h +++ b/src/network/model/socket.h @@ -64,6 +64,7 @@ class Packet; class Socket : public Object { public: + static TypeId GetTypeId (void); Socket (void); virtual ~Socket (void); diff --git a/utils/print-introspected-doxygen.cc b/utils/print-introspected-doxygen.cc index 2eb5fa939..d34d1562c 100644 --- a/utils/print-introspected-doxygen.cc +++ b/utils/print-introspected-doxygen.cc @@ -207,6 +207,19 @@ StaticInformation::DoGather (TypeId tid) if (ptrChecker != 0) { TypeId pointee = ptrChecker->GetPointeeTypeId (); + + // See if this is a pointer to an Object. + Ptr object = CreateObject (); + TypeId objectTypeId = object->GetTypeId (); + if (objectTypeId == pointee) + { + // Stop the recursion at this attribute if it is a + // pointer to an Object, which create too many spurious + // paths in the list of attribute paths because any + // Object can be in that part of the path. + continue; + } + m_currentPath.push_back (info.name); m_alreadyProcessed.push_back (tid); DoGather (pointee);