Skip to content

Commit 5f7d92a

Browse files
committed
IfcOpenShell#1153 HdfSerializer.remove() for cache eviction
1 parent c754d15 commit 5f7d92a

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/serializers/HdfSerializer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,11 @@ void HdfSerializer::read_surface_style(surface_style_serialization& s, std::shar
252252

253253
}
254254

255+
void HdfSerializer::remove(const std::string& guid) {
256+
if (H5Lexists(file.getId(), guid.c_str(), H5P_DEFAULT)) {
257+
file.unlink(guid);
258+
}
259+
}
255260

256261
const IfcGeom::Element* HdfSerializer::read(IfcParse::IfcFile& f, const std::string& guid, unsigned int representation_id, read_type rt) {
257262
if (!H5Lexists(file.getId(), guid.c_str(), H5P_DEFAULT)) {

src/serializers/HdfSerializer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class HdfSerializer : public GeometrySerializer {
9595
H5::Group write(const IfcGeom::Element* o);
9696
void write(const IfcGeom::BRepElement* o);
9797
void write(const IfcGeom::TriangulationElement* o);
98+
void remove(const std::string& guid);
9899

99100
const IfcGeom::Element* read(IfcParse::IfcFile& f, const std::string& guid, unsigned int representation_id, read_type rt = READ_BREP);
100101

0 commit comments

Comments
 (0)