Moves to the next shape representation, create its geometry, and returns the associated product. Use get() to retrieve the created geometry.
| 491 | /// Moves to the next shape representation, create its geometry, and returns the associated product. |
| 492 | /// Use get() to retrieve the created geometry. |
| 493 | const IfcUtil::IfcBaseClass* IfcGeom::Iterator::next() { |
| 494 | using std::chrono::high_resolution_clock; |
| 495 | validate_iterator_state(); |
| 496 | |
| 497 | if (*native_task_result_iterator_ != *task_result_iterator_) { |
| 498 | delete* native_task_result_iterator_; |
| 499 | } |
| 500 | delete* task_result_iterator_; |
| 501 | |
| 502 | if (num_threads_ != 1) { |
| 503 | if (!wait_for_element()) { |
| 504 | Logger::SetProduct(boost::none); |
| 505 | time_points[3] = high_resolution_clock::now(); |
| 506 | log_timepoints(); |
| 507 | task_result_ptr_exhausted = true; |
| 508 | return nullptr; |
| 509 | } |
| 510 | |
| 511 | task_result_iterator_++; |
| 512 | native_task_result_iterator_++; |
| 513 | |
| 514 | return (*task_result_iterator_)->product(); |
| 515 | } else { |
| 516 | // Increment the iterator over the list of products using the current |
| 517 | // shape representation |
| 518 | if (task_result_iterator_ == --all_processed_elements_.end()) { |
| 519 | if (!create()) { |
| 520 | Logger::SetProduct(boost::none); |
| 521 | time_points[3] = high_resolution_clock::now(); |
| 522 | log_timepoints(); |
| 523 | task_result_ptr_exhausted = true; |
| 524 | return nullptr; |
| 525 | } |
| 526 | } |
| 527 | |
| 528 | task_result_iterator_++; |
| 529 | native_task_result_iterator_++; |
| 530 | |
| 531 | return (*task_result_iterator_)->product(); |
| 532 | } |
| 533 | } |
| 534 | |
| 535 | /// Gets the representation of the current geometrical entity. |
| 536 | IfcGeom::Element* IfcGeom::Iterator::get() |
no test coverage detected