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

Classes

class  CompletedSourceArchive
 

Functions

locale_t c_locale () noexcept
 Borrow a process-lifetime C numeric locale handle on fallback builds.
 
bool checkpointUtf8 (std::string_view text) noexcept
 Validate a complete byte sequence as UTF-8 scalar encodings.
 
bool checkpointNetworkPollutants (const SimulationContext &c)
 Recognize the supported native LEGACY network-only pollutant checkpoint profile.
 
void networkPollutantModel (CompletedSourceArchive &a, const SimulationContext &c)
 Append native network pollutant configuration to the model fingerprint archive.
 
bool checkpointReactionComponents (const SimulationContext &c)
 Check that all authored process components fit reaction checkpoint restrictions.
 
void reactionModel (CompletedSourceArchive &a, const SimulationContext &c)
 Append authored and resolved reaction/transport/surface configuration to a fingerprint.
 
void reactionState (CompletedSourceArchive &a, ReactionData &r)
 Archive or restore persistent reaction inventories in schema version three.
 
void validateReactionState (const ReactionData &r, const SimulationContext &c)
 Validate staged reaction state shapes, ownership and finite inventories.
 

Function Documentation

◆ c_locale()

locale_t openswmm::detail::c_locale ( )
inlinenoexcept

Borrow a process-lifetime C numeric locale handle on fallback builds.

Function-local static initialization is synchronized by C++; a failed allocation remains cached and fallback parsing then consults the process locale.

Returns
Cached locale_t or null if newlocale failed; never freed by this helper.
Here is the caller graph for this function:

◆ checkpointNetworkPollutants()

bool openswmm::detail::checkpointNetworkPollutants ( const SimulationContext & c)
inline

Recognize the supported native LEGACY network-only pollutant checkpoint profile.

Qualification predicate only; does not allocate, serialize, verify arbitrary array shapes or validate the current engine boundary.

Parameters
[in]cBorrowed model options/counts and configured treatment/LID/component state.
Returns
True for active legacy pollutant mixing without age, heat, reactions, catchments or any LID/treatment content.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkpointReactionComponents()

bool openswmm::detail::checkpointReactionComponents ( const SimulationContext & c)
inline

Check that all authored process components fit reaction checkpoint restrictions.

Does not itself require a reaction component to exist or validate current inventories.

Parameters
[in]cBorrowed component specs and reaction configuration/compiled flags.
Returns
True for an empty component list, or when every spec is the reactions ID with no args and reactions configured+compiled.

◆ checkpointUtf8()

bool openswmm::detail::checkpointUtf8 ( std::string_view text)
noexcept

Validate a complete byte sequence as UTF-8 scalar encodings.

Does not reject ASCII control characters or impose a normalization policy; JSON quoting escapes controls separately. Allocation-free.

Parameters
[in]textBorrowed bytes, possibly empty or containing ASCII NUL/control characters.
Returns
True for complete shortest-form Unicode scalar encodings; false for truncated/malformed/overlong sequences, surrogates or values >U+10FFFF.
Here is the caller graph for this function:

◆ networkPollutantModel()

void openswmm::detail::networkPollutantModel ( CompletedSourceArchive & a,
const SimulationContext & c )
inline

Append native network pollutant configuration to the model fingerprint archive.

No-op without nodes/pollutants or with quality ignored. Read-mode deserialization affects local copies only and does not install model data. Native representation and archive size/error rules apply; does not serialize dynamic concentrations or mass-balance state.

Parameters
[in,out]aArchive expected in writing mode; receives policy, names, pollutant definitions, initial-quality rows and treatment text.
[in]cBorrowed context copied into local serializable values; original model is unchanged.
Here is the call graph for this function:

◆ reactionModel()

void openswmm::detail::reactionModel ( CompletedSourceArchive & a,
const SimulationContext & c )
inline

Append authored and resolved reaction/transport/surface configuration to a fingerprint.

No-op when reactions are unconfigured, preserving water-only fingerprints. Read mode would modify local copies only. Does not include dynamic species concentrations or ledgers; serialization/allocations can throw.

Parameters
[in,out]aWriting archive for copied model configuration; native serialization/budget rules apply.
[in]cBorrowed model; reaction system text plus transport, surface and land-use parameters are copied.
Here is the call graph for this function:

◆ reactionState()

void openswmm::detail::reactionState ( CompletedSourceArchive & a,
ReactionData & r )
inline

Archive or restore persistent reaction inventories in schema version three.

Rejects other versions with runtime_error. No whole-object rollback on read failure and no dimensional/finite validation here; caller decodes into staging state, then calls validateReactionState before installation. Quantities retain their respective concentration-volume, mass and water units.

Parameters
[in,out]aNative state archive: writing emits fields, reading incrementally replaces them.
[in,out]rReaction state whose booster/species/LID/surface inventories and ledgers participate; authored laws/config remain unchanged.

◆ validateReactionState()

void openswmm::detail::validateReactionState ( const ReactionData & r,
const SimulationContext & c )
inline

Validate staged reaction state shapes, ownership and finite inventories.

Throws runtime_error for mismatched shapes, nonfinite checked inventories, invalid LID ownership or selected negative mass/water/booster entries. LID node outlets permit NaN but reject infinity. Some external-load/booster arrays may be absent; inactive surface state expects empty arrays. Does not mutate/repair data or validate every authored reaction law or every concentration sign.

Parameters
[in]rBorrowed staged state with already validated nonnegative model/species dimension counts.
[in]cCompatible initialized model defining node/link/catchment/storage/LID ownership dimensions.
Here is the call graph for this function: