Host-owned job state shared between its worker and queued GUI continuations.
More...
|
| | Job (GuiExtensionHost *owner, QString caption) |
| | Create retained job state before scheduling its worker.
|
| |
| void | postFlush () |
| | Post the single pending flush after releasing the state mutex.
|
| |
| bool | reserveFlush () |
| | Reserve a flush while the caller holds mutex.
|
| |
| void | publishCancellation () |
| | Commit GUI cancellation metadata without invoking a user completion callback.
|
| |
| bool | requestCancellation () |
| | Atomically request cancellation before worker settlement.
|
| |
| void | cancel () override |
| | Request cooperative cancellation.
|
| |
| bool | isFinished () const override |
| | Inspect worker completion.
|
| |
| bool | isCancelled () const override |
| | Check cooperative cancellation from a worker.
|
| |
| void | setProgress (double fraction, const QString &text) override |
| | Queue progress to the host without touching widgets from the worker.
|
| |
| void | postToMainThread (std::function< void()> callback) override |
| | Queue a GUI-thread continuation while the host is alive.
|
| |
| bool | beginWork () |
| | Enter execution unless cancellation won while the worker was queued.
|
| |
| void | settle (const QString &message) |
| | Latch outcome at worker return, preventing a later cancel from changing it.
|
| |
| void | flush (bool callbacks=true) |
| | Publish one latched state packet; no worker touches widgets or the registry.
|
| |
| virtual | ~IJob ()=default |
| | Destroy a job implementation; handles returned by the host are borrowed.
|
| |
| virtual | ~IJobContext ()=default |
| | Destroy a context after the worker has returned; extensions borrow it.
|
| |
|
| GuiExtensionHost * | host |
| | Borrowed owner; outlives the joined worker.
|
| |
| QUuid | operationId = QUuid::createUuid() |
| | Unique accepted worker identity.
|
| |
| QString | id |
| | Durable crash-marker suffix, matching operationId.
|
| |
| QString | title |
| | Copied progress and recovery caption.
|
| |
| std::atomic< bool > | cancelled {false} |
| | Worker-visible cooperative request.
|
| |
| std::atomic< bool > | finished {false} |
| | True after immutable worker settlement.
|
| |
| QPointer< QProgressDialog > | progress |
| | GUI-only guarded progress widget.
|
| |
| std::mutex | mutex |
| | Linearizes start, cancellation, progress and completion.
|
| |
| bool | posted = false |
| | At most one queued GUI state flush is pending.
|
| |
| bool | entered = false |
| | Actual worker entry, latched under the state mutex.
|
| |
| bool | startedPublished = false |
| | Worker entry has been published on the GUI thread.
|
| |
| bool | cancellationPublished = false |
| | The winning cancellation was observed once.
|
| |
| bool | progressDirty = false |
| | Latest finite progress has not been flushed.
|
| |
| bool | settled = false |
| | Native terminal outcome was latched at worker return.
|
| |
| bool | terminalPublished = false |
| | GUI publication committed the immutable outcome.
|
| |
| double | fraction = 0. |
| | Latest finite normalized worker fraction.
|
| |
| QString | stage |
| | Latest legacy display stage; the registry bounds its public copy.
|
| |
| QString | error |
| | Legacy terminal diagnostic; the registry bounds its public copy.
|
| |
| ProcessPhase | outcome = ProcessPhase::Queued |
| | Latched terminal classification.
|
| |
| QDateTime | startedAt |
| | Worker entry timestamp, copied to the registry.
|
| |
| QDateTime | finishedAt |
| | Worker settlement timestamp, copied to the registry.
|
| |
| std::function< void(bool, const QString &)> | completion |
| | GUI-only user callback.
|
| |
| std::function< void()> | publicationCancellation |
| | Atomic-only private hook, protected by mutex.
|
| |
Host-owned job state shared between its worker and queued GUI continuations.
◆ Job()
| openswmmvis::GuiExtensionHost::Job::Job |
( |
GuiExtensionHost * |
owner, |
|
|
QString |
caption |
|
) |
| |
|
inlineexplicit |
Create retained job state before scheduling its worker.
- Parameters
-
| [in] | owner | Borrowed host that will join the worker before destruction. |
| [in] | caption | Owning user-visible operation title. |
◆ beginWork()
| bool openswmmvis::GuiExtensionHost::Job::beginWork |
( |
| ) |
|
|
inline |
Enter execution unless cancellation won while the worker was queued.
- Returns
- True when the user worker should execute.
◆ cancel()
| void openswmmvis::GuiExtensionHost::Job::cancel |
( |
| ) |
|
|
inlineoverridevirtual |
Request cooperative cancellation.
- Note
- May be called from any thread.
Implements OpenSWMM::Sdk::IJob.
◆ flush()
| void openswmmvis::GuiExtensionHost::Job::flush |
( |
bool |
callbacks = true | ) |
|
|
inline |
Publish one latched state packet; no worker touches widgets or the registry.
- Parameters
-
| [in] | callbacks | False during shutdown: settle metadata/cleanup but suppress user code. |
◆ isCancelled()
| bool openswmmvis::GuiExtensionHost::Job::isCancelled |
( |
| ) |
const |
|
inlineoverridevirtual |
Check cooperative cancellation from a worker.
- Returns
- True after user/host cancellation; check during long operations and before publication.
Implements OpenSWMM::Sdk::IJobContext.
◆ isFinished()
| bool openswmmvis::GuiExtensionHost::Job::isFinished |
( |
| ) |
const |
|
inlineoverridevirtual |
Inspect worker completion.
- Returns
- True once the worker returns, before its GUI continuation necessarily executes.
Implements OpenSWMM::Sdk::IJob.
◆ postFlush()
| void openswmmvis::GuiExtensionHost::Job::postFlush |
( |
| ) |
|
|
inline |
Post the single pending flush after releasing the state mutex.
◆ postToMainThread()
| void openswmmvis::GuiExtensionHost::Job::postToMainThread |
( |
std::function< void()> |
callback | ) |
|
|
inlineoverridevirtual |
Queue a GUI-thread continuation while the host is alive.
- Parameters
-
| [in] | callback | Owning callback; capture data values and guarded QObject pointers. |
- Note
- Queued callbacks are suppressed after shutdown begins.
Implements OpenSWMM::Sdk::IJobContext.
◆ publishCancellation()
| void openswmmvis::GuiExtensionHost::Job::publishCancellation |
( |
| ) |
|
|
inline |
Commit GUI cancellation metadata without invoking a user completion callback.
◆ requestCancellation()
| bool openswmmvis::GuiExtensionHost::Job::requestCancellation |
( |
| ) |
|
|
inline |
Atomically request cancellation before worker settlement.
- Returns
- True for an active accepted/repeated request; false after settlement.
◆ reserveFlush()
| bool openswmmvis::GuiExtensionHost::Job::reserveFlush |
( |
| ) |
|
|
inline |
Reserve a flush while the caller holds mutex.
- Returns
- True when the caller must post one GUI invocation after unlocking.
◆ setProgress()
| void openswmmvis::GuiExtensionHost::Job::setProgress |
( |
double |
fraction, |
|
|
const QString & |
text |
|
) |
| |
|
inlineoverridevirtual |
Queue progress to the host without touching widgets from the worker.
- Parameters
-
| [in] | fraction | Completion fraction clamped to [0,1]. |
| [in] | text | Optional short stage description. |
Implements OpenSWMM::Sdk::IJobContext.
◆ settle()
| void openswmmvis::GuiExtensionHost::Job::settle |
( |
const QString & |
message | ) |
|
|
inline |
Latch outcome at worker return, preventing a later cancel from changing it.
- Parameters
-
| [in] | message | Worker exception detail, empty on normal return. |
◆ cancellationPublished
| bool openswmmvis::GuiExtensionHost::Job::cancellationPublished = false |
The winning cancellation was observed once.
◆ cancelled
| std::atomic<bool> openswmmvis::GuiExtensionHost::Job::cancelled {false} |
Worker-visible cooperative request.
◆ completion
| std::function<void(bool, const QString &)> openswmmvis::GuiExtensionHost::Job::completion |
◆ entered
| bool openswmmvis::GuiExtensionHost::Job::entered = false |
Actual worker entry, latched under the state mutex.
◆ error
| QString openswmmvis::GuiExtensionHost::Job::error |
Legacy terminal diagnostic; the registry bounds its public copy.
◆ finished
| std::atomic<bool> openswmmvis::GuiExtensionHost::Job::finished {false} |
True after immutable worker settlement.
◆ finishedAt
| QDateTime openswmmvis::GuiExtensionHost::Job::finishedAt |
Worker settlement timestamp, copied to the registry.
◆ fraction
| double openswmmvis::GuiExtensionHost::Job::fraction = 0. |
Latest finite normalized worker fraction.
◆ host
Borrowed owner; outlives the joined worker.
◆ id
| QString openswmmvis::GuiExtensionHost::Job::id |
Durable crash-marker suffix, matching operationId.
◆ mutex
| std::mutex openswmmvis::GuiExtensionHost::Job::mutex |
Linearizes start, cancellation, progress and completion.
◆ operationId
| QUuid openswmmvis::GuiExtensionHost::Job::operationId = QUuid::createUuid() |
Unique accepted worker identity.
◆ outcome
| ProcessPhase openswmmvis::GuiExtensionHost::Job::outcome = ProcessPhase::Queued |
Latched terminal classification.
◆ posted
| bool openswmmvis::GuiExtensionHost::Job::posted = false |
At most one queued GUI state flush is pending.
◆ progress
| QPointer<QProgressDialog> openswmmvis::GuiExtensionHost::Job::progress |
GUI-only guarded progress widget.
◆ progressDirty
| bool openswmmvis::GuiExtensionHost::Job::progressDirty = false |
Latest finite progress has not been flushed.
◆ publicationCancellation
| std::function<void()> openswmmvis::GuiExtensionHost::Job::publicationCancellation |
Atomic-only private hook, protected by mutex.
◆ settled
| bool openswmmvis::GuiExtensionHost::Job::settled = false |
Native terminal outcome was latched at worker return.
◆ stage
| QString openswmmvis::GuiExtensionHost::Job::stage |
Latest legacy display stage; the registry bounds its public copy.
◆ startedAt
| QDateTime openswmmvis::GuiExtensionHost::Job::startedAt |
Worker entry timestamp, copied to the registry.
◆ startedPublished
| bool openswmmvis::GuiExtensionHost::Job::startedPublished = false |
Worker entry has been published on the GUI thread.
◆ terminalPublished
| bool openswmmvis::GuiExtensionHost::Job::terminalPublished = false |
GUI publication committed the immutable outcome.
◆ title
| QString openswmmvis::GuiExtensionHost::Job::title |
Copied progress and recovery caption.
The documentation for this struct was generated from the following file: