add TypeId::IsChildOf

This commit is contained in:
Mathieu Lacage
2008-03-17 11:55:46 -07:00
parent bcf92901ac
commit b5bfc150e3
2 changed files with 12 additions and 0 deletions

View File

@@ -475,6 +475,16 @@ TypeId::GetParent (void) const
uint16_t parent = Singleton<IidManager>::Get ()->GetParent (m_tid);
return TypeId (parent);
}
bool
TypeId::IsChildOf (TypeId other) const
{
TypeId tmp = *this;
while (tmp != other && tmp != tmp)
{
tmp = tmp.GetParent ();
}
return tmp == other;
}
std::string
TypeId::GetGroupName (void) const
{

View File

@@ -90,6 +90,8 @@ public:
*/
TypeId GetParent (void) const;
bool IsChildOf (TypeId other) const;
/**
* \returns the name of the group associated to this TypeId.
*/