Extend Python's dir() function on entity instances with attribute and inverse attribute names of entities

This commit is contained in:
Thomas Krijnen
2015-02-27 13:41:33 +00:00
parent d41dbc386e
commit 9bbbc6e7d9
9 changed files with 413 additions and 292 deletions
+16
View File
@@ -216,3 +216,19 @@ bool IfcParse::IfcLateBoundEntity::is_valid() {
}
return valid;
}
std::vector<std::string> IfcParse::IfcLateBoundEntity::getAttributeNames() const {
std::vector<std::string> return_value;
return_value.reserve(getArgumentCount());
for (unsigned i = 0; i < getArgumentCount(); ++i) {
return_value.push_back(getArgumentName(i));
}
return return_value;
}
std::vector<std::string> IfcParse::IfcLateBoundEntity::getInverseAttributeNames() const {
std::vector<std::string> return_value;
std::set<std::string> values = IfcSchema::Type::GetInverseAttributeNames(_type);
std::copy(values.begin(), values.end(), std::back_inserter(return_value));
return return_value;
}