Lagrange
Loading...
Searching...
No Matches
ProgressBridge Class Reference

Bridge between xatlas's C-style progress callback and the Lagrange notification + cancel API. More...

#include <internal/progress_bridge.h>

Public Member Functions

 ProgressBridge (std::function< void(const std::string &, float)> notification_func, const std::atomic_bool *cancel) noexcept
 
void install (::xatlas::Atlas *atlas) noexcept
 Install on an atlas (no-op if both members are null).
 
bool was_cancelled () const noexcept
 True if the user requested cancellation, or the bridge cancelled due to a user exception.
 
void rethrow_if_pending ()
 Rethrow any exception captured from the user notification callback.
 

Detailed Description

Bridge between xatlas's C-style progress callback and the Lagrange notification + cancel API.

xatlas may call its progress callback from worker threads. The bridge forwards monotonic per-category progress to the user callback and never lets exceptions propagate across the C ABI. If another thread is already notifying the callback, the new signal is dropped. Any exception thrown by the user callback is captured and rethrown by rethrow_if_pending() after the xatlas call returns.


The documentation for this class was generated from the following files: