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

#include <RuntimeCouplingCheckpoint.hpp>

Collaboration diagram for openswmm::twoD::RuntimeWaterCheckpoint:

Static Public Member Functions

static std::string validate (const RuntimeWaterCheckpointBinding &, const RuntimeSources &surface, const RuntimeSources &groundwater, const RuntimeForcings &, const BoundaryData *boundary=nullptr, bool completed_boundary=true)
 Check copied water prescriptions against exact accepted model/receiver/time metadata.
 
static std::string capture (const RuntimeWaterCheckpointBinding &, const RuntimeSources &surface, const RuntimeSources &groundwater, const RuntimeForcings &, std::string &bytes, const BoundaryData *boundary=nullptr)
 Encode a fully validated completed copied-water prescription snapshot.
 
static std::string restore (const RuntimeWaterCheckpointBinding &, std::string bytes, RuntimeSources &surface, RuntimeSources &groundwater, RuntimeForcings &, BoundaryData *boundary=nullptr)
 Validate and atomically replace copied prescription stores against a matching prepared model.
 
static std::string boundaryModel (const BoundaryData &, const TableData *tables=nullptr)
 Encode exact authored fallback descriptors and referenced in-memory signal identity.
 

Detailed Description

Same-platform water-only snapshot: both source domains and rain/ET/paired infiltration. Cleared/expired records retain their receipts. Derived lookup tables are rebuilt, never serialized. Failure preserves every output.

Member Function Documentation

◆ boundaryModel()

std::string openswmm::twoD::RuntimeWaterCheckpoint::boundaryModel ( const BoundaryData & b,
const TableData * tables = nullptr )
static

Encode exact authored fallback descriptors and referenced in-memory signal identity.

Arguments
  • unnamed binding/model argument (b) (in): Stable authored boundary model, with consistent descriptor-array extents.
  • tables (in): Optional stable model table owner, required for any series/curve reference.
Returns
Owned binary identity: descriptor arrays plus unique referenced table IDs/types/records, relative-time anchoring and column metadata. Table lookup cursors/runtime receipts are excluded.
Exceptions
std::runtime_errorOn invalid referenced signal or archive failure; checked slot access can throw std::out_of_range and allocation errors propagate. No tables/model arrays are changed.
Note
Constant/wall-only model encoding retains its older descriptor-only identity. References must be finite single-column in-memory data; external file-backed signals are not qualified.
Parameters
[in]bStable authored boundary model, with consistent descriptor-array extents.
[in]tablesOptional stable model table owner, required for any series/curve reference.
Returns
Owned binary identity: descriptor arrays plus unique referenced table IDs/types/records, relative-time anchoring and column metadata. Table lookup cursors/runtime receipts are excluded.
Exceptions
std::runtime_errorOn invalid referenced signal or archive failure; checked slot access can throw std::out_of_range and allocation errors propagate. No tables/model arrays are changed.
Note
Constant/wall-only model encoding retains its older descriptor-only identity. References must be finite single-column in-memory data; external file-backed signals are not qualified.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ capture()

std::string openswmm::twoD::RuntimeWaterCheckpoint::capture ( const RuntimeWaterCheckpointBinding & b,
const RuntimeSources & surface,
const RuntimeSources & groundwater,
const RuntimeForcings & forcing,
std::string & bytes,
const BoundaryData * boundary = nullptr )
static

Encode a fully validated completed copied-water prescription snapshot.

Arguments
  • unnamed binding/model argument (b) (in): Exact immutable model/driver/receiver/time binding.
  • surface (in): Stable surface store, distinct from groundwater.
  • groundwater (in): Stable groundwater store, including qualified boundary records when enabled.
  • forcing (in): Stable rain/ET/paired-infiltration store.
  • bytes (out): Swapped only after successful complete encoding and <=64 MiB size check; unchanged on reported failure.
  • boundary (in): Live hydraulic boundary state, required exactly for nonempty boundary slots.
Returns
Empty on capture, otherwise validation/archive/size or caught standard-exception diagnostic.
Note
Saves rows and receipts including disabled/expired history, not derived lookup maps. Envelope binds version 1/2, native int/double widths/endian, identity, receiver mask, exact completed time, optional authored boundary model and CRC-32. Inputs/physics remain unchanged; external driver programs, heat/species and external signal files are outside this profile.
Parameters
[in]bExact immutable model/driver/receiver/time binding.
[in]surfaceStable surface store, distinct from groundwater.
[in]groundwaterStable groundwater store, including qualified boundary records when enabled.
[in]forcingStable rain/ET/paired-infiltration store.
[out]bytesSwapped only after successful complete encoding and <=64 MiB size check; unchanged on reported failure.
[in]boundaryLive hydraulic boundary state, required exactly for nonempty boundary slots.
Returns
Empty on capture, otherwise validation/archive/size or caught standard-exception diagnostic.
Note
Saves rows and receipts including disabled/expired history, not derived lookup maps. Envelope binds version 1/2, native int/double widths/endian, identity, receiver mask, exact completed time, optional authored boundary model and CRC-32. Inputs/physics remain unchanged; external driver programs, heat/species and external signal files are outside this profile.
Here is the call graph for this function:

◆ restore()

std::string openswmm::twoD::RuntimeWaterCheckpoint::restore ( const RuntimeWaterCheckpointBinding & b,
std::string bytes,
RuntimeSources & surface,
RuntimeSources & groundwater,
RuntimeForcings & forcing,
BoundaryData * boundary = nullptr )
static

Validate and atomically replace copied prescription stores against a matching prepared model.

Arguments
  • unnamed binding/model argument (b) (in): Immutable model/driver/receiver/time binding and optional authored boundary/tables.
  • bytes (in): Owned <=64 MiB snapshot; exact profile/platform/model/masks/time/CRC and framing must match. Malformed/empty input is rejected by archive decoding.
  • surface (out): Replaced only after all private decoding and validation succeeds; must be a distinct source object from groundwater.
  • groundwater (out): Replaced on success with rebuilt source lookup/receipt state.
  • forcing (out): Replaced on success with reconstructed effective forcing lookups.
  • boundary (out): Mutable target required exactly when boundary slots exist; seeded privately from authored model and replaced on success. Without that profile it must be null.
Returns
Empty after no-throw moves publish every target; otherwise diagnostic or caught standard exception, with targets unchanged. No external program, physical water/solver state or table cursor is restored. Disabled prescription histories/receipts are preserved.
Note
Caller excludes all target/model mutation during validation/publication and keeps immutable fallback model data separate from mutable runtime ownership. No thread synchronization occurs.
Parameters
[in]bImmutable model/driver/receiver/time binding and optional authored boundary/tables.
[in]bytesOwned <=64 MiB snapshot; exact profile/platform/model/masks/time/CRC and framing must match. Malformed/empty input is rejected by archive decoding.
[out]surfaceReplaced only after all private decoding and validation succeeds; must be a distinct source object from groundwater.
[out]groundwaterReplaced on success with rebuilt source lookup/receipt state.
[out]forcingReplaced on success with reconstructed effective forcing lookups.
[out]boundaryMutable target required exactly when boundary slots exist; seeded privately from authored model and replaced on success. Without that profile it must be null.
Returns
Empty after no-throw moves publish every target; otherwise diagnostic or caught standard exception, with targets unchanged. No external program, physical water/solver state or table cursor is restored. Disabled prescription histories/receipts are preserved.
Note
Caller excludes all target/model mutation during validation/publication and keeps immutable fallback model data separate from mutable runtime ownership. No thread synchronization occurs.
Here is the call graph for this function:

◆ validate()

std::string openswmm::twoD::RuntimeWaterCheckpoint::validate ( const RuntimeWaterCheckpointBinding & b,
const RuntimeSources & surface,
const RuntimeSources & groundwater,
const RuntimeForcings & forcing,
const BoundaryData * boundary = nullptr,
bool completed_boundary = true )
static

Check copied water prescriptions against exact accepted model/receiver/time metadata.

Arguments
  • unnamed binding/model argument (b) (in): Stable model/driver identity, active-GW/exterior masks and completed elapsed s.
  • surface (in): Stable surface source store, a distinct object from groundwater.
  • groundwater (in): Stable groundwater source store.
  • forcing (in): Stable rain/ET/paired-infiltration prescription store.
  • boundary (in): Optional stable current boundary, required exactly when b has boundary slots.
  • completed_boundary (in): True checks completed boundary cumulative flux/receipts; false defers only those boundary checks during in-progress stage accounting.
Returns
Empty for a valid privately copied/rebuilt candidate, otherwise first validation or caught standard-exception diagnostic. Every input remains unchanged; no expiry/physics is applied.
Note
This internal same-platform profile excludes heat/species prescriptions and file-backed boundary signals. Caller supplies synchronization and borrowed model/table lifetime.
Parameters
[in]bStable model/driver identity, active-GW/exterior masks and completed elapsed s.
[in]surfaceStable surface source store, a distinct object from groundwater.
[in]groundwaterStable groundwater source store.
[in]forcingStable rain/ET/paired-infiltration prescription store.
[in]boundaryOptional stable current boundary, required exactly when b has boundary slots.
[in]completed_boundaryTrue checks completed boundary cumulative flux/receipts; false defers only those boundary checks during in-progress stage accounting.
Returns
Empty for a valid privately copied/rebuilt candidate, otherwise first validation or caught standard-exception diagnostic. Every input remains unchanged; no expiry/physics is applied.
Note
This internal same-platform profile excludes heat/species prescriptions and file-backed boundary signals. Caller supplies synchronization and borrowed model/table lifetime.
Here is the caller graph for this function:

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