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

Every [GW_*] authoring row of one model. More...

#include <GwTransportData.hpp>

Collaboration diagram for openswmm::twoD::GwTransportData:

Public Member Functions

bool empty () const noexcept
 Test whether any groundwater transport section was authored or has rows.
 
void clear ()
 Replace all groundwater transport authoring state with default empty data.
 
void invalidateAuthoringIndexes () noexcept
 Mark source/initial-quality name indexes stale after direct key edits.
 
std::size_t findSource (const std::string &name)
 Resolve the first exact named groundwater source with lazy index rebuild.
 
std::size_t findInitialQuality (const GwInitialQualityRow &row)
 Resolve the first complete initial-quality row key using a lazy cache.
 
void sourceAppended ()
 Incrementally extend a valid sources authoring index after one append.
 
void initialQualityAppended ()
 Incrementally extend a valid initial_quality authoring index after one append.
 
void removeSource (std::size_t index)
 Erase one sources row while maintaining or invalidating its lookup cache.
 
void removeInitialQuality (std::size_t index)
 Erase one initial_quality row while maintaining or invalidating its lookup cache.
 

Public Attributes

GwTransportOptions options
 
std::vector< GwParamsRow > params
 
std::vector< GwSorptionRow > sorption
 
std::vector< GwInitialQualityRow > initial_quality
 
std::string initial_quality_file
 [GW_INITIAL_QUALITY] FILE <csv> (element,zone,species,value).
 
std::vector< GwBoundaryQualityRow > boundary_quality
 
std::vector< GwSourceRow > sources
 

Static Public Attributes

static constexpr std::size_t noRow = std::numeric_limits<std::size_t>::max()
 

Detailed Description

Every [GW_*] authoring row of one model.

Owned by SurfaceRouter2D (the 2D module's data home) and reached through SimulationContext::twod_io.gw so the writer, the C API and the GeoPackage path can read it without depending on the router.

Member Function Documentation

◆ clear()

void openswmm::twoD::GwTransportData::clear ( )
inline

Replace all groundwater transport authoring state with default empty data.

Postcondition
Resets options, rows, file path and derived index caches. All borrowed row/string references and indices become invalid; requires exclusive authoring access.

◆ empty()

bool openswmm::twoD::GwTransportData::empty ( ) const
inlinenoexcept

Test whether any groundwater transport section was authored or has rows.

Returns
True only when authored is false and every row/path collection is empty. Default process-option values alone do not make this nonempty; read-only and allocation-free.
Here is the caller graph for this function:

◆ findInitialQuality()

std::size_t openswmm::twoD::GwTransportData::findInitialQuality ( const GwInitialQualityRow & row)
inline

Resolve the first complete initial-quality row key using a lazy cache.

Parameters
[in]rowBorrowed lookup key: scope, tag, cell, zone, layer and species; value is ignored.
Returns
First exact matching index, or noRow when absent.
Postcondition
Rebuilds when the row-count marker is stale; same-size key edits require invalidation. Keys copy strings into the cache and allocations may throw. Requires exclusive cache/authoring access; no row values are changed.

◆ findSource()

std::size_t openswmm::twoD::GwTransportData::findSource ( const std::string & name)
inline

Resolve the first exact named groundwater source with lazy index rebuild.

Parameters
[in]nameBorrowed case-sensitive source identifier, not retained by the lookup.
Returns
First matching sources index, or noRow when absent; duplicate names retain the first indexed position.
Postcondition
Rebuilds source_index_ when the stored size marker differs from sources.size(). Same-size direct key edits require explicit invalidation.
Note
May allocate/throw during rebuild, leaving the marker stale for retry. Serializes with authoring mutations; no runtime model initialization or unit conversion.

◆ initialQualityAppended()

void openswmm::twoD::GwTransportData::initialQualityAppended ( )
inline

Incrementally extend a valid initial_quality authoring index after one append.

Precondition
Exactly one row was appended; existing cached keys/positions have not otherwise changed.
Postcondition
Updates a previously valid size marker/map when its old count is exactly initial_quality.size()-1; otherwise leaves the cache for later lazy rebuild. Duplicate keys preserve the earlier match.
Note
String/hash allocation may throw. Requires exclusive authoring access; does not append the actual row or publish runtime state.

◆ invalidateAuthoringIndexes()

void openswmm::twoD::GwTransportData::invalidateAuthoringIndexes ( )
inlinenoexcept

Mark source/initial-quality name indexes stale after direct key edits.

Postcondition
Leaves allocated maps in place but sets their size markers to noRow; next lookup rebuilds. Required after same-size direct key replacement, since size checks cannot detect changed names. No allocation; requires exclusive access.
Here is the caller graph for this function:

◆ removeInitialQuality()

void openswmm::twoD::GwTransportData::removeInitialQuality ( std::size_t index)
inline

Erase one initial_quality row while maintaining or invalidating its lookup cache.

Parameters
[in]indexValid zero-based row offset in initial_quality; no bounds check.
Postcondition
Removes the row and shifts later rows. A valid last-row cache is adjusted incrementally; other removals mark it stale. Borrowed row references/indices may be invalidated.
Note
Requires exclusive authoring access. No runtime-state rebuild, name validation, or unit conversion. String-key construction for quality removal can allocate/throw.

◆ removeSource()

void openswmm::twoD::GwTransportData::removeSource ( std::size_t index)
inline

Erase one sources row while maintaining or invalidating its lookup cache.

Parameters
[in]indexValid zero-based row offset in sources; no bounds check.
Postcondition
Removes the row and shifts later rows. A valid last-row cache is adjusted incrementally; other removals mark it stale. Borrowed row references/indices may be invalidated.
Note
Requires exclusive authoring access. No runtime-state rebuild, name validation, or unit conversion. String-key construction for quality removal can allocate/throw.

◆ sourceAppended()

void openswmm::twoD::GwTransportData::sourceAppended ( )
inline

Incrementally extend a valid sources authoring index after one append.

Precondition
Exactly one row was appended; existing cached keys/positions have not otherwise changed.
Postcondition
Updates a previously valid size marker/map when its old count is exactly sources.size()-1; otherwise leaves the cache for later lazy rebuild. Duplicate keys preserve the earlier match.
Note
String/hash allocation may throw. Requires exclusive authoring access; does not append the actual row or publish runtime state.

Member Data Documentation

◆ boundary_quality

std::vector<GwBoundaryQualityRow> openswmm::twoD::GwTransportData::boundary_quality

◆ initial_quality

std::vector<GwInitialQualityRow> openswmm::twoD::GwTransportData::initial_quality

◆ initial_quality_file

std::string openswmm::twoD::GwTransportData::initial_quality_file

[GW_INITIAL_QUALITY] FILE <csv> (element,zone,species,value).

◆ noRow

std::size_t openswmm::twoD::GwTransportData::noRow = std::numeric_limits<std::size_t>::max()
staticconstexpr

◆ options

GwTransportOptions openswmm::twoD::GwTransportData::options

◆ params

std::vector<GwParamsRow> openswmm::twoD::GwTransportData::params

◆ sorption

std::vector<GwSorptionRow> openswmm::twoD::GwTransportData::sorption

◆ sources

std::vector<GwSourceRow> openswmm::twoD::GwTransportData::sources

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