Disallow adding instances from different schema

This commit is contained in:
Thomas Krijnen
2018-11-04 15:16:08 +01:00
parent f7e66d1e7f
commit e7daf871b8
+4
View File
@@ -1511,6 +1511,10 @@ void IfcFile::addEntities(IfcEntityList::ptr es) {
}
IfcUtil::IfcBaseClass* IfcFile::addEntity(IfcUtil::IfcBaseClass* entity) {
if (entity->declaration().schema() != schema()) {
throw IfcParse::IfcException("Unabled to add instance from " + entity->declaration().schema()->name() + " schema to file with " + schema()->name() + " schema");
}
// If this instance has been inserted before, return
// a reference to the copy that was created from it.
entity_entity_map_t::iterator mit = entity_file_map.find(entity);