OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches

Solver-neutral hooks for reading and writing solver-internal state (infiltration, groundwater) at hot-start save/load time. More...

#include <SimulationContext.hpp>

Collaboration diagram for openswmm::StateAccessors:

Public Member Functions

bool can_read () const noexcept
 True iff the read-side accessors are wired.
 
bool can_write () const noexcept
 True iff the write-side accessors are wired.
 

Public Attributes

std::function< bool(int subcatch_index, int &out_model, double *out_infil)> get_infil_state
 
std::function< bool(int subcatch_index, int model, const double *infil)> set_infil_state
 
std::function< bool(int subcatch_index, double &out_theta, double &out_lower_depth)> get_gw_state
 Read groundwater zone state (upper-zone moisture and lower-zone depth).
 
std::function< bool(int subcatch_index, double theta, double lower_depth)> set_gw_state
 Apply groundwater zone state to a subcatchment.
 

Detailed Description

Solver-neutral hooks for reading and writing solver-internal state (infiltration, groundwater) at hot-start save/load time.

The state-IO plugin layer intentionally does not depend on runoff::RunoffSolver or groundwater::GWSolver types — those are implementation details of the engine. SWMMEngine wires the engine's live solvers into these callbacks at open() time so plugins can read/write per-subcatchment state through SimulationContext alone.

Each callback returns true if it handled the call, false if no handler is wired (in which case the caller may choose to fall back to default values or skip that part of the snapshot).

Member Function Documentation

◆ can_read()

bool openswmm::StateAccessors::can_read ( ) const
inlinenoexcept

True iff the read-side accessors are wired.

Here is the caller graph for this function:

◆ can_write()

bool openswmm::StateAccessors::can_write ( ) const
inlinenoexcept

True iff the write-side accessors are wired.

Here is the caller graph for this function:

Member Data Documentation

◆ get_gw_state

std::function<bool(int subcatch_index, double& out_theta, double& out_lower_depth)> openswmm::StateAccessors::get_gw_state

Read groundwater zone state (upper-zone moisture and lower-zone depth).

◆ get_infil_state

std::function<bool(int subcatch_index, int& out_model, double* out_infil)> openswmm::StateAccessors::get_infil_state

Read infiltration model id and the 6-double infiltration state into the caller-provided buffers. out_infil must point to a 6-element array.

◆ set_gw_state

std::function<bool(int subcatch_index, double theta, double lower_depth)> openswmm::StateAccessors::set_gw_state

Apply groundwater zone state to a subcatchment.

◆ set_infil_state

std::function<bool(int subcatch_index, int model, const double* infil)> openswmm::StateAccessors::set_infil_state

Apply infiltration state to a subcatchment. infil must point to a 6-element array.


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