OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
RuntimeWaterDriverCheckpoint.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2
11
12#pragma once
13#include <cstdint>
14#include <memory>
15#include <string>
16
17namespace openswmm::twoD {
21public:
22 struct Snapshot {
23 uint64_t next_sequence = 0;
24 double next_update_seconds = -1; // -1 means exhausted; otherwise elapsed seconds
25 std::string state; // driver schema, cursor, pending updates and mutable state
26 };
28 public:
36 virtual ~PreparedRestore() = default;
48 virtual void install() noexcept = 0;
49 };
50
56 virtual ~RuntimeWaterDriverCheckpoint() = default;
67 virtual std::string identity() const = 0;
75 virtual double nextUpdateSeconds() const noexcept = 0;
90 virtual Snapshot capture(double completed_seconds) const = 0;
111 virtual std::unique_ptr<PreparedRestore> prepareRestore(const Snapshot&,
112 double completed_seconds) const = 0;
113};
114}
Definition RuntimeWaterDriverCheckpoint.hpp:27
virtual ~PreparedRestore()=default
Destroy a prepared adoption plan without changing any live driver or engine state.
virtual void install() noexcept=0
Only nonthrowing in-memory adoption; no IO, callbacks or engine updates.
Definition RuntimeWaterDriverCheckpoint.hpp:20
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...
virtual std::string identity() const =0
Exact immutable software/schema/input/mapping identity, matching the common stage's replay identity....
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.
Definition ExchangeLaw.hpp:60
Definition RuntimeWaterDriverCheckpoint.hpp:22
uint64_t next_sequence
Definition RuntimeWaterDriverCheckpoint.hpp:23
double next_update_seconds
Definition RuntimeWaterDriverCheckpoint.hpp:24
std::string state
Definition RuntimeWaterDriverCheckpoint.hpp:25