mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-17 19:09:07 +00:00
IfcFile: possibility to mark an entity as modified so that potential cache is invalidated.
This commit is contained in:
committed by
Thomas Krijnen
parent
3bef32bb87
commit
000d11daab
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user