Iterator.validate_iterator_state to avoid crashes using next() and get()

Just to avoid accidental crashes using .get() / .next() when using them from Python - in cases when iterator was initialized but there were no elements or if iterator got exhausted.
This commit is contained in:
Andrej730
2025-07-03 18:05:59 +05:00
parent da4ae4c2f2
commit e52af2baad
2 changed files with 28 additions and 7 deletions
+2
View File
@@ -122,6 +122,7 @@ namespace IfcGeom {
std::mutex element_ready_mutex_;
bool task_result_ptr_initialized = false;
bool task_result_ptr_exhausted = false;
size_t async_elements_returned_ = 0;
ifcopenshell::geometry::Settings settings_;
@@ -207,6 +208,7 @@ namespace IfcGeom {
bool wait_for_element();
void log_timepoints() const;
void validate_iterator_state() const;
ifcopenshell::geometry::taxonomy::direction3::ptr remove_offset_();
public: