Use constant time parent enumeration lookup

This commit is contained in:
Thomas Krijnen
2016-03-18 11:14:14 +01:00
parent 28560d164c
commit 0ceef8fe67
10 changed files with 103 additions and 1292 deletions
+14 -2
View File
@@ -4952,7 +4952,13 @@ std::pair<Type::Enum, unsigned> Type::GetInverseAttribute(Enum t, const std::str
return jt->second;
}
}
if ((t = Parent(t)) == -1) break;
boost::optional<Enum> pt = Parent(t);
if (pt) {
t = *pt;
}
else {
break;
}
}
throw IfcException("Attribute not found");
}
@@ -4971,7 +4977,13 @@ std::set<std::string> Type::GetInverseAttributeNames(Enum t) {
return_value.insert(jt->first);
}
}
if ((t = Parent(t)) == -1) break;
boost::optional<Enum> pt = Parent(t);
if (pt) {
t = *pt;
}
else {
break;
}
}
return return_value;