From 3d6e4532aeffb4e8e03d63b6f81a1c69ee6ab6a0 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Tue, 8 Jul 2008 14:27:45 -0700 Subject: [PATCH] avoid direct access to Object::m_tid. Use ObjectBase::GetInstanceTypeId instead. --- src/core/object.cc | 7 ++++--- src/core/object.h | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/object.cc b/src/core/object.cc index 1b11fc782..9640d158b 100644 --- a/src/core/object.cc +++ b/src/core/object.cc @@ -113,7 +113,7 @@ Object::DoGetObject (TypeId tid) const const Object *currentObject = this; do { NS_ASSERT (currentObject != 0); - TypeId cur = currentObject->m_tid; + TypeId cur = currentObject->GetInstanceTypeId (); while (cur != tid && cur != Object::GetTypeId ()) { cur = cur.GetParent (); @@ -146,10 +146,11 @@ Object::AggregateObject (Ptr o) NS_ASSERT (CheckLoose ()); NS_ASSERT (o->CheckLoose ()); - if (DoGetObject (o->m_tid)) + if (DoGetObject (o->GetInstanceTypeId ())) { NS_FATAL_ERROR ("Object::AggregateObject(): " - "Multiple aggregation of objects of type " << o->m_tid.GetName ()); + "Multiple aggregation of objects of type " << + o->GetInstanceTypeId ().GetName ()); } Object *other = PeekPointer (o); diff --git a/src/core/object.h b/src/core/object.h index c28c3d6c8..225ef652a 100644 --- a/src/core/object.h +++ b/src/core/object.h @@ -379,7 +379,7 @@ template Ptr CopyObject (Ptr object) { Ptr p = Ptr (new T (*PeekPointer (object)), false); - NS_ASSERT (p->m_tid == object->m_tid); + NS_ASSERT (p->GetInstanceTypeId () == object->GetInstanceTypeId ()); return p; } @@ -387,7 +387,7 @@ template Ptr CopyObject (Ptr object) { Ptr p = Ptr (new T (*PeekPointer (object)), false); - NS_ASSERT (p->m_tid == object->m_tid); + NS_ASSERT (p->GetInstanceTypeId () == object->GetInstanceTypeId ()); return p; }