OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::twoD::RuntimeWaterDriverCheckpoint Class Referenceabstract

#include <RuntimeWaterDriverCheckpoint.hpp>

Collaboration diagram for openswmm::twoD::RuntimeWaterDriverCheckpoint:

Classes

class  PreparedRestore
 
struct  Snapshot
 

Public Member Functions

virtual ~RuntimeWaterDriverCheckpoint ()=default
 Destroy the synchronous driver participant through its base interface.
 
virtual std::string identity () const =0
 Exact immutable software/schema/input/mapping identity, matching the common stage's replay identity. Include every driver affecting this run.
 
virtual double nextUpdateSeconds () const noexcept=0
 Report the next scheduled update on the engine's elapsed-second axis.
 
virtual Snapshot capture (double completed_seconds) const =0
 Called between accepted steps. Must not mutate or advance the driver.
 
virtual std::unique_ptr< PreparedRestore > prepareRestore (const Snapshot &, double completed_seconds) const =0
 Validate the entire snapshot, cursor and pending schedule on private state, without changing the live driver or engine. Reject unsupported external state. A valid plan must adopt exactly the supplied snapshot; destroying an unused plan must leave all live state unchanged.
 

Detailed Description

Internal, synchronous water-driver restart participant. The caller retains this object through engine close. No public plugin ABI or remote recovery.

Constructor & Destructor Documentation

◆ ~RuntimeWaterDriverCheckpoint()

virtual openswmm::twoD::RuntimeWaterDriverCheckpoint::~RuntimeWaterDriverCheckpoint ( )
virtualdefault

Destroy the synchronous driver participant through its base interface.

Note
The caller retains the participant until engine close, including all capture/restore callbacks. No implicit engine deregistration or close is performed by this default destructor.

Member Function Documentation

◆ capture()

virtual Snapshot openswmm::twoD::RuntimeWaterDriverCheckpoint::capture ( double completed_seconds) const
pure virtual

Called between accepted steps. Must not mutate or advance the driver.

Copy a synchronous driver snapshot at an accepted engine boundary.

Parameters
[in]completed_secondsAccepted elapsed simulation time s at which the driver is quiescent.
Returns
Owned snapshot containing next sequence number, next update seconds (-1 if exhausted) and a complete serialized mutable driver state including schema, cursor and pending updates.
Note
Called between accepted engine steps. Must neither mutate nor advance the driver or engine; implementations may reject unsupported external state by exception. No pointer to the returned state may depend on transient callback storage. Identity is carried separately by identity().
Here is the call graph for this function:
Here is the caller graph for this function:

◆ identity()

virtual std::string openswmm::twoD::RuntimeWaterDriverCheckpoint::identity ( ) const
pure virtual

Exact immutable software/schema/input/mapping identity, matching the common stage's replay identity. Include every driver affecting this run.

Return the exact immutable identity of every driver affecting this run.

Returns
Owned identity string covering software/schema, inputs and mapping. It must match the common source stage replay identity and remain stable across capture and restoration.
Note
This identifies compatibility, not mutable cursor state. Implementations may allocate; callers keep the participant alive and stable for the synchronous call.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ nextUpdateSeconds()

virtual double openswmm::twoD::RuntimeWaterDriverCheckpoint::nextUpdateSeconds ( ) const
pure virtualnoexcept

Report the next scheduled update on the engine's elapsed-second axis.

Returns
Next nonnegative elapsed simulation time s, or -1 when the update schedule is exhausted, consistent with Snapshot::next_update_seconds and the captured driver cursor.
Note
This read-only query must not advance the driver and must not throw. No calendar-date conversion or schedule execution belongs here.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ prepareRestore()

virtual std::unique_ptr< PreparedRestore > openswmm::twoD::RuntimeWaterDriverCheckpoint::prepareRestore ( const Snapshot & ,
double completed_seconds ) const
pure virtual

Validate the entire snapshot, cursor and pending schedule on private state, without changing the live driver or engine. Reject unsupported external state. A valid plan must adopt exactly the supplied snapshot; destroying an unused plan must leave all live state unchanged.

Validate a complete saved driver state and stage its private in-memory replacement.

Parameters
[in]completed_secondsRestored accepted elapsed simulation boundary s, against which saved cursor and pending schedule must be checked. The first unnamed argument is the immutable snapshot containing exact next sequence/update metadata and the encoded driver state.
Returns
Owned PreparedRestore plan whose install() adopts exactly that snapshot, with no live mutation during preparation or unused-plan destruction. An implementation must reject invalid snapshots or unsupported external state; null is not a usable adoption plan.
Note
Validate software/schema/input/mapping compatibility, the full cursor and pending schedule before returning. Preparation may allocate or throw; it must not call engine updates or advance the live driver. The participant must remain alive until the plan is installed or abandoned.
Here is the call graph for this function:
Here is the caller graph for this function:

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