SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmmvis::ExtensionStateRegistry Class Referencefinal

GUI-thread session registry shared by every plugin host in the application. More...

#include <extensionstateregistry.h>

Inheritance diagram for openswmmvis::ExtensionStateRegistry:
Collaboration diagram for openswmmvis::ExtensionStateRegistry:

Classes

struct  Data
 Private authoritative records retained independently of plugin facades. More...
 

Signals

void sessionRegistered (QObject *owner, const QUuid &sessionId)
 Synchronously attach native facades after authoritative state is available.
 
void stateEventReady (const OpenSWMM::Sdk::StateEvent &event)
 Deliver a copied transition from the ordered GUI-thread drain.
 
void viewEventReady (const OpenSWMM::Sdk::ViewEvent &event)
 Deliver domain metadata in the same globally ordered session/view drain.
 
void activityEventReady (const OpenSWMM::Sdk::ActivityEvent &event)
 Deliver process/UI metadata from the ordered session/view/activity drain.
 
void beforeSave (const OpenSWMM::Sdk::SaveRequest &request)
 Synchronously collect extension state before native persistence starts.
 

Public Member Functions

 ExtensionStateRegistry (QObject *parent=nullptr)
 Construct an independent registry, or the application-owned instance.
 
 ~ExtensionStateRegistry () override
 Discard queued observations and retained operation metadata.
 
QUuid registerSession (QObject *owner, const SessionMetadata &metadata)
 Register one open lifetime, idempotently for an existing owner.
 
QUuid sessionForOwner (QObject *owner) const
 Resolve an already registered owner without creating state.
 
QObject * ownerForSession (const QUuid &sessionId) const
 Resolve the native owner of a live session.
 
OpenSWMM::Sdk::StateSnapshot snapshot () const
 Copy all live states and the committed-publication watermark.
 
OpenSWMM::Sdk::ModelSessionState session (const QUuid &sessionId) const
 Copy one live state without creating it.
 
OpenSWMM::Sdk::ViewSnapshot viewSnapshot (const QUuid &sessionId) const
 Copy tracked view metadata without touching native objects.
 
void refreshViews (const QUuid &sessionId, OpenSWMM::Sdk::ViewSnapshot snapshot)
 Refresh copied view state at a native construction/restoration boundary.
 
void publishView (const QUuid &sessionId, OpenSWMM::Sdk::ViewSnapshot snapshot, OpenSWMM::Sdk::ViewEvent event)
 Commit one domain invalidation and its latest copied view state.
 
bool isDeliverable (const OpenSWMM::Sdk::ViewEvent &event) const
 Recheck a queued domain observation per receiving host.
 
OpenSWMM::Sdk::ActivitySnapshot activitySnapshot (const QUuid &ownerId, const QUuid &windowId) const
 Copy retained window runs, private owner jobs and scoped UI metadata.
 
OpenSWMM::Sdk::ProcessState operation (const QUuid &operationId) const
 Copy a retained attempt without creating state.
 
QUuid beginOperation (OpenSWMM::Sdk::ProcessState state)
 Accept a new uniquely identified attempt in Queued state.
 
void startOperation (const QUuid &operationId, const QDateTime &startedAt={})
 Record native runner/worker start once for a live attempt.
 
void progressOperation (const QUuid &operationId, double fraction, const QString &stage={})
 Commit coalesced normalized progress without accepting nonfinite values.
 
bool requestOperationCancel (const QUuid &operationId)
 Record an idempotent cancellation request before settlement.
 
void finishOperation (const QUuid &operationId, OpenSWMM::Sdk::ProcessPhase outcome, const QString &error={}, int errorCode=0, const QDateTime &finishedAt={})
 Commit exactly one immutable terminal outcome.
 
void retireOperation (const QUuid &operationId)
 Retire completed metadata while preserving its queued outcome history.
 
void refreshActivityUi (const QUuid &ownerId, OpenSWMM::Sdk::UiActivityState state)
 Copy scoped UI state at an explicit registration/backfill boundary.
 
void publishActivityUi (const QUuid &ownerId, OpenSWMM::Sdk::UiActivityState state, OpenSWMM::Sdk::ActivityEvent event)
 Commit copied scoped UI metadata and queue its invalidation.
 
void forgetActivityOwner (const QUuid &ownerId)
 Discard a stopped host's private snapshots and completed job metadata.
 
bool isDeliverable (const OpenSWMM::Sdk::ActivityEvent &event) const
 Recheck nonterminal progress and live UI targets before each receiver.
 
void updateSession (const QUuid &sessionId, const SessionMetadata &metadata, OpenSWMM::Sdk::StateChanges changes=OpenSWMM::Sdk::StateChange::Metadata)
 Update copied native metadata and record a broad invalidation.
 
quint64 beginLoad (const QUuid &sessionId)
 Start a new accepted load generation.
 
void finishLoad (const QUuid &sessionId, quint64 generation, bool ok, const QString &error={})
 Commit a settled readiness/failure outcome only for the current attempt.
 
void beginClosing (const QUuid &sessionId)
 Commit close and make the session unavailable for resolution.
 
void retireSession (const QUuid &sessionId)
 Remove live state before queuing its terminal close record.
 
bool isDeliverable (const OpenSWMM::Sdk::StateEvent &event) const
 Check whether a copied observation still describes a deliverable transition.
 
bool isCurrent (const QUuid &sessionId, QObject *expectedOwner) const
 Check native owner availability after reentrant callbacks.
 
bool isCurrent (const OpenSWMM::Sdk::SaveRequest &request) const
 Check a synchronous save request after potentially reentrant collection.
 
QUuid beginSave (const QList< QUuid > &sessionIds, OpenSWMM::Sdk::SaveKind kind, const QString &targetPath, bool joinExisting, QString *error=nullptr)
 Begin a scoped save or join a compatible outer operation.
 
bool isSaving (const QUuid &sessionId) const
 Inspect whether a scope still owns this session's save.
 
QUuid operationFor (const QUuid &sessionId) const
 Resolve a session's active save correlation identity.
 
void updateSaveTarget (const QUuid &operationId, const QString &targetPath)
 Resolve an outer save destination selected after preparation began.
 
void endSave (const QUuid &operationId, bool ok, const QString &error={})
 Commit one terminal save outcome and release affected sessions.
 

Static Public Member Functions

static ExtensionStateRegistry * instance ()
 Resolve the application-owned registry without recreating it during teardown.
 

Friends

class ExtensionSaveOperation
 

Detailed Description

GUI-thread session registry shared by every plugin host in the application.

Constructor & Destructor Documentation

◆ ExtensionStateRegistry()

openswmmvis::ExtensionStateRegistry::ExtensionStateRegistry ( QObject *  parent = nullptr)
explicit

Construct an independent registry, or the application-owned instance.

Parameters
[in]parentOptional QObject owner on this GUI thread.

◆ ~ExtensionStateRegistry()

openswmmvis::ExtensionStateRegistry::~ExtensionStateRegistry ( )
overridedefault

Discard queued observations and retained operation metadata.

Member Function Documentation

◆ activityEventReady

void openswmmvis::ExtensionStateRegistry::activityEventReady ( const OpenSWMM::Sdk::ActivityEvent &  event)
signal

Deliver process/UI metadata from the ordered session/view/activity drain.

Parameters
[in]eventImmutable owning activity observation.
Here is the caller graph for this function:

◆ activitySnapshot()

ActivitySnapshot openswmmvis::ExtensionStateRegistry::activitySnapshot ( const QUuid &  ownerId,
const QUuid &  windowId 
) const

Copy retained window runs, private owner jobs and scoped UI metadata.

Parameters
[in]ownerIdCalling host lifetime.
[in]windowIdMain-window scope.
Returns
Owning state with the shared publication watermark.

◆ beforeSave

void openswmmvis::ExtensionStateRegistry::beforeSave ( const OpenSWMM::Sdk::SaveRequest &  request)
signal

Synchronously collect extension state before native persistence starts.

Parameters
[in]requestCaptured save identity, revalidated after each observer by the host.
Here is the caller graph for this function:

◆ beginClosing()

void openswmmvis::ExtensionStateRegistry::beginClosing ( const QUuid &  sessionId)

Commit close and make the session unavailable for resolution.

Parameters
[in]sessionIdRegistered open lifetime; repeated calls are inert.
Here is the caller graph for this function:

◆ beginLoad()

quint64 openswmmvis::ExtensionStateRegistry::beginLoad ( const QUuid &  sessionId)

Start a new accepted load generation.

Parameters
[in]sessionIdRegistered session not closing or saving.
Returns
Generation, or zero on refusal.
Here is the call graph for this function:

◆ beginOperation()

QUuid openswmmvis::ExtensionStateRegistry::beginOperation ( OpenSWMM::Sdk::ProcessState  state)

Accept a new uniquely identified attempt in Queued state.

Parameters
[in]stateCaptured ownership/model/window metadata; null operationId generates a UUID.
Returns
Accepted UUID, or null for duplicate/invalid ownership.

◆ beginSave()

QUuid openswmmvis::ExtensionStateRegistry::beginSave ( const QList< QUuid > &  sessionIds,
OpenSWMM::Sdk::SaveKind  kind,
const QString &  targetPath,
bool  joinExisting,
QString *  error = nullptr 
)

Begin a scoped save or join a compatible outer operation.

Parameters
[in]sessionIdsAffected live sessions; duplicate IDs are ignored.
[in]kindOuter save category.
[in]targetPathIntended final destination, retained by joined nested scopes.
[in]joinExistingPermit joining when all sessions share one active operation.
[out]errorOptional refusal/invalidated-collection detail.
Returns
Operation UUID or null on refusal/failure during synchronous collection.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ endSave()

void openswmmvis::ExtensionStateRegistry::endSave ( const QUuid &  operationId,
bool  ok,
const QString &  error = {} 
)

Commit one terminal save outcome and release affected sessions.

Parameters
[in]operationIdCorrelation identity returned by beginSave().
[in]okTrue only after the intended final transaction commits.
[in]errorCopied terminal failure detail, empty on success.
Here is the caller graph for this function:

◆ finishLoad()

void openswmmvis::ExtensionStateRegistry::finishLoad ( const QUuid &  sessionId,
quint64  generation,
bool  ok,
const QString &  error = {} 
)

Commit a settled readiness/failure outcome only for the current attempt.

Parameters
[in]sessionIdRegistered session identity.
[in]generationAccepted load generation returned by beginLoad().
[in]okTrue after the native readiness barrier succeeds.
[in]errorCopied failure diagnostic, empty on success.

◆ finishOperation()

void openswmmvis::ExtensionStateRegistry::finishOperation ( const QUuid &  operationId,
OpenSWMM::Sdk::ProcessPhase  outcome,
const QString &  error = {},
int  errorCode = 0,
const QDateTime &  finishedAt = {} 
)

Commit exactly one immutable terminal outcome.

Parameters
[in]operationIdUnique retained attempt.
[in]outcomeSucceeded, Failed or Cancelled; other phases are ignored.
[in]errorCopied bounded failure/cancellation detail.
[in]errorCodeNative diagnostic code where available.
[in]finishedAtNative settlement timestamp, or invalid to use current UTC time.
Here is the call graph for this function:

◆ forgetActivityOwner()

void openswmmvis::ExtensionStateRegistry::forgetActivityOwner ( const QUuid &  ownerId)

Discard a stopped host's private snapshots and completed job metadata.

Parameters
[in]ownerIdPrivate host lifetime; native shared runs remain.
Here is the call graph for this function:

◆ instance()

ExtensionStateRegistry * openswmmvis::ExtensionStateRegistry::instance ( )
static

Resolve the application-owned registry without recreating it during teardown.

Returns
Borrowed child of QCoreApplication, or null without an active application.
Here is the caller graph for this function:

◆ isCurrent() [1/2]

bool openswmmvis::ExtensionStateRegistry::isCurrent ( const OpenSWMM::Sdk::SaveRequest &  request) const

Check a synchronous save request after potentially reentrant collection.

Parameters
[in]requestCaptured operation/session/load-generation identity.
Returns
True only while that operation still owns the same available generation.
Here is the call graph for this function:

◆ isCurrent() [2/2]

bool openswmmvis::ExtensionStateRegistry::isCurrent ( const QUuid &  sessionId,
QObject *  expectedOwner 
) const

Check native owner availability after reentrant callbacks.

Parameters
[in]sessionIdCaptured open-lifetime identity.
[in]expectedOwnerBorrowed original owner identity; never dereferenced.
Returns
True for the same surviving owner whose session is not closing.
Here is the caller graph for this function:

◆ isDeliverable() [1/3]

bool openswmmvis::ExtensionStateRegistry::isDeliverable ( const OpenSWMM::Sdk::ActivityEvent &  event) const

Recheck nonterminal progress and live UI targets before each receiver.

Parameters
[in]eventCopied activity observation.
Returns
True for current live invalidations or immutable transition/removal history.

◆ isDeliverable() [2/3]

bool openswmmvis::ExtensionStateRegistry::isDeliverable ( const OpenSWMM::Sdk::StateEvent &  event) const

Check whether a copied observation still describes a deliverable transition.

Parameters
[in]eventOwning queued observation.
Returns
False for obsolete live/ready/change generations; terminal history remains valid.
Here is the call graph for this function:

◆ isDeliverable() [3/3]

bool openswmmvis::ExtensionStateRegistry::isDeliverable ( const OpenSWMM::Sdk::ViewEvent &  event) const

Recheck a queued domain observation per receiving host.

Parameters
[in]eventOwning copied observation.
Returns
True for the current ready generation/attachment/source, or its detach history.
Here is the call graph for this function:

◆ isSaving()

bool openswmmvis::ExtensionStateRegistry::isSaving ( const QUuid &  sessionId) const

Inspect whether a scope still owns this session's save.

Parameters
[in]sessionIdOpen-lifetime identity, possibly already retired.
Returns
True until the outer operation ends.
Here is the caller graph for this function:

◆ operation()

ProcessState openswmmvis::ExtensionStateRegistry::operation ( const QUuid &  operationId) const

Copy a retained attempt without creating state.

Parameters
[in]operationIdUnique attempt UUID.
Returns
Copied state, with null operationId when absent.
Here is the caller graph for this function:

◆ operationFor()

QUuid openswmmvis::ExtensionStateRegistry::operationFor ( const QUuid &  sessionId) const

Resolve a session's active save correlation identity.

Parameters
[in]sessionIdOpen-lifetime identity.
Returns
Operation UUID or null.
Here is the caller graph for this function:

◆ ownerForSession()

QObject * openswmmvis::ExtensionStateRegistry::ownerForSession ( const QUuid &  sessionId) const

Resolve the native owner of a live session.

Parameters
[in]sessionIdOpen-lifetime identity.
Returns
Guarded borrowed QObject, or null after removal/destruction.
Here is the caller graph for this function:

◆ progressOperation()

void openswmmvis::ExtensionStateRegistry::progressOperation ( const QUuid &  operationId,
double  fraction,
const QString &  stage = {} 
)

Commit coalesced normalized progress without accepting nonfinite values.

Parameters
[in]operationIdActive unique attempt.
[in]fractionFinite progress, clamped to [0,1].
[in]stageBounded copied display description.
Here is the caller graph for this function:

◆ publishActivityUi()

void openswmmvis::ExtensionStateRegistry::publishActivityUi ( const QUuid &  ownerId,
OpenSWMM::Sdk::UiActivityState  state,
OpenSWMM::Sdk::ActivityEvent  event 
)

Commit copied scoped UI metadata and queue its invalidation.

Parameters
[in]ownerIdOwner whose cached UI snapshot is updated.
[in]stateCurrent copied UI state.
[in]eventUI reason/identity; sequence is assigned here.
Here is the call graph for this function:

◆ publishView()

void openswmmvis::ExtensionStateRegistry::publishView ( const QUuid &  sessionId,
OpenSWMM::Sdk::ViewSnapshot  snapshot,
OpenSWMM::Sdk::ViewEvent  event 
)

Commit one domain invalidation and its latest copied view state.

Parameters
[in]sessionIdRegistered open lifetime.
[in]snapshotNative metadata after the semantic operation.
[in]eventBounded reason/details; session/revision/sequence assigned here.
Here is the call graph for this function:

◆ refreshActivityUi()

void openswmmvis::ExtensionStateRegistry::refreshActivityUi ( const QUuid &  ownerId,
OpenSWMM::Sdk::UiActivityState  state 
)

Copy scoped UI state at an explicit registration/backfill boundary.

Parameters
[in]ownerIdPrivate host lifetime.
[in]stateCopied current UI metadata, with an established window identity.
Here is the caller graph for this function:

◆ refreshViews()

void openswmmvis::ExtensionStateRegistry::refreshViews ( const QUuid &  sessionId,
OpenSWMM::Sdk::ViewSnapshot  snapshot 
)

Refresh copied view state at a native construction/restoration boundary.

Parameters
[in]sessionIdRegistered open lifetime.
[in]snapshotNative copied metadata; supplied session/sequence are ignored.
Note
This boundary does not publish a domain invalidation.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ registerSession()

QUuid openswmmvis::ExtensionStateRegistry::registerSession ( QObject *  owner,
const SessionMetadata &  metadata 
)

Register one open lifetime, idempotently for an existing owner.

Parameters
[in]ownerRequired GUI-thread native QObject, guarded until destruction.
[in]metadataOwning current metadata.
Returns
New session UUID, existing UUID, or null for an unavailable owner.
Note
Stores extensionSessionId on owner before synchronous sessionRegistered().
Here is the call graph for this function:

◆ requestOperationCancel()

bool openswmmvis::ExtensionStateRegistry::requestOperationCancel ( const QUuid &  operationId)

Record an idempotent cancellation request before settlement.

Parameters
[in]operationIdActive retained attempt.
Returns
True for an active accepted/repeated request, false after settlement/retirement.

◆ retireOperation()

void openswmmvis::ExtensionStateRegistry::retireOperation ( const QUuid &  operationId)

Retire completed metadata while preserving its queued outcome history.

Parameters
[in]operationIdRetained terminal attempt; active attempts are not removed.
Here is the caller graph for this function:

◆ retireSession()

void openswmmvis::ExtensionStateRegistry::retireSession ( const QUuid &  sessionId)

Remove live state before queuing its terminal close record.

Parameters
[in]sessionIdRegistered open lifetime; repeated calls are inert.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ session()

ModelSessionState openswmmvis::ExtensionStateRegistry::session ( const QUuid &  sessionId) const

Copy one live state without creating it.

Parameters
[in]sessionIdOpen-lifetime identity.
Returns
State with a null sessionId when absent.
Here is the caller graph for this function:

◆ sessionForOwner()

QUuid openswmmvis::ExtensionStateRegistry::sessionForOwner ( QObject *  owner) const

Resolve an already registered owner without creating state.

Parameters
[in]ownerBorrowed native object identity.
Returns
Session UUID, or null.

◆ sessionRegistered

void openswmmvis::ExtensionStateRegistry::sessionRegistered ( QObject *  owner,
const QUuid &  sessionId 
)
signal

Synchronously attach native facades after authoritative state is available.

Parameters
[in]ownerGuarded native owner whose extensionSessionId is already set.
[in]sessionIdUnique open-lifetime identity.
Here is the caller graph for this function:

◆ snapshot()

StateSnapshot openswmmvis::ExtensionStateRegistry::snapshot ( ) const

Copy all live states and the committed-publication watermark.

Returns
Side-effect-free GUI-thread snapshot.
Here is the caller graph for this function:

◆ startOperation()

void openswmmvis::ExtensionStateRegistry::startOperation ( const QUuid &  operationId,
const QDateTime &  startedAt = {} 
)

Record native runner/worker start once for a live attempt.

Parameters
[in]operationIdUnique retained attempt.
[in]startedAtNative timestamp, or invalid to use current UTC time.

◆ stateEventReady

void openswmmvis::ExtensionStateRegistry::stateEventReady ( const OpenSWMM::Sdk::StateEvent &  event)
signal

Deliver a copied transition from the ordered GUI-thread drain.

Parameters
[in]eventImmutable observation; hosts recheck per receiver before forwarding.
Here is the caller graph for this function:

◆ updateSaveTarget()

void openswmmvis::ExtensionStateRegistry::updateSaveTarget ( const QUuid &  operationId,
const QString &  targetPath 
)

Resolve an outer save destination selected after preparation began.

Parameters
[in]operationIdActive save correlation identity.
[in]targetPathFinal intended destination for the terminal outcome.
Note
Existing immutable SaveStarted records retain their original target.

◆ updateSession()

void openswmmvis::ExtensionStateRegistry::updateSession ( const QUuid &  sessionId,
const SessionMetadata &  metadata,
OpenSWMM::Sdk::StateChanges  changes = OpenSWMM::Sdk::StateChange::Metadata 
)

Update copied native metadata and record a broad invalidation.

Parameters
[in]sessionIdA registered open lifetime.
[in]metadataOwning latest native metadata.
[in]changesInvalidation categories; unchanged metadata alone is suppressed.
Note
Loading updates remain queryable but do not emit intermediate StateChanged.

◆ viewEventReady

void openswmmvis::ExtensionStateRegistry::viewEventReady ( const OpenSWMM::Sdk::ViewEvent &  event)
signal

Deliver domain metadata in the same globally ordered session/view drain.

Parameters
[in]eventCopied native view invalidation.
Here is the caller graph for this function:

◆ viewSnapshot()

ViewSnapshot openswmmvis::ExtensionStateRegistry::viewSnapshot ( const QUuid &  sessionId) const

Copy tracked view metadata without touching native objects.

Parameters
[in]sessionIdRegistered open lifetime.
Returns
Current copied state/watermark, or a null-session snapshot.
Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ ExtensionSaveOperation

friend class ExtensionSaveOperation
friend

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