From 304db645e06326d938be03dbd3970ebdbffa4e46 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Wed, 14 May 2008 13:54:23 -0700 Subject: [PATCH] add missing TypeId::HasParent method --- src/core/type-id.cc | 6 ++++++ src/core/type-id.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/core/type-id.cc b/src/core/type-id.cc index 6234cb628..339cbb368 100644 --- a/src/core/type-id.cc +++ b/src/core/type-id.cc @@ -473,6 +473,12 @@ TypeId::GetParent (void) const return TypeId (parent); } bool +TypeId::HasParent (void) const +{ + uint16_t parent = Singleton::Get ()->GetParent (m_tid); + return parent != m_tid; +} +bool TypeId::IsChildOf (TypeId other) const { TypeId tmp = *this; diff --git a/src/core/type-id.h b/src/core/type-id.h index 56ef2de94..713f8cb5a 100644 --- a/src/core/type-id.h +++ b/src/core/type-id.h @@ -109,6 +109,8 @@ public: */ TypeId GetParent (void) const; + bool HasParent (void) const; + /** * \param other a parent TypeId * \returns true if the input TypeId is really a parent