add TypeId::IsChildOf

This commit is contained in:
Mathieu Lacage committed 2008-03-17 11:55:46 -07:00
1 parent bcf92901ac
commit b5bfc150e3
2 files changed
+12

No files matched your search

+10
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
{
+2
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.
*/