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

#include <SourceResultHistory.hpp>

Collaboration diagram for openswmm::twoD::SourceResultHistory:

Public Member Functions

std::string append (const CommonSourceStage &)
 Capture frame zero or the next accepted source interval with transactional history publication.
 
std::string resume (const CommonSourceStage &)
 Rebind only an exact component-checkpoint match and verified final diagnostic projection. Does not restore any hydraulic engine state.
 
const std::map< std::string, SourceResultTable > & tables () const
 Borrow this history's columnar tables and their field/unit schemas.
 
const std::vector< std::string > & sourceNames () const
 Borrow this history's saved source names indexed by source identifiers.
 
const std::vector< std::string > & pollutantNames () const
 Borrow this history's saved pollutant names indexed by species identifiers.
 
const std::vector< std::string > & pollutantMassUnits () const
 Borrow this history's saved per-pollutant native_concentration*m3 unit labels.
 
bool outfallReturnsAvailable () const
 Optional water-only hydraulic-return diagnostics. Older histories and profile-off runs have no such capability; absence is not a zero series.
 
std::string save (const std::string &path) const
 Standalone HDF5 result artifact; atomically replaces ONLY this artifact. Never pass an existing hydraulic results/model file as the destination.
 

Static Public Member Functions

static std::string read (const std::string &path, SourceResultHistory &out, bool &available)
 An older HDF5 file without /source_history is successfully unavailable. Failure/unavailability preserve out. Append requires explicit verified resume.
 

Friends

struct SourceResultFile
 
struct EngineSourceResultFile
 
class EngineSourceResultHistory
 
class EngineSourceResultStream
 
class Default2DOutputPlugin
 
class ExplicitInertialSolver
 

Detailed Description

Internal R4 qualification recorder: explicitly capture the initial boundary and EVERY accepted source interval. Capture failure changes neither physics nor history. Receiver clocks and pending queues are endpoint snapshots. Optional marcher/writer hooks remain behind the reviewed runtime gate. Paired engine continuation uses EngineSourceResultHistory; production streaming remains unqualified.

Member Function Documentation

◆ append()

std::string openswmm::twoD::SourceResultHistory::append ( const CommonSourceStage & stage)

Capture frame zero or the next accepted source interval with transactional history publication.

Capture initial state and each accepted source interval exactly once.

Argument The unnamed stage reference must be a stable prepared checkpoint-capable
source stage; after first capture its exact address/model must match. Its dependencies remain borrowed and must live through future recorder use. Capture does not advance physics.
Returns
Empty on validated publication, otherwise a diagnostic with history unchanged. Requires initial interval/end zero and then each strictly increasing accepted interval exactly once. Stores cumulative SI water/native pollutant receipts and an exact component checkpoint anchor.
Parameters
[in]stageStable prepared completed-boundary stage. After initial attachment, the exact same stage address and frozen model must be supplied; it must outlive subsequent recorder calls.
Returns
Empty after publishing a fully validated append; diagnostic on checkpoint/model, identity, interval ordering or validation refusal, or a caught standard exception. History and physics remain unchanged on failure. Nonstandard exceptions are not translated.
Note
Frame zero requires interval count/end zero; later captures require one more accepted interval and strictly increasing elapsed end seconds. Stores an exact component checkpoint anchor. History capture is synchronous and requires exclusive recorder access; source physics is read-only.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ outfallReturnsAvailable()

bool openswmm::twoD::SourceResultHistory::outfallReturnsAvailable ( ) const
inline

Optional water-only hydraulic-return diagnostics. Older histories and profile-off runs have no such capability; absence is not a zero series.

Test the saved water-only hydraulic-return capability.

Returns
True when optional return columns/clocks are part of this history's schema. False means unavailable, including old/profile-off histories; it must not be interpreted as a zero series.

◆ pollutantMassUnits()

const std::vector< std::string > & openswmm::twoD::SourceResultHistory::pollutantMassUnits ( ) const
inline

Borrow this history's saved per-pollutant native_concentration*m3 unit labels.

Returns
Const reference owned by this recorder; valid until its destruction or replacement. append(), resume(), read() publication or assignment may invalidate elements/references. No copy, allocation or synchronization occurs; keep the recorder stable while accessing the view.

◆ pollutantNames()

const std::vector< std::string > & openswmm::twoD::SourceResultHistory::pollutantNames ( ) const
inline

Borrow this history's saved pollutant names indexed by species identifiers.

Returns
Const reference owned by this recorder; valid until its destruction or replacement. append(), resume(), read() publication or assignment may invalidate elements/references. No copy, allocation or synchronization occurs; keep the recorder stable while accessing the view.

◆ read()

std::string openswmm::twoD::SourceResultHistory::read ( const std::string & path,
SourceResultHistory & out,
bool & available )
static

An older HDF5 file without /source_history is successfully unavailable. Failure/unavailability preserve out. Append requires explicit verified resume.

Parameters
[in]pathExisting nonempty HDF5 file, at most 256 MiB. Missing source_history is a successful unavailable result; unfinished publication links are rejected.
[out]outReplaced only after full schema/metadata/shape/identity/receipt validation; remains unchanged on failure or unavailable capability. Returned history needs explicit resume() to append.
[out]availableSet false immediately; true only when a validated history replaces out.
Returns
Empty on success (including unavailable group), otherwise validation/I/O/unsupported-build diagnostic. Older accepted source schemas are supported subject to exact metadata checks.
Note
Uses the engine HDF5 mutex; out must remain exclusively accessible during publication.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resume()

std::string openswmm::twoD::SourceResultHistory::resume ( const CommonSourceStage & stage)

Rebind only an exact component-checkpoint match and verified final diagnostic projection. Does not restore any hydraulic engine state.

Bind saved history to an exactly matching restored component checkpoint and diagnostics.

Argument and result The unnamed stage reference is a stable restored
checkpoint-capable stage. Returns empty only after exact checkpoint bytes, capability, final clocks, identities, ownership and reprojected numeric diagnostics match. Failure preserves this history and all physics. Success binds a borrowed live stage pointer for later append(); this does not install any component or engine state.
Parameters
[in]stageStable restored checkpoint-capable stage; its borrowed dependencies must remain alive through later captures. No hydraulic engine state is restored by this method.
Returns
Empty after validating saved history, exact checkpoint bytes/capability/clocks/identities, reprojecting the final frame and publishing the new live binding. Otherwise a diagnostic, with this history and stage unchanged; caught standard exceptions become diagnostics.
Note
The final projection must reproduce every saved numeric column exactly. Work uses private copies; future append() resumes after the existing final frame rather than duplicating it. Whole-engine continuation must use the containing EngineSourceResultHistory instead.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ save()

std::string openswmm::twoD::SourceResultHistory::save ( const std::string & path) const

Standalone HDF5 result artifact; atomically replaces ONLY this artifact. Never pass an existing hydraulic results/model file as the destination.

Parameters
[in]pathStandalone destination. An existing file must identify itself as a source history artifact; hydraulic/model files are rejected. Parent directory must already exist.
Returns
Empty on success, otherwise validation/I/O/unsupported-build diagnostic. Validated data is written to an exclusively created sibling, flushed/closed, then renamed into place. Temporary publication files are removed on caught failure; an exclusive-create collision is never deleted.
Note
Serializes calls through the engine HDF5 mutex. Same-path writers still require caller coordination. Filesystem rename publication supplies no power-loss/durability guarantee.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sourceNames()

const std::vector< std::string > & openswmm::twoD::SourceResultHistory::sourceNames ( ) const
inline

Borrow this history's saved source names indexed by source identifiers.

Returns
Const reference owned by this recorder; valid until its destruction or replacement. append(), resume(), read() publication or assignment may invalidate elements/references. No copy, allocation or synchronization occurs; keep the recorder stable while accessing the view.

◆ tables()

const std::map< std::string, SourceResultTable > & openswmm::twoD::SourceResultHistory::tables ( ) const
inline

Borrow this history's columnar tables and their field/unit schemas.

Returns
Const reference owned by this recorder; valid until its destruction or replacement. append(), resume(), read() publication or assignment may invalidate elements/references. No copy, allocation or synchronization occurs; keep the recorder stable while accessing the view.
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ Default2DOutputPlugin

friend class Default2DOutputPlugin
friend

◆ EngineSourceResultFile

friend struct EngineSourceResultFile
friend

◆ EngineSourceResultHistory

friend class EngineSourceResultHistory
friend

◆ EngineSourceResultStream

friend class EngineSourceResultStream
friend

◆ ExplicitInertialSolver

friend class ExplicitInertialSolver
friend

◆ SourceResultFile

friend struct SourceResultFile
friend

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