IfcFile: possibility to mark an entity as modified so that potential cache is invalidated.

This commit is contained in:
Stinkfist0
2018-12-21 12:06:35 +02:00
committed by Thomas Krijnen
parent 3bef32bb87
commit 000d11daab
2 changed files with 12 additions and 1 deletions
+4
View File
@@ -148,6 +148,10 @@ public:
/// in the first function argument.
IfcEntityList::ptr traverse(IfcUtil::IfcBaseClass* instance, int max_level=-1);
/// Marks entity as modified so that potential cache for it is invalidated.
/// @todo Currently the whole cache is invalidated. Implement more fine-grained invalidation.
void mark_entity_as_modified(int id);
#ifdef USE_MMAP
bool Init(const std::string& fn, bool mmap=false);
#else
+8 -1
View File
@@ -1213,7 +1213,9 @@ void IfcEntityInstanceData::setArgument(unsigned int i, Argument* a, IfcUtil::Ar
if (this->file) {
register_inverse_visitor visitor(*this->file, *this);
apply_individual_instance_visitor(copy).apply(visitor);
}
this->file->mark_entity_as_modified(id_);
}
if (i < attributes_.size()) {
attributes_[i] = copy;
@@ -1429,6 +1431,11 @@ IfcEntityList::ptr IfcFile::traverse(IfcUtil::IfcBaseClass* instance, int max_le
return IfcParse::traverse(instance, max_level);
}
void IfcFile::mark_entity_as_modified(int /*id*/)
{
by_ref_cached_.clear();
}
void IfcFile::addEntities(IfcEntityList::ptr es) {
for( IfcEntityList::it i = es->begin(); i != es->end(); ++ i ) {
addEntity(*i);