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